test updates

This commit is contained in:
Jonathan Shook 2023-09-29 02:09:47 -05:00
parent 9de6bad6ff
commit a9fe6fb07e
3 changed files with 14 additions and 2 deletions

View File

@ -28,11 +28,13 @@ class NBComponentLifecycleTest {
TestComponent root = new TestComponent("role", "root");
TestComponent node1 = new TestComponent(root, "node1", "node1");
TestComponent node2 = new TestComponent(root, "node2", "node2");
TestComponent node3 = new TestComponent(root, "node3", "node3");
try (NBComponentSubScope scope = new NBComponentSubScope(node1)) {
System.out.println("node1 active");
}
try (NBComponentSubScope scope = new NBComponentSubScope(node2)) {
System.out.println("node2 active");
}
System.out.print("node1 inactive");

View File

@ -26,6 +26,16 @@ import static org.assertj.core.api.Assertions.assertThat;
class NBComponentTraversalTest {
/**
* <pre>{@code
* equivalent to
* private final static NBComponent a = new TestComponent("name_a","a")
* .attach(new TestComponent("name_1","1"))
* .attach(new TestComponent("name_2","2")
* .attach(new TestComponent("name_X","X"))
* .attach(new TestComponent("name_Y","Y")));
* }</pre>
*/
private final static TestComponent a = new TestComponent("name_a","a");
private final static TestComponent sub1 = new TestComponent(a, "name_1", "1");
private final static TestComponent sub2 = new TestComponent(a, "name_2", "2");

View File

@ -31,7 +31,7 @@ class NBComponentViewsTest {
.attach(new TestComponent("e", "f"));
System.out.println(NBComponentViews.treeView(root));
System.out.println(NBComponentViews.treeView(root, c -> c.getLabels().asMap().keySet().stream().findFirst().orElseThrow()));
System.out.println(NBComponentViews.treeView(root, c -> String.valueOf(c.hashCode())));
}
}