ACCUMULO-3574 Fix IT after the merge
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/7ae2e5af Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/7ae2e5af Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/7ae2e5af Branch: refs/heads/master Commit: 7ae2e5afd44de1fbf38bb427cab2894af6c9b6be Parents: 3d3bfe6 Author: Josh Elser <els...@apache.org> Authored: Thu Feb 12 19:37:14 2015 -0500 Committer: Josh Elser <els...@apache.org> Committed: Thu Feb 12 19:37:14 2015 -0500 ---------------------------------------------------------------------- .../apache/accumulo/test/TransportCachingIT.java | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ae2e5af/test/src/test/java/org/apache/accumulo/test/TransportCachingIT.java ---------------------------------------------------------------------- diff --git a/test/src/test/java/org/apache/accumulo/test/TransportCachingIT.java b/test/src/test/java/org/apache/accumulo/test/TransportCachingIT.java index ddbd3e8..e760295 100644 --- a/test/src/test/java/org/apache/accumulo/test/TransportCachingIT.java +++ b/test/src/test/java/org/apache/accumulo/test/TransportCachingIT.java @@ -24,16 +24,17 @@ import static org.junit.Assert.assertTrue; import java.util.ArrayList; import org.apache.accumulo.core.Constants; +import org.apache.accumulo.core.client.ClientConfiguration; import org.apache.accumulo.core.client.Connector; import org.apache.accumulo.core.client.Instance; -import org.apache.accumulo.core.client.impl.ServerConfigurationUtil; +import org.apache.accumulo.core.client.impl.ClientContext; import org.apache.accumulo.core.client.impl.ThriftTransportKey; import org.apache.accumulo.core.client.impl.ThriftTransportPool; import org.apache.accumulo.core.conf.DefaultConfiguration; import org.apache.accumulo.core.conf.Property; +import org.apache.accumulo.core.security.Credentials; import org.apache.accumulo.core.util.ServerServices; import org.apache.accumulo.core.util.ServerServices.Service; -import org.apache.accumulo.core.util.SslConnectionParams; import org.apache.accumulo.core.zookeeper.ZooUtil; import org.apache.accumulo.fate.zookeeper.ZooCache; import org.apache.accumulo.fate.zookeeper.ZooCacheFactory; @@ -54,6 +55,9 @@ public class TransportCachingIT extends AccumuloClusterIT { public void testCachedTransport() { Connector conn = getConnector(); Instance instance = conn.getInstance(); + ClientConfiguration clientConf = ClientConfiguration.loadDefault(); + clientConf.withInstance(instance.getInstanceName()).withZkHosts(instance.getZooKeepers()); + ClientContext context = new ClientContext(instance, new Credentials(getPrincipal(), getToken()), clientConf); long rpcTimeout = DefaultConfiguration.getTimeInMillis(Property.GENERAL_RPC_TIMEOUT.getDefaultValue()); // create list of servers @@ -64,9 +68,11 @@ public class TransportCachingIT extends AccumuloClusterIT { for (String tserver : zc.getChildren(ZooUtil.getRoot(instance) + Constants.ZTSERVERS)) { String path = ZooUtil.getRoot(instance) + Constants.ZTSERVERS + "/" + tserver; byte[] data = ZooUtil.getLockData(zc, path); - if (data != null && !new String(data, UTF_8).equals("master")) - servers.add(new ThriftTransportKey(new ServerServices(new String(data)).getAddressString(Service.TSERV_CLIENT), rpcTimeout, SslConnectionParams - .forClient(ServerConfigurationUtil.getConfiguration(instance)))); + if (data != null) { + String strData = new String(data, UTF_8); + if (!strData.equals("master")) + servers.add(new ThriftTransportKey(new ServerServices(strData).getAddress(Service.TSERV_CLIENT), rpcTimeout, context)); + } } ThriftTransportPool pool = ThriftTransportPool.getInstance();