http://git-wip-us.apache.org/repos/asf/curator/blob/ef9df2b7/curator-x-async/src/main/java/org/apache/curator/x/async/modeled/details/ZPathImpl.java ---------------------------------------------------------------------- diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/modeled/details/ZPathImpl.java b/curator-x-async/src/main/java/org/apache/curator/x/async/modeled/details/ZPathImpl.java index b6c0d2f..a184f30 100644 --- a/curator-x-async/src/main/java/org/apache/curator/x/async/modeled/details/ZPathImpl.java +++ b/curator-x-async/src/main/java/org/apache/curator/x/async/modeled/details/ZPathImpl.java @@ -35,11 +35,13 @@ import java.util.function.UnaryOperator; import java.util.regex.Pattern; import java.util.stream.Collectors; +import static org.apache.curator.utils.ZKPaths.PATH_SEPARATOR; +import static org.apache.curator.x.async.modeled.ZPath.idName; +import static org.apache.curator.x.async.modeled.ZPath.parameterNodeName; + public class ZPathImpl implements ZPath { - public static final ZPath root = new ZPathImpl(Collections.singletonList(ZKPaths.PATH_SEPARATOR), null, null); - - public static final String parameter = ""; // empty paths are illegal so it's useful for this purpose + public static final ZPath root = new ZPathImpl(Collections.singletonList(PATH_SEPARATOR), null, null); private final List<String> nodes; private final boolean isResolved; @@ -53,9 +55,9 @@ public class ZPathImpl implements ZPath private static ZPathImpl parseInternal(String fullPath, UnaryOperator<String> nameFilter) { List<String> nodes = ImmutableList.<String>builder() - .add(ZKPaths.PATH_SEPARATOR) + .add(PATH_SEPARATOR) .addAll( - Splitter.on(ZKPaths.PATH_SEPARATOR) + Splitter.on(PATH_SEPARATOR) .omitEmptyStrings() .splitToList(fullPath) .stream() @@ -95,12 +97,12 @@ public class ZPathImpl implements ZPath } else { - builder.addAll(Splitter.on(ZKPaths.PATH_SEPARATOR).omitEmptyStrings().splitToList(base.fullPath())); + builder.addAll(Splitter.on(PATH_SEPARATOR).omitEmptyStrings().splitToList(base.fullPath())); } } else { - builder.add(ZKPaths.PATH_SEPARATOR); + builder.add(PATH_SEPARATOR); } List<String> nodes = builder.addAll(names).build(); return new ZPathImpl(nodes, null, null); @@ -143,7 +145,7 @@ public class ZPathImpl implements ZPath @Override public Pattern toSchemaPathPattern() { - return Pattern.compile(fullPath() + ZKPaths.PATH_SEPARATOR + ".*"); + return Pattern.compile(fullPath() + PATH_SEPARATOR + ".*"); } @Override @@ -193,7 +195,7 @@ public class ZPathImpl implements ZPath @Override public String toString() { - String value = nodes.stream().map(name -> name.equals(parameter) ? "{p}" : name).collect(Collectors.joining(ZKPaths.PATH_SEPARATOR, ZKPaths.PATH_SEPARATOR, "")); + String value = nodes.stream().map(name -> name.equals(parameterNodeName) ? idName : name).collect(Collectors.joining(PATH_SEPARATOR, PATH_SEPARATOR, "")); return "ZPathImpl{" + value + '}'; } @@ -203,7 +205,7 @@ public class ZPathImpl implements ZPath Iterator<Object> iterator = parameters.iterator(); List<String> nodeNames = nodes.stream() .map(name -> { - if ( name.equals(parameter) ) + if ( name.equals(parameterNodeName) ) { if ( !iterator.hasNext() ) { @@ -234,7 +236,7 @@ public class ZPathImpl implements ZPath builder.add(child); } this.nodes = builder.build(); - isResolved = (parameterSuppliers != null) || !this.nodes.contains(parameter); + isResolved = (parameterSuppliers != null) || !this.nodes.contains(parameterNodeName); } private void checkRootAccess() @@ -260,10 +262,10 @@ public class ZPathImpl implements ZPath { if ( i > 1 ) { - str.append(ZKPaths.PATH_SEPARATOR); + str.append(PATH_SEPARATOR); } String value = nodes.get(i); - if ( value.equals(parameter) ) + if ( value.equals(parameterNodeName) ) { if ( (parameterSuppliers == null) || (parameterSuppliers.size() <= parameterIndex) ) { @@ -278,14 +280,14 @@ public class ZPathImpl implements ZPath private static void validate(String nodeName) { - if ( parameter.equals(Objects.requireNonNull(nodeName, "nodeName cannot be null")) ) + if ( parameterNodeName.equals(Objects.requireNonNull(nodeName, "nodeName cannot be null")) ) { return; } - if ( nodeName.equals(ZKPaths.PATH_SEPARATOR) ) + if ( nodeName.equals(PATH_SEPARATOR) ) { return; } - PathUtils.validatePath(ZKPaths.PATH_SEPARATOR + nodeName); + PathUtils.validatePath(PATH_SEPARATOR + nodeName); } }
http://git-wip-us.apache.org/repos/asf/curator/blob/ef9df2b7/curator-x-async/src/main/java/org/apache/curator/x/async/modeled/typed/TypedModelSpec.java ---------------------------------------------------------------------- diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/modeled/typed/TypedModelSpec.java b/curator-x-async/src/main/java/org/apache/curator/x/async/modeled/typed/TypedModelSpec.java new file mode 100644 index 0000000..8e0f101 --- /dev/null +++ b/curator-x-async/src/main/java/org/apache/curator/x/async/modeled/typed/TypedModelSpec.java @@ -0,0 +1,29 @@ +package org.apache.curator.x.async.modeled.typed; + +import org.apache.curator.x.async.modeled.ModelSpec; +import org.apache.curator.x.async.modeled.ModelSpecBuilder; + +public interface TypedModelSpec<M, P1> +{ + /** + * Resolve into a ZPath using the given parameter + * + * @param p1 the parameter + * @return ZPath + */ + ModelSpec<M> resolved(P1 p1); + + /** + * Return a new TypedModelSpec using the given model spec builder and typed path. When + * {@link #resolved(Object)} is called the actual model spec is generated with the + * resolved path + * + * @param builder model spec builder + * @param path typed path + * @return new TypedModelSpec + */ + static <M, P1> TypedModelSpec<M, P1> from(ModelSpecBuilder<M> builder, TypedZPath<P1> path) + { + return p1 -> builder.withPath(path.resolved(p1)).build(); + } +} http://git-wip-us.apache.org/repos/asf/curator/blob/ef9df2b7/curator-x-async/src/main/java/org/apache/curator/x/async/modeled/typed/TypedModelSpec10.java ---------------------------------------------------------------------- diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/modeled/typed/TypedModelSpec10.java b/curator-x-async/src/main/java/org/apache/curator/x/async/modeled/typed/TypedModelSpec10.java new file mode 100644 index 0000000..b31aaa5 --- /dev/null +++ b/curator-x-async/src/main/java/org/apache/curator/x/async/modeled/typed/TypedModelSpec10.java @@ -0,0 +1,23 @@ +package org.apache.curator.x.async.modeled.typed; + +import org.apache.curator.x.async.modeled.ModelSpec; +import org.apache.curator.x.async.modeled.ModelSpecBuilder; + +public interface TypedModelSpec10<M, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10> +{ + ModelSpec<M> resolved(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9, P10 p10); + + /** + * Return a new TypedModelSpec using the given model spec builder and typed path. When + * {@link #resolved(Object, Object, Object, Object, Object, Object, Object, Object, Object, Object)} is called the actual model spec is generated with the + * resolved path + * + * @param builder model spec builder + * @param path typed path + * @return new TypedModelSpec + */ + static <M, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10> TypedModelSpec10<M, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10> from(ModelSpecBuilder<M> builder, TypedZPath10<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10> path) + { + return (p1, p2, p3, p4, p5, p6, p7, p8, p9, p10) -> builder.withPath(path.resolved(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10)).build(); + } +} http://git-wip-us.apache.org/repos/asf/curator/blob/ef9df2b7/curator-x-async/src/main/java/org/apache/curator/x/async/modeled/typed/TypedModelSpec2.java ---------------------------------------------------------------------- diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/modeled/typed/TypedModelSpec2.java b/curator-x-async/src/main/java/org/apache/curator/x/async/modeled/typed/TypedModelSpec2.java new file mode 100644 index 0000000..19fed0a --- /dev/null +++ b/curator-x-async/src/main/java/org/apache/curator/x/async/modeled/typed/TypedModelSpec2.java @@ -0,0 +1,23 @@ +package org.apache.curator.x.async.modeled.typed; + +import org.apache.curator.x.async.modeled.ModelSpec; +import org.apache.curator.x.async.modeled.ModelSpecBuilder; + +public interface TypedModelSpec2<M, P1, P2> +{ + ModelSpec<M> resolved(P1 p1, P2 p2); + + /** + * Return a new TypedModelSpec using the given model spec builder and typed path. When + * {@link #resolved(Object, Object)} is called the actual model spec is generated with the + * resolved path + * + * @param builder model spec builder + * @param path typed path + * @return new TypedModelSpec + */ + static <M, P1, P2> TypedModelSpec2<M, P1, P2> from(ModelSpecBuilder<M> builder, TypedZPath2<P1, P2> path) + { + return (p1, p2) -> builder.withPath(path.resolved(p1, p2)).build(); + } +} http://git-wip-us.apache.org/repos/asf/curator/blob/ef9df2b7/curator-x-async/src/main/java/org/apache/curator/x/async/modeled/typed/TypedModelSpec3.java ---------------------------------------------------------------------- diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/modeled/typed/TypedModelSpec3.java b/curator-x-async/src/main/java/org/apache/curator/x/async/modeled/typed/TypedModelSpec3.java new file mode 100644 index 0000000..2dc7595 --- /dev/null +++ b/curator-x-async/src/main/java/org/apache/curator/x/async/modeled/typed/TypedModelSpec3.java @@ -0,0 +1,23 @@ +package org.apache.curator.x.async.modeled.typed; + +import org.apache.curator.x.async.modeled.ModelSpec; +import org.apache.curator.x.async.modeled.ModelSpecBuilder; + +public interface TypedModelSpec3<M, P1, P2, P3> +{ + ModelSpec<M> resolved(P1 p1, P2 p2, P3 p3); + + /** + * Return a new TypedModelSpec using the given model spec builder and typed path. When + * {@link #resolved(Object, Object, Object)} is called the actual model spec is generated with the + * resolved path + * + * @param builder model spec builder + * @param path typed path + * @return new TypedModelSpec + */ + static <M, P1, P2, P3> TypedModelSpec3<M, P1, P2, P3> from(ModelSpecBuilder<M> builder, TypedZPath3<P1, P2, P3> path) + { + return (p1, p2, p3) -> builder.withPath(path.resolved(p1, p2, p3)).build(); + } +} http://git-wip-us.apache.org/repos/asf/curator/blob/ef9df2b7/curator-x-async/src/main/java/org/apache/curator/x/async/modeled/typed/TypedModelSpec4.java ---------------------------------------------------------------------- diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/modeled/typed/TypedModelSpec4.java b/curator-x-async/src/main/java/org/apache/curator/x/async/modeled/typed/TypedModelSpec4.java new file mode 100644 index 0000000..d233be5 --- /dev/null +++ b/curator-x-async/src/main/java/org/apache/curator/x/async/modeled/typed/TypedModelSpec4.java @@ -0,0 +1,23 @@ +package org.apache.curator.x.async.modeled.typed; + +import org.apache.curator.x.async.modeled.ModelSpec; +import org.apache.curator.x.async.modeled.ModelSpecBuilder; + +public interface TypedModelSpec4<M, P1, P2, P3, P4> +{ + ModelSpec<M> resolved(P1 p1, P2 p2, P3 p3, P4 p4); + + /** + * Return a new TypedModelSpec using the given model spec builder and typed path. When + * {@link #resolved(Object, Object, Object, Object)} is called the actual model spec is generated with the + * resolved path + * + * @param builder model spec builder + * @param path typed path + * @return new TypedModelSpec + */ + static <M, P1, P2, P3, P4> TypedModelSpec4<M, P1, P2, P3, P4> from(ModelSpecBuilder<M> builder, TypedZPath4<P1, P2, P3, P4> path) + { + return (p1, p2, p3, p4) -> builder.withPath(path.resolved(p1, p2, p3, p4)).build(); + } +} http://git-wip-us.apache.org/repos/asf/curator/blob/ef9df2b7/curator-x-async/src/main/java/org/apache/curator/x/async/modeled/typed/TypedModelSpec5.java ---------------------------------------------------------------------- diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/modeled/typed/TypedModelSpec5.java b/curator-x-async/src/main/java/org/apache/curator/x/async/modeled/typed/TypedModelSpec5.java new file mode 100644 index 0000000..685cf2c --- /dev/null +++ b/curator-x-async/src/main/java/org/apache/curator/x/async/modeled/typed/TypedModelSpec5.java @@ -0,0 +1,23 @@ +package org.apache.curator.x.async.modeled.typed; + +import org.apache.curator.x.async.modeled.ModelSpec; +import org.apache.curator.x.async.modeled.ModelSpecBuilder; + +public interface TypedModelSpec5<M, P1, P2, P3, P4, P5> +{ + ModelSpec<M> resolved(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5); + + /** + * Return a new TypedModelSpec using the given model spec builder and typed path. When + * {@link #resolved(Object, Object, Object, Object, Object)} is called the actual model spec is generated with the + * resolved path + * + * @param builder model spec builder + * @param path typed path + * @return new TypedModelSpec + */ + static <M, P1, P2, P3, P4, P5> TypedModelSpec5<M, P1, P2, P3, P4, P5> from(ModelSpecBuilder<M> builder, TypedZPath5<P1, P2, P3, P4, P5> path) + { + return (p1, p2, p3, p4, p5) -> builder.withPath(path.resolved(p1, p2, p3, p4, p5)).build(); + } +} http://git-wip-us.apache.org/repos/asf/curator/blob/ef9df2b7/curator-x-async/src/main/java/org/apache/curator/x/async/modeled/typed/TypedModelSpec6.java ---------------------------------------------------------------------- diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/modeled/typed/TypedModelSpec6.java b/curator-x-async/src/main/java/org/apache/curator/x/async/modeled/typed/TypedModelSpec6.java new file mode 100644 index 0000000..abe811f --- /dev/null +++ b/curator-x-async/src/main/java/org/apache/curator/x/async/modeled/typed/TypedModelSpec6.java @@ -0,0 +1,23 @@ +package org.apache.curator.x.async.modeled.typed; + +import org.apache.curator.x.async.modeled.ModelSpec; +import org.apache.curator.x.async.modeled.ModelSpecBuilder; + +public interface TypedModelSpec6<M, P1, P2, P3, P4, P5, P6> +{ + ModelSpec<M> resolved(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6); + + /** + * Return a new TypedModelSpec using the given model spec builder and typed path. When + * {@link #resolved(Object, Object, Object, Object, Object, Object)} is called the actual model spec is generated with the + * resolved path + * + * @param builder model spec builder + * @param path typed path + * @return new TypedModelSpec + */ + static <M, P1, P2, P3, P4, P5, P6> TypedModelSpec6<M, P1, P2, P3, P4, P5, P6> from(ModelSpecBuilder<M> builder, TypedZPath6<P1, P2, P3, P4, P5, P6> path) + { + return (p1, p2, p3, p4, p5, p6) -> builder.withPath(path.resolved(p1, p2, p3, p4, p5, p6)).build(); + } +} http://git-wip-us.apache.org/repos/asf/curator/blob/ef9df2b7/curator-x-async/src/main/java/org/apache/curator/x/async/modeled/typed/TypedModelSpec7.java ---------------------------------------------------------------------- diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/modeled/typed/TypedModelSpec7.java b/curator-x-async/src/main/java/org/apache/curator/x/async/modeled/typed/TypedModelSpec7.java new file mode 100644 index 0000000..a4e6fdd --- /dev/null +++ b/curator-x-async/src/main/java/org/apache/curator/x/async/modeled/typed/TypedModelSpec7.java @@ -0,0 +1,23 @@ +package org.apache.curator.x.async.modeled.typed; + +import org.apache.curator.x.async.modeled.ModelSpec; +import org.apache.curator.x.async.modeled.ModelSpecBuilder; + +public interface TypedModelSpec7<M, P1, P2, P3, P4, P5, P6, P7> +{ + ModelSpec<M> resolved(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7); + + /** + * Return a new TypedModelSpec using the given model spec builder and typed path. When + * {@link #resolved(Object, Object, Object, Object, Object, Object, Object)} is called the actual model spec is generated with the + * resolved path + * + * @param builder model spec builder + * @param path typed path + * @return new TypedModelSpec + */ + static <M, P1, P2, P3, P4, P5, P6, P7> TypedModelSpec7<M, P1, P2, P3, P4, P5, P6, P7> from(ModelSpecBuilder<M> builder, TypedZPath7<P1, P2, P3, P4, P5, P6, P7> path) + { + return (p1, p2, p3, p4, p5, p6, p7) -> builder.withPath(path.resolved(p1, p2, p3, p4, p5, p6, p7)).build(); + } +} http://git-wip-us.apache.org/repos/asf/curator/blob/ef9df2b7/curator-x-async/src/main/java/org/apache/curator/x/async/modeled/typed/TypedModelSpec8.java ---------------------------------------------------------------------- diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/modeled/typed/TypedModelSpec8.java b/curator-x-async/src/main/java/org/apache/curator/x/async/modeled/typed/TypedModelSpec8.java new file mode 100644 index 0000000..52b2cb4 --- /dev/null +++ b/curator-x-async/src/main/java/org/apache/curator/x/async/modeled/typed/TypedModelSpec8.java @@ -0,0 +1,23 @@ +package org.apache.curator.x.async.modeled.typed; + +import org.apache.curator.x.async.modeled.ModelSpec; +import org.apache.curator.x.async.modeled.ModelSpecBuilder; + +public interface TypedModelSpec8<M, P1, P2, P3, P4, P5, P6, P7, P8> +{ + ModelSpec<M> resolved(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8); + + /** + * Return a new TypedModelSpec using the given model spec builder and typed path. When + * {@link #resolved(Object, Object, Object, Object, Object, Object, Object, Object)} is called the actual model spec is generated with the + * resolved path + * + * @param builder model spec builder + * @param path typed path + * @return new TypedModelSpec + */ + static <M, P1, P2, P3, P4, P5, P6, P7, P8> TypedModelSpec8<M, P1, P2, P3, P4, P5, P6, P7, P8> from(ModelSpecBuilder<M> builder, TypedZPath8<P1, P2, P3, P4, P5, P6, P7, P8> path) + { + return (p1, p2, p3, p4, p5, p6, p7, p8) -> builder.withPath(path.resolved(p1, p2, p3, p4, p5, p6, p7, p8)).build(); + } +} http://git-wip-us.apache.org/repos/asf/curator/blob/ef9df2b7/curator-x-async/src/main/java/org/apache/curator/x/async/modeled/typed/TypedModelSpec9.java ---------------------------------------------------------------------- diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/modeled/typed/TypedModelSpec9.java b/curator-x-async/src/main/java/org/apache/curator/x/async/modeled/typed/TypedModelSpec9.java new file mode 100644 index 0000000..a1ab075 --- /dev/null +++ b/curator-x-async/src/main/java/org/apache/curator/x/async/modeled/typed/TypedModelSpec9.java @@ -0,0 +1,23 @@ +package org.apache.curator.x.async.modeled.typed; + +import org.apache.curator.x.async.modeled.ModelSpec; +import org.apache.curator.x.async.modeled.ModelSpecBuilder; + +public interface TypedModelSpec9<M, P1, P2, P3, P4, P5, P6, P7, P8, P9> +{ + ModelSpec<M> resolved(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9); + + /** + * Return a new TypedModelSpec using the given model spec builder and typed path. When + * {@link #resolved(Object, Object, Object, Object, Object, Object, Object, Object, Object)} is called the actual model spec is generated with the + * resolved path + * + * @param builder model spec builder + * @param path typed path + * @return new TypedModelSpec + */ + static <M, P1, P2, P3, P4, P5, P6, P7, P8, P9> TypedModelSpec9<M, P1, P2, P3, P4, P5, P6, P7, P8, P9> from(ModelSpecBuilder<M> builder, TypedZPath9<P1, P2, P3, P4, P5, P6, P7, P8, P9> path) + { + return (p1, p2, p3, p4, p5, p6, p7, p8, p9) -> builder.withPath(path.resolved(p1, p2, p3, p4, p5, p6, p7, p8, p9)).build(); + } +} http://git-wip-us.apache.org/repos/asf/curator/blob/ef9df2b7/curator-x-async/src/test/java/org/apache/curator/x/async/modeled/TestModeledCuratorFramework.java ---------------------------------------------------------------------- diff --git a/curator-x-async/src/test/java/org/apache/curator/x/async/modeled/TestModeledCuratorFramework.java b/curator-x-async/src/test/java/org/apache/curator/x/async/modeled/TestModeledCuratorFramework.java index 40e30f0..d54ef6f 100644 --- a/curator-x-async/src/test/java/org/apache/curator/x/async/modeled/TestModeledCuratorFramework.java +++ b/curator-x-async/src/test/java/org/apache/curator/x/async/modeled/TestModeledCuratorFramework.java @@ -41,8 +41,8 @@ public class TestModeledCuratorFramework extends CompletableBaseClassForTests private CuratorFramework rawClient; private JacksonModelSerializer<TestModel> serializer; private JacksonModelSerializer<TestNewerModel> newSerializer; - private CuratorModelSpec<TestModel> modelSpec; - private CuratorModelSpec<TestNewerModel> newModelSpec; + private ModelSpec<TestModel> modelSpec; + private ModelSpec<TestNewerModel> newModelSpec; @BeforeMethod @Override @@ -56,8 +56,8 @@ public class TestModeledCuratorFramework extends CompletableBaseClassForTests serializer = new JacksonModelSerializer<>(TestModel.class); newSerializer = new JacksonModelSerializer<>(TestNewerModel.class); - modelSpec = CuratorModelSpec.builder(path, serializer).build(); - newModelSpec = CuratorModelSpec.builder(path, newSerializer).build(); + modelSpec = ModelSpec.builder(path, serializer).build(); + newModelSpec = ModelSpec.builder(path, newSerializer).build(); } @AfterMethod http://git-wip-us.apache.org/repos/asf/curator/blob/ef9df2b7/curator-x-async/src/test/java/org/apache/curator/x/async/modeled/TestZPath.java ---------------------------------------------------------------------- diff --git a/curator-x-async/src/test/java/org/apache/curator/x/async/modeled/TestZPath.java b/curator-x-async/src/test/java/org/apache/curator/x/async/modeled/TestZPath.java index 7d8a463..4df9ed1 100644 --- a/curator-x-async/src/test/java/org/apache/curator/x/async/modeled/TestZPath.java +++ b/curator-x-async/src/test/java/org/apache/curator/x/async/modeled/TestZPath.java @@ -60,27 +60,27 @@ public class TestZPath Assert.assertEquals(ZPath.parse("/"), ZPath.root()); Assert.assertEquals(ZPath.parse("/one/two/three"), ZPath.root().at("one").at("two").at("three")); Assert.assertEquals(ZPath.parse("/one/two/three"), ZPath.from("one", "two", "three")); - Assert.assertEquals(ZPath.parseWithIds("/one/{id}/two/{id}"), ZPath.from("one", parameterNodeName(), "two", parameterNodeName())); + Assert.assertEquals(ZPath.parseWithIds("/one/{id}/two/{id}"), ZPath.from("one", parameterNodeName, "two", parameterNodeName)); } @Test(expectedExceptions = IllegalStateException.class) public void testUnresolvedPath() { - ZPath path = ZPath.from("one", parameterNodeName(), "two"); + ZPath path = ZPath.from("one", parameterNodeName, "two"); path.fullPath(); } @Test public void testResolvedPath() { - ZPath path = ZPath.from("one", parameterNodeName(), "two", parameterNodeName()); + ZPath path = ZPath.from("one", parameterNodeName, "two", parameterNodeName); Assert.assertEquals(path.resolved("a", "b"), ZPath.from("one", "a", "two", "b")); } @Test public void testResolving() { - ZPath path = ZPath.from("one", parameterNodeName(), "two", parameterNodeName()); + ZPath path = ZPath.from("one", parameterNodeName, "two", parameterNodeName); AtomicInteger count = new AtomicInteger(0); ZPath resolving = path.resolving(Arrays.asList(() -> "x" + count.get(), () -> "y" + count.get())); Assert.assertEquals(resolving.fullPath(), "/one/x0/two/y0"); http://git-wip-us.apache.org/repos/asf/curator/blob/ef9df2b7/curator-x-async/src/test/java/org/apache/curator/x/async/modeled/details/TestCachedModeledCuratorFramework.java ---------------------------------------------------------------------- diff --git a/curator-x-async/src/test/java/org/apache/curator/x/async/modeled/details/TestCachedModeledCuratorFramework.java b/curator-x-async/src/test/java/org/apache/curator/x/async/modeled/details/TestCachedModeledCuratorFramework.java index e4f0158..1bc3434 100644 --- a/curator-x-async/src/test/java/org/apache/curator/x/async/modeled/details/TestCachedModeledCuratorFramework.java +++ b/curator-x-async/src/test/java/org/apache/curator/x/async/modeled/details/TestCachedModeledCuratorFramework.java @@ -24,7 +24,7 @@ import org.apache.curator.retry.RetryOneTime; import org.apache.curator.utils.CloseableUtils; import org.apache.curator.x.async.CompletableBaseClassForTests; import org.apache.curator.x.async.modeled.cached.CachedModeledCuratorFramework; -import org.apache.curator.x.async.modeled.CuratorModelSpec; +import org.apache.curator.x.async.modeled.ModelSpec; import org.apache.curator.x.async.modeled.JacksonModelSerializer; import org.apache.curator.x.async.modeled.ModelSerializer; import org.apache.curator.x.async.modeled.ModeledCuratorFramework; @@ -52,7 +52,7 @@ public class TestCachedModeledCuratorFramework extends CompletableBaseClassForTe rawClient.start(); ModelSerializer<TestSimpleModel> serializer = new JacksonModelSerializer<>(TestSimpleModel.class); - client = ModeledCuratorFramework.builder(rawClient, CuratorModelSpec.builder(path, serializer).build()).build().cached(); + client = ModeledCuratorFramework.builder(rawClient, ModelSpec.builder(path, serializer).build()).build().cached(); } @AfterMethod
