curator-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From randg...@apache.org
Subject curator git commit: fixed some merge issues
Date Sun, 11 Oct 2015 21:16:42 GMT
Repository: curator
Updated Branches:
  refs/heads/CURATOR-3.0 9a9e18e24 -> c11111838


fixed some merge issues


Project: http://git-wip-us.apache.org/repos/asf/curator/repo
Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/c1111183
Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/c1111183
Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/c1111183

Branch: refs/heads/CURATOR-3.0
Commit: c11111838b118331f237a562636f37679533aa38
Parents: 9a9e18e
Author: randgalt <randgalt@apache.org>
Authored: Sun Oct 11 16:16:35 2015 -0500
Committer: randgalt <randgalt@apache.org>
Committed: Sun Oct 11 16:16:35 2015 -0500

----------------------------------------------------------------------
 .../nodes/TestPersistentEphemeralNode.java      | 50 ++------------------
 1 file changed, 4 insertions(+), 46 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/c1111183/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 7ee768b..2fb6c66 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
@@ -429,10 +429,10 @@ public class TestPersistentEphemeralNode extends BaseClassForTests
 
             assertTrue(dataChangedTrigger.firedWithin(timing.forWaiting().seconds(), TimeUnit.SECONDS));
 
-            Trigger deletedTrigger = Trigger.deleted();
+            Trigger deletedTrigger = Trigger.deletedOrSetData();
             observer.checkExists().usingWatcher(deletedTrigger).forPath(node.getActualPath());
 
-            killSession(nodeCreator);
+            KillSession.kill(nodeCreator.getZookeeperClient().getZooKeeper());
 
             // Make sure the node got deleted...
             assertTrue(deletedTrigger.firedWithin(timing.forWaiting().seconds(), TimeUnit.SECONDS));
@@ -477,49 +477,11 @@ public class TestPersistentEphemeralNode extends BaseClassForTests
     }
 
     @Test
-    public void testRecreatesNodeWhenItGetsDeletedAfterSetData() throws Exception
-    {
-        CuratorFramework curator = newCurator();
-
-        PersistentEphemeralNode node = new PersistentEphemeralNode(curator, PersistentEphemeralNode.Mode.EPHEMERAL,
PATH, new byte[0]);
-        node.start();
-        try
-        {
-            node.waitForInitialCreate(timing.forWaiting().seconds(), TimeUnit.SECONDS);
-            String originalNode = node.getActualPath();
-            assertNodeExists(curator, originalNode);
-
-            Trigger dataChangedTrigger = Trigger.dataChanged();
-            curator.getData().usingWatcher(dataChangedTrigger).forPath(originalNode);
-
-            // update the data of the node
-            node.setData(new byte[0]);
-
-            // wait for the data to be updated:
-            assertTrue(dataChangedTrigger.firedWithin(timing.forWaiting().seconds(), TimeUnit.SECONDS));
-
-            // Delete the original node...
-            curator.delete().forPath(originalNode);
-
-            // Since we're using an ephemeral node, and the original session hasn't been
interrupted the name of the new
-            // node that gets created is going to be exactly the same as the original.
-            Trigger createdWatchTrigger = Trigger.created();
-            Stat stat = curator.checkExists().usingWatcher(createdWatchTrigger).forPath(originalNode);
-            assertTrue(stat != null || createdWatchTrigger.firedWithin(timing.forWaiting().seconds(),
TimeUnit.SECONDS));
-        }
-        finally
-        {
-            node.close();
-        }
-    }
-
-    @Test
     public void testNodesCreateUniquePaths() throws Exception
     {
         CuratorFramework curator = newCurator();
 
-        PersistentEphemeralNode node1 = new PersistentEphemeralNode(curator, PersistentEphemeralNode.Mode.EPHEMERAL_SEQUENTIAL,
PATH, new byte[0]);
-        try
+        try ( PersistentEphemeralNode node1 = new PersistentEphemeralNode(curator, PersistentEphemeralNode.Mode.EPHEMERAL_SEQUENTIAL,
PATH, new byte[0]) )
         {
             node1.start();
             node1.waitForInitialCreate(timing.forWaiting().seconds(), TimeUnit.SECONDS);
@@ -539,10 +501,6 @@ public class TestPersistentEphemeralNode extends BaseClassForTests
                 node2.close();
             }
         }
-        finally
-        {
-            node1.close();
-        }
     }
 
     @Test
@@ -589,7 +547,7 @@ public class TestPersistentEphemeralNode extends BaseClassForTests
             CloseableUtils.closeQuietly(node);
         }
     }
-    
+
     @Test
     public void testSetDataWhenDisconnected() throws Exception
     {


Mime
View raw message