mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2025-02-25 18:55:28 -06:00
test updates
This commit is contained in:
@@ -28,11 +28,13 @@ class NBComponentLifecycleTest {
|
|||||||
TestComponent root = new TestComponent("role", "root");
|
TestComponent root = new TestComponent("role", "root");
|
||||||
TestComponent node1 = new TestComponent(root, "node1", "node1");
|
TestComponent node1 = new TestComponent(root, "node1", "node1");
|
||||||
TestComponent node2 = new TestComponent(root, "node2", "node2");
|
TestComponent node2 = new TestComponent(root, "node2", "node2");
|
||||||
TestComponent node3 = new TestComponent(root, "node3", "node3");
|
|
||||||
|
|
||||||
try (NBComponentSubScope scope = new NBComponentSubScope(node1)) {
|
try (NBComponentSubScope scope = new NBComponentSubScope(node1)) {
|
||||||
System.out.println("node1 active");
|
System.out.println("node1 active");
|
||||||
}
|
}
|
||||||
|
try (NBComponentSubScope scope = new NBComponentSubScope(node2)) {
|
||||||
|
System.out.println("node2 active");
|
||||||
|
}
|
||||||
|
|
||||||
System.out.print("node1 inactive");
|
System.out.print("node1 inactive");
|
||||||
|
|
||||||
|
|||||||
@@ -26,6 +26,16 @@ import static org.assertj.core.api.Assertions.assertThat;
|
|||||||
|
|
||||||
class NBComponentTraversalTest {
|
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 a = new TestComponent("name_a","a");
|
||||||
private final static TestComponent sub1 = new TestComponent(a, "name_1", "1");
|
private final static TestComponent sub1 = new TestComponent(a, "name_1", "1");
|
||||||
private final static TestComponent sub2 = new TestComponent(a, "name_2", "2");
|
private final static TestComponent sub2 = new TestComponent(a, "name_2", "2");
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ class NBComponentViewsTest {
|
|||||||
.attach(new TestComponent("e", "f"));
|
.attach(new TestComponent("e", "f"));
|
||||||
System.out.println(NBComponentViews.treeView(root));
|
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())));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user