accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject [1/2] git commit: ACCUMULO-2522 wait for accumulo to be up before testing the proxy
Date Fri, 21 Mar 2014 18:55:27 GMT
Repository: accumulo
Updated Branches:
  refs/heads/1.5.2-SNAPSHOT bcb0905c4 -> 32cca6049


ACCUMULO-2522 wait for accumulo to be up before testing the proxy


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/31b01e92
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/31b01e92
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/31b01e92

Branch: refs/heads/1.5.2-SNAPSHOT
Commit: 31b01e9228075113f0f81c73678efc2ad7fdd4a1
Parents: 1d608a8
Author: Eric C. Newton <eric.newton@gmail.com>
Authored: Fri Mar 21 14:08:05 2014 -0400
Committer: Eric C. Newton <eric.newton@gmail.com>
Committed: Fri Mar 21 14:08:25 2014 -0400

----------------------------------------------------------------------
 .../test/java/org/apache/accumulo/proxy/SimpleTest.java | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/31b01e92/proxy/src/test/java/org/apache/accumulo/proxy/SimpleTest.java
----------------------------------------------------------------------
diff --git a/proxy/src/test/java/org/apache/accumulo/proxy/SimpleTest.java b/proxy/src/test/java/org/apache/accumulo/proxy/SimpleTest.java
index 6e5398c..4a461a0 100644
--- a/proxy/src/test/java/org/apache/accumulo/proxy/SimpleTest.java
+++ b/proxy/src/test/java/org/apache/accumulo/proxy/SimpleTest.java
@@ -34,6 +34,7 @@ import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
+import java.util.Map.Entry;
 import java.util.Properties;
 import java.util.Random;
 import java.util.Set;
@@ -41,6 +42,8 @@ import java.util.TreeMap;
 import java.util.UUID;
 
 import org.apache.accumulo.core.Constants;
+import org.apache.accumulo.core.client.Connector;
+import org.apache.accumulo.core.client.ZooKeeperInstance;
 import org.apache.accumulo.core.client.security.tokens.PasswordToken;
 import org.apache.accumulo.core.conf.DefaultConfiguration;
 import org.apache.accumulo.core.conf.Property;
@@ -90,7 +93,6 @@ import org.apache.hadoop.fs.FSDataInputStream;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.io.Text;
-import org.apache.log4j.Logger;
 import org.apache.thrift.TException;
 import org.apache.thrift.protocol.TProtocolFactory;
 import org.apache.thrift.server.TServer;
@@ -103,7 +105,6 @@ import org.junit.rules.TemporaryFolder;
  * Call every method on the proxy and try to verify that it works.
  */
 public class SimpleTest {
-  private static final Logger log = Logger.getLogger(SimpleTest.class);
 
   public static TemporaryFolder folder = new TemporaryFolder();
   
@@ -144,6 +145,11 @@ public class SimpleTest {
             .setNumTservers (1);
     accumulo = new MiniAccumuloCluster(config);
     accumulo.start();
+    // wait for accumulo to be up and functional
+    ZooKeeperInstance zoo = new ZooKeeperInstance(accumulo.getInstanceName(), accumulo.getZooKeepers());
+    Connector c = zoo.getConnector("root", new PasswordToken(secret.getBytes()));
+    for (@SuppressWarnings("unused") Entry<org.apache.accumulo.core.data.Key,Value>
entry : c.createScanner(Constants.METADATA_TABLE_NAME, Constants.NO_AUTHS))
+        ;
     
     Properties props = new Properties();
     props.put("instance", accumulo.getInstanceName());
@@ -589,7 +595,7 @@ public class SimpleTest {
     } catch (TableNotFoundException ex) {}
   }
   
-  @Test(timeout = 10000)
+  @Test(timeout = 10 * 000)
   public void testExists() throws Exception {
     client.createTable(creds, "ett1", false, TimeType.MILLIS);
     client.createTable(creds, "ett2", false, TimeType.MILLIS);


Mime
View raw message