Issue #3132 improve dump readability
fixed tests Signed-off-by: Greg Wilkins <gregw@webtide.com>
This commit is contained in:
parent
fc0d2569ef
commit
92317a7bb4
|
@ -29,7 +29,7 @@ import java.net.URLClassLoader;
|
|||
import org.eclipse.jetty.util.component.Dumpable;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
public class ClassLoaderDumptTest
|
||||
public class ClassLoaderDumpTest
|
||||
{
|
||||
@Test
|
||||
public void testSimple() throws Exception
|
||||
|
@ -48,8 +48,8 @@ public class ClassLoaderDumptTest
|
|||
StringBuilder out = new StringBuilder();
|
||||
server.dump(out);
|
||||
String dump = out.toString();
|
||||
assertThat(dump,containsString("+-SimpleLoader"));
|
||||
assertThat(dump,containsString("+>"+Server.class.getClassLoader()));
|
||||
assertThat(dump,containsString("+- SimpleLoader"));
|
||||
assertThat(dump,containsString("+> "+Server.class.getClassLoader()));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -69,9 +69,9 @@ public class ClassLoaderDumptTest
|
|||
StringBuilder out = new StringBuilder();
|
||||
server.dump(out);
|
||||
String dump = out.toString();
|
||||
assertThat(dump,containsString("+-ParentedLoader"));
|
||||
assertThat(dump,containsString("| +>"+Server.class.getClassLoader()));
|
||||
assertThat(dump,containsString("+>"+Server.class.getClassLoader()));
|
||||
assertThat(dump,containsString("+- ParentedLoader"));
|
||||
assertThat(dump,containsString("| +> "+Server.class.getClassLoader()));
|
||||
assertThat(dump,containsString("+> "+Server.class.getClassLoader()));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -98,10 +98,10 @@ public class ClassLoaderDumptTest
|
|||
StringBuilder out = new StringBuilder();
|
||||
server.dump(out);
|
||||
String dump = out.toString();
|
||||
assertThat(dump,containsString("+-TopLoader"));
|
||||
assertThat(dump,containsString("| +>MiddleLoader"));
|
||||
assertThat(dump,containsString("| +>"+Server.class.getClassLoader()));
|
||||
assertThat(dump,containsString("+>"+Server.class.getClassLoader()));
|
||||
assertThat(dump,containsString("+- TopLoader"));
|
||||
assertThat(dump,containsString("| +> MiddleLoader"));
|
||||
assertThat(dump,containsString("| +> "+Server.class.getClassLoader()));
|
||||
assertThat(dump,containsString("+> "+Server.class.getClassLoader()));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -122,10 +122,10 @@ public class ClassLoaderDumptTest
|
|||
StringBuilder out = new StringBuilder();
|
||||
server.dump(out);
|
||||
String dump = out.toString();
|
||||
assertThat(dump,containsString("+-TopLoader"));
|
||||
assertThat(dump,containsString("| +>DumpableClassLoader"));
|
||||
assertThat(dump,not(containsString("| +>"+Server.class.getClassLoader())));
|
||||
assertThat(dump,containsString("+>"+Server.class.getClassLoader()));
|
||||
assertThat(dump,containsString("+- TopLoader"));
|
||||
assertThat(dump,containsString("| +> DumpableClassLoader"));
|
||||
assertThat(dump,not(containsString("| +> "+Server.class.getClassLoader())));
|
||||
assertThat(dump,containsString("+> "+Server.class.getClassLoader()));
|
||||
}
|
||||
|
||||
public static class DumpableClassLoader extends ClassLoader implements Dumpable
|
||||
|
@ -184,15 +184,15 @@ public class ClassLoaderDumptTest
|
|||
server.dump(out);
|
||||
String dump = out.toString();
|
||||
// System.err.println(dump);
|
||||
assertThat(dump,containsString("+-TopLoader"));
|
||||
assertThat(dump,containsString("| | +>file:/ONE"));
|
||||
assertThat(dump,containsString("| | +>file:/TWO"));
|
||||
assertThat(dump,containsString("| | +>file:/THREE"));
|
||||
assertThat(dump,containsString("| +>MiddleLoader"));
|
||||
assertThat(dump,containsString("| | +>file:/one"));
|
||||
assertThat(dump,containsString("| | +>file:/two"));
|
||||
assertThat(dump,containsString("| | +>file:/three"));
|
||||
assertThat(dump,containsString("| +>"+Server.class.getClassLoader()));
|
||||
assertThat(dump,containsString("+>"+Server.class.getClassLoader()));
|
||||
assertThat(dump,containsString("+- TopLoader"));
|
||||
assertThat(dump,containsString("| | +> file:/ONE"));
|
||||
assertThat(dump,containsString("| | +> file:/TWO"));
|
||||
assertThat(dump,containsString("| | +> file:/THREE"));
|
||||
assertThat(dump,containsString("| +> MiddleLoader"));
|
||||
assertThat(dump,containsString("| | +> file:/one"));
|
||||
assertThat(dump,containsString("| | +> file:/two"));
|
||||
assertThat(dump,containsString("| | +> file:/three"));
|
||||
assertThat(dump,containsString("| +> "+Server.class.getClassLoader()));
|
||||
assertThat(dump,containsString("+> "+Server.class.getClassLoader()));
|
||||
}
|
||||
}
|
|
@ -215,59 +215,59 @@ public class ContainerLifeCycleTest
|
|||
a0.addBean(aa0);
|
||||
dump = trim(a0.dump());
|
||||
dump = check(dump, "ContainerLifeCycl");
|
||||
dump = check(dump, "+?ContainerLife");
|
||||
dump = check(dump, "+? ContainerLife");
|
||||
|
||||
ContainerLifeCycle aa1 = new ContainerLifeCycle();
|
||||
a0.addBean(aa1);
|
||||
dump = trim(a0.dump());
|
||||
dump = check(dump, "ContainerLifeCycl");
|
||||
dump = check(dump, "+?ContainerLife");
|
||||
dump = check(dump, "+?ContainerLife");
|
||||
dump = check(dump, "+? ContainerLife");
|
||||
dump = check(dump, "+? ContainerLife");
|
||||
dump = check(dump, "");
|
||||
|
||||
ContainerLifeCycle aa2 = new ContainerLifeCycle();
|
||||
a0.addBean(aa2, false);
|
||||
dump = trim(a0.dump());
|
||||
dump = check(dump, "ContainerLifeCycl");
|
||||
dump = check(dump, "+?ContainerLife");
|
||||
dump = check(dump, "+?ContainerLife");
|
||||
dump = check(dump, "+~ContainerLife");
|
||||
dump = check(dump, "+? ContainerLife");
|
||||
dump = check(dump, "+? ContainerLife");
|
||||
dump = check(dump, "+~ ContainerLife");
|
||||
dump = check(dump, "");
|
||||
|
||||
aa1.start();
|
||||
a0.start();
|
||||
dump = trim(a0.dump());
|
||||
dump = check(dump, "ContainerLifeCycl");
|
||||
dump = check(dump, "+=ContainerLife");
|
||||
dump = check(dump, "+~ContainerLife");
|
||||
dump = check(dump, "+~ContainerLife");
|
||||
dump = check(dump, "+= ContainerLife");
|
||||
dump = check(dump, "+~ ContainerLife");
|
||||
dump = check(dump, "+~ ContainerLife");
|
||||
dump = check(dump, "");
|
||||
|
||||
a0.manage(aa1);
|
||||
a0.removeBean(aa2);
|
||||
dump = trim(a0.dump());
|
||||
dump = check(dump, "ContainerLifeCycl");
|
||||
dump = check(dump, "+=ContainerLife");
|
||||
dump = check(dump, "+=ContainerLife");
|
||||
dump = check(dump, "+= ContainerLife");
|
||||
dump = check(dump, "+= ContainerLife");
|
||||
dump = check(dump, "");
|
||||
|
||||
ContainerLifeCycle aaa0 = new ContainerLifeCycle();
|
||||
aa0.addBean(aaa0);
|
||||
dump = trim(a0.dump());
|
||||
dump = check(dump, "ContainerLifeCycl");
|
||||
dump = check(dump, "+=ContainerLife");
|
||||
dump = check(dump, "| +~Container");
|
||||
dump = check(dump, "+=ContainerLife");
|
||||
dump = check(dump, "+= ContainerLife");
|
||||
dump = check(dump, "| +~ Container");
|
||||
dump = check(dump, "+= ContainerLife");
|
||||
dump = check(dump, "");
|
||||
|
||||
ContainerLifeCycle aa10 = new ContainerLifeCycle();
|
||||
aa1.addBean(aa10, true);
|
||||
dump = trim(a0.dump());
|
||||
dump = check(dump, "ContainerLifeCycl");
|
||||
dump = check(dump, "+=ContainerLife");
|
||||
dump = check(dump, "| +~Container");
|
||||
dump = check(dump, "+=ContainerLife");
|
||||
dump = check(dump, " +=Container");
|
||||
dump = check(dump, "+= ContainerLife");
|
||||
dump = check(dump, "| +~ Container");
|
||||
dump = check(dump, "+= ContainerLife");
|
||||
dump = check(dump, " += Container");
|
||||
dump = check(dump, "");
|
||||
|
||||
final ContainerLifeCycle a1 = new ContainerLifeCycle();
|
||||
|
@ -288,62 +288,62 @@ public class ContainerLifeCycleTest
|
|||
|
||||
dump = trim(a0.dump());
|
||||
dump = check(dump, "ContainerLifeCycl");
|
||||
dump = check(dump, "+=ContainerLife");
|
||||
dump = check(dump, "| +~Container");
|
||||
dump = check(dump, "+=ContainerLife");
|
||||
dump = check(dump, "| +=Container");
|
||||
dump = check(dump, "+=ContainerLife");
|
||||
dump = check(dump, " +>java.util.Arrays$ArrayList");
|
||||
dump = check(dump, " | +:ContainerLifeCycle");
|
||||
dump = check(dump, " | +:ContainerLifeCycle");
|
||||
dump = check(dump, " +>java.util.Arrays$ArrayList");
|
||||
dump = check(dump, " +:ContainerLifeCycle");
|
||||
dump = check(dump, " +:ContainerLifeCycle");
|
||||
dump = check(dump, "+= ContainerLife");
|
||||
dump = check(dump, "| +~ Container");
|
||||
dump = check(dump, "+= ContainerLife");
|
||||
dump = check(dump, "| += Container");
|
||||
dump = check(dump, "+= ContainerLife");
|
||||
dump = check(dump, " +> java.util.Arrays$ArrayList");
|
||||
dump = check(dump, " | +: ContainerLifeCycle");
|
||||
dump = check(dump, " | +: ContainerLifeCycle");
|
||||
dump = check(dump, " +> java.util.Arrays$ArrayList");
|
||||
dump = check(dump, " +: ContainerLifeCycle");
|
||||
dump = check(dump, " +: ContainerLifeCycle");
|
||||
dump = check(dump, "");
|
||||
|
||||
a2.addBean(aa0, true);
|
||||
dump = trim(a0.dump());
|
||||
dump = check(dump, "ContainerLifeCycl");
|
||||
dump = check(dump, "+=ContainerLife");
|
||||
dump = check(dump, "| +~Container");
|
||||
dump = check(dump, "+=ContainerLife");
|
||||
dump = check(dump, "| +=Container");
|
||||
dump = check(dump, "+=ContainerLife");
|
||||
dump = check(dump, " +>java.util.Arrays$ArrayList");
|
||||
dump = check(dump, " | +:ContainerLifeCycle");
|
||||
dump = check(dump, " | +:ContainerLifeCycle");
|
||||
dump = check(dump, " | +=Conta");
|
||||
dump = check(dump, " | +~C");
|
||||
dump = check(dump, " +>java.util.Arrays$ArrayList");
|
||||
dump = check(dump, " +:ContainerLifeCycle");
|
||||
dump = check(dump, " +:ContainerLifeCycle");
|
||||
dump = check(dump, "+= ContainerLife");
|
||||
dump = check(dump, "| +~ Container");
|
||||
dump = check(dump, "+= ContainerLife");
|
||||
dump = check(dump, "| += Container");
|
||||
dump = check(dump, "+= ContainerLife");
|
||||
dump = check(dump, " +> java.util.Arrays$ArrayList");
|
||||
dump = check(dump, " | +: ContainerLifeCycle");
|
||||
dump = check(dump, " | +: ContainerLifeCycle");
|
||||
dump = check(dump, " | += Conta");
|
||||
dump = check(dump, " | +~ C");
|
||||
dump = check(dump, " +> java.util.Arrays$ArrayList");
|
||||
dump = check(dump, " +: ContainerLifeCycle");
|
||||
dump = check(dump, " +: ContainerLifeCycle");
|
||||
dump = check(dump, "");
|
||||
|
||||
a2.unmanage(aa0);
|
||||
dump = trim(a0.dump());
|
||||
dump = check(dump, "ContainerLifeCycl");
|
||||
dump = check(dump, "+=ContainerLife");
|
||||
dump = check(dump, "| +~Container");
|
||||
dump = check(dump, "+=ContainerLife");
|
||||
dump = check(dump, "| +=Container");
|
||||
dump = check(dump, "+=ContainerLife");
|
||||
dump = check(dump, " +>java.util.Arrays$ArrayList");
|
||||
dump = check(dump, " | +:ContainerLifeCycle");
|
||||
dump = check(dump, " | +:ContainerLifeCycle");
|
||||
dump = check(dump, " | +~Conta");
|
||||
dump = check(dump, " +>java.util.Arrays$ArrayList");
|
||||
dump = check(dump, " +:ContainerLifeCycle");
|
||||
dump = check(dump, " +:ContainerLifeCycle");
|
||||
dump = check(dump, "+= ContainerLife");
|
||||
dump = check(dump, "| +~ Container");
|
||||
dump = check(dump, "+= ContainerLife");
|
||||
dump = check(dump, "| += Container");
|
||||
dump = check(dump, "+= ContainerLife");
|
||||
dump = check(dump, " +> java.util.Arrays$ArrayList");
|
||||
dump = check(dump, " | +: ContainerLifeCycle");
|
||||
dump = check(dump, " | +: ContainerLifeCycle");
|
||||
dump = check(dump, " | +~ Conta");
|
||||
dump = check(dump, " +> java.util.Arrays$ArrayList");
|
||||
dump = check(dump, " +: ContainerLifeCycle");
|
||||
dump = check(dump, " +: ContainerLifeCycle");
|
||||
dump = check(dump, "");
|
||||
|
||||
a0.unmanage(aa);
|
||||
dump = trim(a0.dump());
|
||||
dump = check(dump, "ContainerLifeCycl");
|
||||
dump = check(dump, "+=ContainerLife");
|
||||
dump = check(dump, "| +~Container");
|
||||
dump = check(dump, "+=ContainerLife");
|
||||
dump = check(dump, "| +=Container");
|
||||
dump = check(dump, "+~ContainerLife");
|
||||
dump = check(dump, "+= ContainerLife");
|
||||
dump = check(dump, "| +~ Container");
|
||||
dump = check(dump, "+= ContainerLife");
|
||||
dump = check(dump, "| += Container");
|
||||
dump = check(dump, "+~ ContainerLife");
|
||||
dump = check(dump, "");
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue