[
https://issues.apache.org/jira/browse/CURATOR-93?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14035828#comment-14035828
]
ASF GitHub Bot commented on CURATOR-93:
---------------------------------------
Github user madrob commented on a diff in the pull request:
https://github.com/apache/curator/pull/12#discussion_r13921732
--- Diff:
curator-framework/src/test/java/org/apache/curator/framework/imps/TestCompressionInTransaction.java
---
@@ -0,0 +1,61 @@
+/**
+ * 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.imps;
+
+import org.apache.curator.test.BaseClassForTests;
+import org.apache.curator.utils.CloseableUtils;
+import org.apache.curator.framework.CuratorFramework;
+import org.apache.curator.framework.CuratorFrameworkFactory;
+import org.apache.curator.framework.api.CompressionProvider;
+import org.apache.curator.retry.RetryOneTime;
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import java.util.concurrent.atomic.AtomicInteger;
+
+public class TestCompressionInTransaction extends BaseClassForTests
+{
+ @Test
+ public void testSimple() throws Exception
+ {
+ final String path1 = "/a";
+ final String path2 = "/a/b";
+
+ final byte[] data1 = "here's a string".getBytes();
+ final byte[] data2 = "here's another string".getBytes();
+
+ CuratorFramework client =
CuratorFrameworkFactory.newClient(server.getConnectString(), new
RetryOneTime(1));
+ try
+ {
+ client.start();
+
+ client.inTransaction().create().compressed().forPath(path1,
data1).and().
+ create().compressed().forPath(path2, data2).and().commit();
+
+ Assert.assertNotEquals(data1, client.getData().forPath(path1));
+ Assert.assertEquals(data1.length,
client.getData().decompressed().forPath(path1).length);
--- End diff --
Why is this only asserting equal lengths instead of a strong assertion for
equal content (after decompression?)
> Have TransactionCreateBuilder implement Compressible
> ----------------------------------------------------
>
> Key: CURATOR-93
> URL: https://issues.apache.org/jira/browse/CURATOR-93
> Project: Apache Curator
> Issue Type: Improvement
> Reporter: Benjamin Jaton
> Assignee: Jordan Zimmerman
> Priority: Minor
> Labels: compression, curator, transaction
>
> It would be nice to support compression for operations done in a transaction.
--
This message was sent by Atlassian JIRA
(v6.2#6252)