Repository: curator Updated Branches: refs/heads/master 0c2a5a5b4 -> 63444f6a2
Fix broken tests. Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/63444f6a Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/63444f6a Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/63444f6a Branch: refs/heads/master Commit: 63444f6a2273bd910b33ecb10d1106cb2225e4fb Parents: 0c2a5a5 Author: Scott Blum <[email protected]> Authored: Thu Oct 2 18:00:48 2014 -0400 Committer: Scott Blum <[email protected]> Committed: Thu Oct 2 18:00:48 2014 -0400 ---------------------------------------------------------------------- .../recipes/cache/PathChildrenCache.java | 2 +- .../framework/recipes/queue/DistributedQueue.java | 2 +- .../framework/recipes/shared/VersionedValue.java | 18 ++++++++++++++++++ .../nodes/TestPersistentEphemeralNode.java | 2 +- 4 files changed, 21 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/curator/blob/63444f6a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/PathChildrenCache.java ---------------------------------------------------------------------- diff --git a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/PathChildrenCache.java b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/PathChildrenCache.java index 2d2f586..f499562 100644 --- a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/PathChildrenCache.java +++ b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/PathChildrenCache.java @@ -88,7 +88,7 @@ public class PathChildrenCache implements Closeable CLOSED } - private static final ChildData NULL_CHILD_DATA = new ChildData(null, null, null); + private static final ChildData NULL_CHILD_DATA = new ChildData("/", null, null); private static final boolean USE_EXISTS = Boolean.getBoolean("curator-path-children-cache-use-exists"); http://git-wip-us.apache.org/repos/asf/curator/blob/63444f6a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/queue/DistributedQueue.java ---------------------------------------------------------------------- diff --git a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/queue/DistributedQueue.java b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/queue/DistributedQueue.java index 7b4e877..9dd2217 100644 --- a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/queue/DistributedQueue.java +++ b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/queue/DistributedQueue.java @@ -128,7 +128,7 @@ public class DistributedQueue<T> implements QueueBase<T> Preconditions.checkArgument(maxItems > 0, "maxItems must be a positive number"); isProducerOnly = (consumer == null); - this.lockPath = PathUtils.validatePath(lockPath); + this.lockPath = (lockPath == null) ? null : PathUtils.validatePath(lockPath); this.putInBackground = putInBackground; this.consumer = consumer; this.minItemsBeforeRefresh = minItemsBeforeRefresh; http://git-wip-us.apache.org/repos/asf/curator/blob/63444f6a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/shared/VersionedValue.java ---------------------------------------------------------------------- diff --git a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/shared/VersionedValue.java b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/shared/VersionedValue.java index ef4c9cc..beb38a5 100644 --- a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/shared/VersionedValue.java +++ b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/shared/VersionedValue.java @@ -1,3 +1,21 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ package org.apache.curator.framework.recipes.shared; import com.google.common.base.Preconditions; http://git-wip-us.apache.org/repos/asf/curator/blob/63444f6a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/nodes/TestPersistentEphemeralNode.java ---------------------------------------------------------------------- diff --git a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/nodes/TestPersistentEphemeralNode.java b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/nodes/TestPersistentEphemeralNode.java index a07ee14..c8a72d4 100644 --- a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/nodes/TestPersistentEphemeralNode.java +++ b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/nodes/TestPersistentEphemeralNode.java @@ -167,7 +167,7 @@ public class TestPersistentEphemeralNode extends BaseClassForTests new PersistentEphemeralNode(null, PersistentEphemeralNode.Mode.EPHEMERAL, PATH, new byte[0]); } - @Test(expectedExceptions = NullPointerException.class) + @Test(expectedExceptions = IllegalArgumentException.class) public void testNullPath() throws Exception { CuratorFramework curator = newCurator();
