accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vi...@apache.org
Subject svn commit: r1437605 [12/12] - in /accumulo/branches/ACCUMULO-259: core/src/main/java/org/apache/accumulo/core/cli/ core/src/main/java/org/apache/accumulo/core/client/ core/src/main/java/org/apache/accumulo/core/client/admin/ core/src/main/java/org/apa...
Date Wed, 23 Jan 2013 18:05:13 GMT
Modified: accumulo/branches/ACCUMULO-259/server/src/test/java/org/apache/accumulo/server/master/TestMergeState.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/server/src/test/java/org/apache/accumulo/server/master/TestMergeState.java?rev=1437605&r1=1437604&r2=1437605&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/server/src/test/java/org/apache/accumulo/server/master/TestMergeState.java
(original)
+++ accumulo/branches/ACCUMULO-259/server/src/test/java/org/apache/accumulo/server/master/TestMergeState.java
Wed Jan 23 18:05:10 2013
@@ -17,7 +17,6 @@
 package org.apache.accumulo.server.master;
 
 import java.net.InetSocketAddress;
-import java.nio.ByteBuffer;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.Set;
@@ -35,7 +34,8 @@ import org.apache.accumulo.core.data.Key
 import org.apache.accumulo.core.data.Mutation;
 import org.apache.accumulo.core.data.Range;
 import org.apache.accumulo.core.data.Value;
-import org.apache.accumulo.core.security.thrift.AuthInfo;
+import org.apache.accumulo.core.security.tokens.InstanceTokenWrapper;
+import org.apache.accumulo.core.security.tokens.UserPassToken;
 import org.apache.accumulo.server.master.state.Assignment;
 import org.apache.accumulo.server.master.state.CurrentState;
 import org.apache.accumulo.server.master.state.MergeInfo;
@@ -88,7 +88,7 @@ public class TestMergeState {
   @Test
   public void test() throws Exception {
     Instance instance = new MockInstance();
-    Connector connector = instance.getConnector("root", "");
+    Connector connector = instance.getConnector(new UserPassToken("root",""));
     BatchWriter bw = connector.createBatchWriter("!METADATA", new BatchWriterConfig());
     
     // Create a fake METADATA table with these splits
@@ -112,7 +112,7 @@ public class TestMergeState {
     
     // Read out the TabletLocationStates
     MockCurrentState state = new MockCurrentState(new MergeInfo(new KeyExtent(tableId, new
Text("p"), new Text("e")), MergeInfo.Operation.MERGE));
-    AuthInfo auths = new AuthInfo("root", ByteBuffer.wrap("".getBytes()), "instance");
+    InstanceTokenWrapper auths = new InstanceTokenWrapper(new UserPassToken("root", ""),
"instance");
     
     // Verify the tablet state: hosted, and count
     MetaDataStateStore metaDataStateStore = new MetaDataStateStore(instance, auths, state);

Modified: accumulo/branches/ACCUMULO-259/test/src/test/java/org/apache/accumulo/test/MiniAccumuloClusterTest.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/test/src/test/java/org/apache/accumulo/test/MiniAccumuloClusterTest.java?rev=1437605&r1=1437604&r2=1437605&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/test/src/test/java/org/apache/accumulo/test/MiniAccumuloClusterTest.java
(original)
+++ accumulo/branches/ACCUMULO-259/test/src/test/java/org/apache/accumulo/test/MiniAccumuloClusterTest.java
Wed Jan 23 18:05:10 2013
@@ -36,6 +36,7 @@ import org.apache.accumulo.core.iterator
 import org.apache.accumulo.core.security.Authorizations;
 import org.apache.accumulo.core.security.ColumnVisibility;
 import org.apache.accumulo.core.security.TablePermission;
+import org.apache.accumulo.core.security.tokens.UserPassToken;
 import org.apache.commons.io.FileUtils;
 import org.apache.log4j.Level;
 import org.apache.log4j.Logger;
@@ -67,11 +68,12 @@ public class MiniAccumuloClusterTest {
 
   @Test(timeout = 30000)
   public void test() throws Exception {
-    Connector conn = new ZooKeeperInstance(accumulo.getInstanceName(), accumulo.getZookeepers()).getConnector("root",
"superSecret");
+    Connector conn = new ZooKeeperInstance(accumulo.getInstanceName(), accumulo.getZookeepers()).getConnector(new
UserPassToken("root", "superSecret"));
     
     conn.tableOperations().create("table1");
     
-    conn.securityOperations().createUser("user1", "pass1".getBytes());
+    UserPassToken upt = new UserPassToken("user1", "pass1");
+    conn.securityOperations().createUser(upt);
     conn.securityOperations().changeUserAuthorizations("user1", new Authorizations("A", "B"));
     conn.securityOperations().grantTablePermission("user1", "table1", TablePermission.WRITE);
     conn.securityOperations().grantTablePermission("user1", "table1", TablePermission.READ);
@@ -82,7 +84,7 @@ public class MiniAccumuloClusterTest {
     
     conn.tableOperations().attachIterator("table1", is);
 
-    Connector uconn = new ZooKeeperInstance(accumulo.getInstanceName(), accumulo.getZookeepers()).getConnector("user1",
"pass1");
+    Connector uconn = new ZooKeeperInstance(accumulo.getInstanceName(), accumulo.getZookeepers()).getConnector(upt);
     
     BatchWriter bw = uconn.createBatchWriter("table1", new BatchWriterConfig());
     
@@ -138,7 +140,7 @@ public class MiniAccumuloClusterTest {
   @Test(timeout = 30000)
   public void testPerTableClasspath() throws Exception {
     
-    Connector conn = new ZooKeeperInstance(accumulo.getInstanceName(), accumulo.getZookeepers()).getConnector("root",
"superSecret");
+    Connector conn = new ZooKeeperInstance(accumulo.getInstanceName(), accumulo.getZookeepers()).getConnector(new
UserPassToken("root", "superSecret"));
     
     conn.tableOperations().create("table2");
     
@@ -184,7 +186,7 @@ public class MiniAccumuloClusterTest {
   @AfterClass
   public static void tearDownMiniCluster() throws Exception {
     accumulo.stop();
-    folder.delete();
+//    folder.delete();
   }
   
 }



Mime
View raw message