You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@curator.apache.org by ra...@apache.org on 2017/07/14 19:11:09 UTC
curator git commit: removed some dead code
Repository: curator
Updated Branches:
refs/heads/CURATOR-421 c40a38361 -> 72ff5a9fa
removed some dead code
Project: http://git-wip-us.apache.org/repos/asf/curator/repo
Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/72ff5a9f
Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/72ff5a9f
Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/72ff5a9f
Branch: refs/heads/CURATOR-421
Commit: 72ff5a9fa4c8b0db85dd4e017009143147ac9446
Parents: c40a383
Author: randgalt <ra...@apache.org>
Authored: Fri Jul 14 14:11:04 2017 -0500
Committer: randgalt <ra...@apache.org>
Committed: Fri Jul 14 14:11:04 2017 -0500
----------------------------------------------------------------------
.../async/migrations/TestMigrationManager.java | 37 ++------------------
1 file changed, 3 insertions(+), 34 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/curator/blob/72ff5a9f/curator-x-async/src/test/java/org/apache/curator/x/async/migrations/TestMigrationManager.java
----------------------------------------------------------------------
diff --git a/curator-x-async/src/test/java/org/apache/curator/x/async/migrations/TestMigrationManager.java b/curator-x-async/src/test/java/org/apache/curator/x/async/migrations/TestMigrationManager.java
index 637aca1..19740d6 100644
--- a/curator-x-async/src/test/java/org/apache/curator/x/async/migrations/TestMigrationManager.java
+++ b/curator-x-async/src/test/java/org/apache/curator/x/async/migrations/TestMigrationManager.java
@@ -18,7 +18,6 @@
*/
package org.apache.curator.x.async.migrations;
-import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.CuratorFrameworkFactory;
import org.apache.curator.framework.api.transaction.CuratorOp;
@@ -26,24 +25,22 @@ import org.apache.curator.retry.RetryOneTime;
import org.apache.curator.utils.CloseableUtils;
import org.apache.curator.x.async.AsyncCuratorFramework;
import org.apache.curator.x.async.CompletableBaseClassForTests;
+import org.apache.curator.x.async.migrations.models.ModelV1;
+import org.apache.curator.x.async.migrations.models.ModelV2;
+import org.apache.curator.x.async.migrations.models.ModelV3;
import org.apache.curator.x.async.modeled.JacksonModelSerializer;
import org.apache.curator.x.async.modeled.ModelSpec;
import org.apache.curator.x.async.modeled.ModeledFramework;
import org.apache.curator.x.async.modeled.ZPath;
-import org.apache.curator.x.async.migrations.models.ModelV1;
-import org.apache.curator.x.async.migrations.models.ModelV2;
-import org.apache.curator.x.async.migrations.models.ModelV3;
import org.testng.Assert;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
-import java.io.IOException;
import java.time.Duration;
import java.util.Arrays;
import java.util.Collections;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
-import java.util.function.UnaryOperator;
public class TestMigrationManager extends CompletableBaseClassForTests
{
@@ -69,34 +66,6 @@ public class TestMigrationManager extends CompletableBaseClassForTests
this.client = AsyncCuratorFramework.wrap(rawClient);
- ObjectMapper mapper = new ObjectMapper();
- UnaryOperator<byte[]> from1to2 = bytes -> {
- try
- {
- ModelV1 v1 = mapper.readerFor(ModelV1.class).readValue(bytes);
- ModelV2 v2 = new ModelV2(v1.getName(), 64);
- return mapper.writeValueAsBytes(v2);
- }
- catch ( IOException e )
- {
- throw new RuntimeException(e);
- }
- };
-
- UnaryOperator<byte[]> from2to3 = bytes -> {
- try
- {
- ModelV2 v2 = mapper.readerFor(ModelV2.class).readValue(bytes);
- String[] nameParts = v2.getName().split("\\s");
- ModelV3 v3 = new ModelV3(nameParts[0], nameParts[1], v2.getAge());
- return mapper.writeValueAsBytes(v3);
- }
- catch ( IOException e )
- {
- throw new RuntimeException(e);
- }
- };
-
ZPath modelPath = ZPath.parse("/test/it");
v1Spec = ModelSpec.builder(modelPath, JacksonModelSerializer.build(ModelV1.class)).build();