You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@curator.apache.org by ca...@apache.org on 2014/08/05 05:44:30 UTC
[4/4] git commit: CURATOR-67 - Removed the
TestServiceDiscoveryBuilder test from the discovery package as it does not
build there (permission issues),
and is already present in the discovery/details package. Removed unnecessary
imports from the discovery
CURATOR-67 - Removed the TestServiceDiscoveryBuilder test from the
discovery package as it does not build there (permission issues), and is
already present in the discovery/details package. Removed unnecessary
imports from the discovery/details version.
Project: http://git-wip-us.apache.org/repos/asf/curator/repo
Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/adb93c0e
Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/adb93c0e
Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/adb93c0e
Branch: refs/heads/master
Commit: adb93c0efa39b1f3139d8fc3fef725307aefe132
Parents: 756fd5f
Author: Cam McKenzie <ca...@apache.org>
Authored: Tue Aug 5 11:22:58 2014 +1000
Committer: Cam McKenzie <ca...@apache.org>
Committed: Tue Aug 5 11:22:58 2014 +1000
----------------------------------------------------------------------
.../discovery/TestServiceDiscoveryBuilder.java | 71 --------------------
.../details/TestServiceDiscoveryBuilder.java | 1 -
2 files changed, 72 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/curator/blob/adb93c0e/curator-x-discovery/src/test/java/org/apache/curator/x/discovery/TestServiceDiscoveryBuilder.java
----------------------------------------------------------------------
diff --git a/curator-x-discovery/src/test/java/org/apache/curator/x/discovery/TestServiceDiscoveryBuilder.java b/curator-x-discovery/src/test/java/org/apache/curator/x/discovery/TestServiceDiscoveryBuilder.java
deleted file mode 100644
index 68716ed..0000000
--- a/curator-x-discovery/src/test/java/org/apache/curator/x/discovery/TestServiceDiscoveryBuilder.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/**
- * 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.x.discovery;
-
-import org.apache.curator.framework.CuratorFramework;
-import org.apache.curator.framework.CuratorFrameworkFactory;
-import org.apache.curator.retry.RetryOneTime;
-import org.apache.curator.test.BaseClassForTests;
-import org.apache.curator.x.discovery.ServiceDiscoveryBuilder;
-import org.apache.curator.x.discovery.ServiceInstance;
-import org.apache.curator.x.discovery.details.InstanceSerializer;
-import org.apache.curator.x.discovery.details.JsonInstanceSerializer;
-import org.apache.curator.x.discovery.details.ServiceDiscoveryImpl;
-import org.testng.Assert;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-public class TestServiceDiscoveryBuilder extends BaseClassForTests
-{
- @Test
- public void testDefaultSerializer() throws Exception
- {
- CuratorFramework client = CuratorFrameworkFactory.newClient(server.getConnectString(), new RetryOneTime(1));
- ServiceDiscoveryBuilder<Object> builder = ServiceDiscoveryBuilder.builder(Object.class).client(client);
- ServiceDiscoveryImpl<?> discovery = (ServiceDiscoveryImpl<?>) builder.basePath("/path").build();
-
- Assert.assertNotNull(discovery.getSerializer(), "default serializer not set");
- Assert.assertTrue(discovery.getSerializer() instanceof JsonInstanceSerializer, "default serializer not JSON");
- }
-
- @Test
- public void testSetSerializer() throws Exception
- {
- CuratorFramework client = CuratorFrameworkFactory.newClient(server.getConnectString(), new RetryOneTime(1));
- ServiceDiscoveryBuilder<Object> builder = ServiceDiscoveryBuilder.builder(Object.class).client(client);
- builder.serializer(new InstanceSerializer<Object>()
- {
- @Override
- public byte[] serialize(ServiceInstance<Object> instance)
- {
- return null;
- }
-
- @Override
- public ServiceInstance<Object> deserialize(byte[] bytes)
- {
- return null;
- }
- });
-
- ServiceDiscoveryImpl<?> discovery = (ServiceDiscoveryImpl<?>) builder.basePath("/path").build();
- Assert.assertNotNull(discovery.getSerializer(), "default serializer not set");
- Assert.assertFalse(discovery.getSerializer() instanceof JsonInstanceSerializer, "set serializer is JSON");
- }
-}
http://git-wip-us.apache.org/repos/asf/curator/blob/adb93c0e/curator-x-discovery/src/test/java/org/apache/curator/x/discovery/details/TestServiceDiscoveryBuilder.java
----------------------------------------------------------------------
diff --git a/curator-x-discovery/src/test/java/org/apache/curator/x/discovery/details/TestServiceDiscoveryBuilder.java b/curator-x-discovery/src/test/java/org/apache/curator/x/discovery/details/TestServiceDiscoveryBuilder.java
index 072eabf..312c884 100644
--- a/curator-x-discovery/src/test/java/org/apache/curator/x/discovery/details/TestServiceDiscoveryBuilder.java
+++ b/curator-x-discovery/src/test/java/org/apache/curator/x/discovery/details/TestServiceDiscoveryBuilder.java
@@ -25,7 +25,6 @@ import org.apache.curator.test.BaseClassForTests;
import org.apache.curator.x.discovery.ServiceDiscoveryBuilder;
import org.apache.curator.x.discovery.ServiceInstance;
import org.testng.Assert;
-import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
public class TestServiceDiscoveryBuilder extends BaseClassForTests