Github user cammckenzie commented on a diff in the pull request:
https://github.com/apache/curator/pull/48#discussion_r19764502
--- Diff:
curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestInterProcessReadWriteLock.java
---
@@ -261,6 +261,39 @@ public Void call() throws Exception
Assert.assertTrue(maxConcurrentCount.get() > 1);
}
+ @Test
+ public void testSetNodeData() throws Exception
+ {
+ CuratorFramework client =
CuratorFrameworkFactory.newClient(server.getConnectString(), new
RetryOneTime(1));
+
+ try
+ {
+ client.start();
+
+ final byte[] nodeData = new byte[] { 1, 2, 3, 4 };
+
+ InterProcessReadWriteLock lock = new
InterProcessReadWriteLock(client, "/lock", nodeData);
+
+ // mutate passed-in node data, lock has made copy
+ nodeData[0] = 5;
--- End diff --
Ok, just wasn't obvious because there's no explicit assert checking that
the data in the InterProcessReadWriteLock is different to the mutated nodeData
array. I notice that there's no way of getting this data out of the
InterProcessReadWriteLock to do an explicit assert though, so I think that this
is fine.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---