mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2024-12-23 15:40:44 -06:00
test updates
This commit is contained in:
parent
9de6bad6ff
commit
a9fe6fb07e
@ -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");
|
||||
|
||||
|
@ -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");
|
||||
|
@ -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())));
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user