cleanup dumps from review

Signed-off-by: Greg Wilkins <gregw@webtide.com>
This commit is contained in:
Greg Wilkins 2019-05-02 10:57:51 +02:00
parent aafb0fcec1
commit 604f2379bd
2 changed files with 15 additions and 6 deletions

View File

@ -34,6 +34,7 @@ import org.eclipse.jetty.util.IncludeExclude;
import org.eclipse.jetty.util.IncludeExcludeSet; import org.eclipse.jetty.util.IncludeExcludeSet;
import org.eclipse.jetty.util.InetAddressSet; import org.eclipse.jetty.util.InetAddressSet;
import org.eclipse.jetty.util.component.Dumpable; import org.eclipse.jetty.util.component.Dumpable;
import org.eclipse.jetty.util.component.DumpableCollection;
import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.log.Log;
import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.log.Logger;
@ -202,9 +203,9 @@ public class InetAccessHandler extends HandlerWrapper
public void dump(Appendable out, String indent) throws IOException public void dump(Appendable out, String indent) throws IOException
{ {
dumpObjects(out, indent, dumpObjects(out, indent,
Dumpable.labelled("included", _addrs.getIncluded()), new DumpableCollection("included", _addrs.getIncluded()),
Dumpable.labelled("excluded", _addrs.getExcluded()), new DumpableCollection("excluded", _addrs.getExcluded()),
Dumpable.labelled("includedConnectorNames", _names.getIncluded()), new DumpableCollection("includedConnectorNames", _names.getIncluded()),
Dumpable.labelled("excludedConnectorNames", _names.getExcluded())); new DumpableCollection("excludedConnectorNames", _names.getExcluded()));
} }
} }

View File

@ -26,9 +26,8 @@ import java.util.Collection;
import org.hamcrest.Matchers; import org.hamcrest.Matchers;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
public class DumpableCollectionTest public class DumpableTest
{ {
@Test @Test
public void testNullDumpableCollection () throws Exception public void testNullDumpableCollection () throws Exception
{ {
@ -51,4 +50,13 @@ public class DumpableCollectionTest
assertThat(dump, Matchers.containsString("two")); assertThat(dump, Matchers.containsString("two"));
assertThat(dump, Matchers.containsString("three")); assertThat(dump, Matchers.containsString("three"));
} }
@Test
public void testDumpableLabelled() throws Exception
{
String dump = Dumpable.labelled("label", "Item").dump();
assertThat(dump, Matchers.containsString("label:"));
assertThat(dump, Matchers.containsString("Item"));
}
} }