From a9fe6fb07e55e257c16ae7910b6667743d26275b Mon Sep 17 00:00:00 2001 From: Jonathan Shook Date: Fri, 29 Sep 2023 02:09:47 -0500 Subject: [PATCH] test updates --- .../components/NBComponentLifecycleTest.java | 4 +++- .../components/NBComponentTraversalTest.java | 10 ++++++++++ .../io/nosqlbench/components/NBComponentViewsTest.java | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/nb-api/src/test/java/io/nosqlbench/components/NBComponentLifecycleTest.java b/nb-api/src/test/java/io/nosqlbench/components/NBComponentLifecycleTest.java index 0bc4e3d13..31c39f7c9 100644 --- a/nb-api/src/test/java/io/nosqlbench/components/NBComponentLifecycleTest.java +++ b/nb-api/src/test/java/io/nosqlbench/components/NBComponentLifecycleTest.java @@ -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"); diff --git a/nb-api/src/test/java/io/nosqlbench/components/NBComponentTraversalTest.java b/nb-api/src/test/java/io/nosqlbench/components/NBComponentTraversalTest.java index a203aca1a..818f61768 100644 --- a/nb-api/src/test/java/io/nosqlbench/components/NBComponentTraversalTest.java +++ b/nb-api/src/test/java/io/nosqlbench/components/NBComponentTraversalTest.java @@ -26,6 +26,16 @@ import static org.assertj.core.api.Assertions.assertThat; class NBComponentTraversalTest { + /** + *
{@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")));
+     * }
+ */ 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"); diff --git a/nb-api/src/test/java/io/nosqlbench/components/NBComponentViewsTest.java b/nb-api/src/test/java/io/nosqlbench/components/NBComponentViewsTest.java index 9145c9578..359639e60 100644 --- a/nb-api/src/test/java/io/nosqlbench/components/NBComponentViewsTest.java +++ b/nb-api/src/test/java/io/nosqlbench/components/NBComponentViewsTest.java @@ -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()))); } }