accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vi...@apache.org
Subject svn commit: r1439632 [3/3] - in /accumulo/trunk: 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/apache/accumulo/core/...
Date Mon, 28 Jan 2013 21:03:45 GMT
Modified: accumulo/trunk/server/src/test/java/org/apache/accumulo/server/util/CloneTest.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/test/java/org/apache/accumulo/server/util/CloneTest.java?rev=1439632&r1=1439631&r2=1439632&view=diff
==============================================================================
--- accumulo/trunk/server/src/test/java/org/apache/accumulo/server/util/CloneTest.java (original)
+++ accumulo/trunk/server/src/test/java/org/apache/accumulo/server/util/CloneTest.java Mon
Jan 28 21:03:43 2013
@@ -31,13 +31,14 @@ import org.apache.accumulo.core.data.Key
 import org.apache.accumulo.core.data.KeyExtent;
 import org.apache.accumulo.core.data.Mutation;
 import org.apache.accumulo.core.data.Value;
+import org.apache.accumulo.core.security.tokens.UserPassToken;
 import org.apache.hadoop.io.Text;
 
 public class CloneTest extends TestCase {
   
   public void testNoFiles() throws Exception {
     MockInstance mi = new MockInstance();
-    Connector conn = mi.getConnector("", "");
+    Connector conn = mi.getConnector(new UserPassToken("", ""));
     
     KeyExtent ke = new KeyExtent(new Text("0"), null, null);
     Mutation mut = ke.getPrevRowUpdateMutation();
@@ -65,7 +66,7 @@ public class CloneTest extends TestCase 
   
   public void testFilesChange() throws Exception {
     MockInstance mi = new MockInstance();
-    Connector conn = mi.getConnector("", "");
+    Connector conn = mi.getConnector(new UserPassToken("", ""));
     
     KeyExtent ke = new KeyExtent(new Text("0"), null, null);
     Mutation mut = ke.getPrevRowUpdateMutation();
@@ -117,7 +118,7 @@ public class CloneTest extends TestCase 
   // test split where files of children are the same
   public void testSplit1() throws Exception {
     MockInstance mi = new MockInstance();
-    Connector conn = mi.getConnector("", "");
+    Connector conn = mi.getConnector(new UserPassToken("", ""));
     
     BatchWriter bw1 = conn.createBatchWriter(Constants.METADATA_TABLE_NAME, new BatchWriterConfig());
     
@@ -159,7 +160,7 @@ public class CloneTest extends TestCase 
   // test split where files of children differ... like majc and split occurred
   public void testSplit2() throws Exception {
     MockInstance mi = new MockInstance();
-    Connector conn = mi.getConnector("", "");
+    Connector conn = mi.getConnector(new UserPassToken("", ""));
     
     BatchWriter bw1 = conn.createBatchWriter(Constants.METADATA_TABLE_NAME, new BatchWriterConfig());
     
@@ -230,7 +231,7 @@ public class CloneTest extends TestCase 
   // test two tablets splitting into four
   public void testSplit3() throws Exception {
     MockInstance mi = new MockInstance();
-    Connector conn = mi.getConnector("", "");
+    Connector conn = mi.getConnector(new UserPassToken("", ""));
     
     BatchWriter bw1 = conn.createBatchWriter(Constants.METADATA_TABLE_NAME, new BatchWriterConfig());
     
@@ -277,7 +278,7 @@ public class CloneTest extends TestCase 
   public void testClonedMarker() throws Exception {
     
     MockInstance mi = new MockInstance();
-    Connector conn = mi.getConnector("", "");
+    Connector conn = mi.getConnector(new UserPassToken("", ""));
     
     BatchWriter bw1 = conn.createBatchWriter(Constants.METADATA_TABLE_NAME, new BatchWriterConfig());
     
@@ -341,7 +342,7 @@ public class CloneTest extends TestCase 
   // test two tablets splitting into four
   public void testMerge() throws Exception {
     MockInstance mi = new MockInstance();
-    Connector conn = mi.getConnector("", "");
+    Connector conn = mi.getConnector(new UserPassToken("", ""));
     
     BatchWriter bw1 = conn.createBatchWriter(Constants.METADATA_TABLE_NAME, new BatchWriterConfig());
     

Modified: accumulo/trunk/server/src/test/java/org/apache/accumulo/server/util/TabletIteratorTest.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/test/java/org/apache/accumulo/server/util/TabletIteratorTest.java?rev=1439632&r1=1439631&r2=1439632&view=diff
==============================================================================
--- accumulo/trunk/server/src/test/java/org/apache/accumulo/server/util/TabletIteratorTest.java
(original)
+++ accumulo/trunk/server/src/test/java/org/apache/accumulo/server/util/TabletIteratorTest.java
Mon Jan 28 21:03:43 2013
@@ -31,6 +31,7 @@ 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.tokens.UserPassToken;
 import org.apache.accumulo.server.util.TabletIterator.TabletDeletedException;
 import org.apache.hadoop.io.Text;
 
@@ -75,7 +76,7 @@ public class TabletIteratorTest extends 
   // simulate a merge happening while iterating over tablets
   public void testMerge() throws Exception {
     MockInstance mi = new MockInstance();
-    Connector conn = mi.getConnector("", "");
+    Connector conn = mi.getConnector(new UserPassToken("", ""));
     
     KeyExtent ke1 = new KeyExtent(new Text("0"), new Text("m"), null);
     Mutation mut1 = ke1.getPrevRowUpdateMutation();

Modified: accumulo/trunk/test/src/main/java/org/apache/accumulo/test/continuous/ContinuousMoru.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/test/src/main/java/org/apache/accumulo/test/continuous/ContinuousMoru.java?rev=1439632&r1=1439631&r2=1439632&view=diff
==============================================================================
--- accumulo/trunk/test/src/main/java/org/apache/accumulo/test/continuous/ContinuousMoru.java
(original)
+++ accumulo/trunk/test/src/main/java/org/apache/accumulo/test/continuous/ContinuousMoru.java
Mon Jan 28 21:03:43 2013
@@ -22,6 +22,7 @@ import java.util.Set;
 import java.util.UUID;
 
 import org.apache.accumulo.core.cli.BatchWriterOpts;
+import org.apache.accumulo.core.client.AccumuloSecurityException;
 import org.apache.accumulo.core.client.mapreduce.AccumuloInputFormat;
 import org.apache.accumulo.core.client.mapreduce.AccumuloOutputFormat;
 import org.apache.accumulo.core.data.Key;
@@ -124,7 +125,7 @@ public class ContinuousMoru extends Conf
   }
   
   @Override
-  public int run(String[] args) throws IOException, InterruptedException, ClassNotFoundException
{
+  public int run(String[] args) throws IOException, InterruptedException, ClassNotFoundException,
AccumuloSecurityException {
     Opts opts = new Opts();
     BatchWriterOpts bwOpts = new BatchWriterOpts();
     opts.parseArgs(ContinuousMoru.class.getName(), args, bwOpts);

Modified: accumulo/trunk/test/src/main/java/org/apache/accumulo/test/functional/FunctionalTest.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/test/src/main/java/org/apache/accumulo/test/functional/FunctionalTest.java?rev=1439632&r1=1439631&r2=1439632&view=diff
==============================================================================
--- accumulo/trunk/test/src/main/java/org/apache/accumulo/test/functional/FunctionalTest.java
(original)
+++ accumulo/trunk/test/src/main/java/org/apache/accumulo/test/functional/FunctionalTest.java
Mon Jan 28 21:03:43 2013
@@ -39,7 +39,7 @@ 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.tokens.AccumuloToken;
+import org.apache.accumulo.core.security.tokens.SecurityToken;
 import org.apache.accumulo.core.security.tokens.InstanceTokenWrapper;
 import org.apache.accumulo.core.security.tokens.UserPassToken;
 import org.apache.accumulo.server.cli.ClientOpts;
@@ -106,14 +106,14 @@ public abstract class FunctionalTest {
     
   }
   
-  private AccumuloToken<?,?> token = new UserPassToken("", "");
+  private SecurityToken token = new UserPassToken("", "");
   private String instanceName = "";
   
-  protected void setToken(AccumuloToken<?,?> token) {
+  protected void setToken(SecurityToken token) {
     this.token = token;
   }
   
-  protected AccumuloToken<?,?> getToken() {
+  protected SecurityToken getToken() {
     return token;
   }
   

Modified: accumulo/trunk/test/src/main/java/org/apache/accumulo/test/functional/PermissionsTest.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/test/src/main/java/org/apache/accumulo/test/functional/PermissionsTest.java?rev=1439632&r1=1439631&r2=1439632&view=diff
==============================================================================
--- accumulo/trunk/test/src/main/java/org/apache/accumulo/test/functional/PermissionsTest.java
(original)
+++ accumulo/trunk/test/src/main/java/org/apache/accumulo/test/functional/PermissionsTest.java
Mon Jan 28 21:03:43 2013
@@ -173,7 +173,7 @@ public class PermissionsTest {
             test_user_conn.securityOperations().createUser(TEST_TOKEN);
             throw new IllegalStateException("Should NOT be able to create a user");
           } catch (AccumuloSecurityException e) {
-            if (e.getErrorCode() != SecurityErrorCode.PERMISSION_DENIED || root_conn.securityOperations().authenticateUser(user,
password.getBytes()))
+            if (e.getErrorCode() != SecurityErrorCode.PERMISSION_DENIED || root_conn.securityOperations().authenticateUser(new
UserPassToken(user, password.getBytes())))
               throw e;
           }
           break;
@@ -184,7 +184,7 @@ public class PermissionsTest {
             test_user_conn.securityOperations().dropUser(user);
             throw new IllegalStateException("Should NOT be able to delete a user");
           } catch (AccumuloSecurityException e) {
-            if (e.getErrorCode() != SecurityErrorCode.PERMISSION_DENIED || !root_conn.securityOperations().authenticateUser(user,
password.getBytes()))
+            if (e.getErrorCode() != SecurityErrorCode.PERMISSION_DENIED || !root_conn.securityOperations().authenticateUser(new
UserPassToken(user, password.getBytes())))
               throw e;
           }
           break;
@@ -253,14 +253,14 @@ public class PermissionsTest {
         case CREATE_USER:
           user = "__CREATE_USER_WITH_PERM_TEST__";
           test_user_conn.securityOperations().createUser(TEST_TOKEN);
-          if (!root_conn.securityOperations().authenticateUser(user, password.getBytes()))
+          if (!root_conn.securityOperations().authenticateUser(new UserPassToken(user, password.getBytes())))
             throw new IllegalStateException("Should be able to create a user");
           break;
         case DROP_USER:
           user = "__DROP_USER_WITH_PERM_TEST__";
           root_conn.securityOperations().createUser(TEST_TOKEN);
           test_user_conn.securityOperations().dropUser(user);
-          if (root_conn.securityOperations().authenticateUser(user, password.getBytes()))
+          if (root_conn.securityOperations().authenticateUser(new UserPassToken(user, password.getBytes())))
             throw new IllegalStateException("Should be able to delete a user");
           break;
         case ALTER_USER:

Modified: accumulo/trunk/test/src/main/java/org/apache/accumulo/test/performance/scan/CollectTabletStats.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/test/src/main/java/org/apache/accumulo/test/performance/scan/CollectTabletStats.java?rev=1439632&r1=1439631&r2=1439632&view=diff
==============================================================================
--- accumulo/trunk/test/src/main/java/org/apache/accumulo/test/performance/scan/CollectTabletStats.java
(original)
+++ accumulo/trunk/test/src/main/java/org/apache/accumulo/test/performance/scan/CollectTabletStats.java
Mon Jan 28 21:03:43 2013
@@ -63,7 +63,7 @@ import org.apache.accumulo.core.iterator
 import org.apache.accumulo.core.iterators.system.MultiIterator;
 import org.apache.accumulo.core.iterators.system.VisibilityFilter;
 import org.apache.accumulo.core.security.Authorizations;
-import org.apache.accumulo.core.security.tokens.AccumuloToken;
+import org.apache.accumulo.core.security.tokens.SecurityToken;
 import org.apache.accumulo.core.security.tokens.InstanceTokenWrapper;
 import org.apache.accumulo.core.util.AddressUtil;
 import org.apache.accumulo.core.util.CachedConfiguration;
@@ -340,7 +340,7 @@ public class CollectTabletStats {
     
   }
   
-  private static List<KeyExtent> findTablets(boolean selectLocalTablets, AccumuloToken<?,?>
token, String table, Instance zki,
+  private static List<KeyExtent> findTablets(boolean selectLocalTablets, SecurityToken
token, String table, Instance zki,
       Map<KeyExtent,String> locations) throws Exception {
     SortedSet<KeyExtent> tablets = new TreeSet<KeyExtent>();
     
@@ -375,7 +375,7 @@ public class CollectTabletStats {
     return tabletsToTest;
   }
   
-  private static List<String> getTabletFiles(AccumuloToken<?,?> token, Instance
zki, String tableId, KeyExtent ke) {
+  private static List<String> getTabletFiles(SecurityToken token, Instance zki, String
tableId, KeyExtent ke) {
     List<String> files = new ArrayList<String>();
     
     SortedMap<Key,Value> tkv = new TreeMap<Key,Value>();

Modified: accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/Authenticate.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/Authenticate.java?rev=1439632&r1=1439631&r2=1439632&view=diff
==============================================================================
--- accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/Authenticate.java
(original)
+++ accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/Authenticate.java
Mon Jan 28 21:03:43 2013
@@ -23,6 +23,7 @@ import org.apache.accumulo.core.client.A
 import org.apache.accumulo.core.client.AccumuloSecurityException;
 import org.apache.accumulo.core.client.Connector;
 import org.apache.accumulo.core.security.tokens.InstanceTokenWrapper;
+import org.apache.accumulo.core.security.tokens.UserPassToken;
 import org.apache.accumulo.test.randomwalk.State;
 import org.apache.accumulo.test.randomwalk.Test;
 
@@ -58,7 +59,7 @@ public class Authenticate extends Test {
     boolean result;
     
     try {
-      result = conn.securityOperations().authenticateUser(target, password);
+      result = conn.securityOperations().authenticateUser(new UserPassToken(target, password));
     } catch (AccumuloSecurityException ae) {
       switch (ae.getErrorCode()) {
         case PERMISSION_DENIED:

Modified: accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/ChangePass.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/ChangePass.java?rev=1439632&r1=1439631&r2=1439632&view=diff
==============================================================================
--- accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/ChangePass.java
(original)
+++ accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/ChangePass.java
Mon Jan 28 21:03:43 2013
@@ -60,7 +60,7 @@ public class ChangePass extends Test {
       newPass[i] = (byte) ((r.nextInt(26)+65) & 0xFF);
     
     try {
-      conn.securityOperations().changeUserPassword(target, newPass);
+      conn.securityOperations().changeUserPassword(new UserPassToken(target, newPass));
     } catch (AccumuloSecurityException ae) {
       switch (ae.getErrorCode()) {
         case PERMISSION_DENIED:

Modified: accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/WalkingSecurity.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/WalkingSecurity.java?rev=1439632&r1=1439631&r2=1439632&view=diff
==============================================================================
--- accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/WalkingSecurity.java
(original)
+++ accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/WalkingSecurity.java
Mon Jan 28 21:03:43 2013
@@ -31,7 +31,7 @@ import org.apache.accumulo.core.security
 import org.apache.accumulo.core.security.TablePermission;
 import org.apache.accumulo.core.security.thrift.SecurityErrorCode;
 import org.apache.accumulo.core.security.thrift.ThriftSecurityException;
-import org.apache.accumulo.core.security.tokens.AccumuloToken;
+import org.apache.accumulo.core.security.tokens.SecurityToken;
 import org.apache.accumulo.core.security.tokens.InstanceTokenWrapper;
 import org.apache.accumulo.core.security.tokens.UserPassToken;
 import org.apache.accumulo.core.util.CachedConfiguration;
@@ -138,14 +138,14 @@ public class WalkingSecurity extends Sec
   }
   
   @Override
-  public boolean authenticateUser(AccumuloToken<?,?> user) {
+  public boolean authenticateUser(SecurityToken user) {
     byte[] pass = (byte[]) state.get(user.getPrincipal() + userPass);
     boolean ret = Arrays.equals(pass, ((UserPassToken) user).getPassword());
     return ret;
   }
   
   @Override
-  public void createUser(AccumuloToken<?,?> token) throws AccumuloSecurityException
{
+  public void createUser(SecurityToken token) throws AccumuloSecurityException {
     UserPassToken upt = (UserPassToken) token;
     state.set(upt.getPrincipal() + userExists, Boolean.toString(true));
     changePassword(upt);
@@ -161,7 +161,7 @@ public class WalkingSecurity extends Sec
   }
   
   @Override
-  public void changePassword(AccumuloToken<?,?> user) throws AccumuloSecurityException
{
+  public void changePassword(SecurityToken user) throws AccumuloSecurityException {
     UserPassToken upt = (UserPassToken) user;
     state.set(upt.getPrincipal() + userPass, upt.getPassword());
     state.set(upt.getPrincipal() + userPass + "time", System.currentTimeMillis());

Modified: accumulo/trunk/test/src/main/java/org/apache/accumulo/test/scalability/ScaleTest.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/test/src/main/java/org/apache/accumulo/test/scalability/ScaleTest.java?rev=1439632&r1=1439631&r2=1439632&view=diff
==============================================================================
--- accumulo/trunk/test/src/main/java/org/apache/accumulo/test/scalability/ScaleTest.java
(original)
+++ accumulo/trunk/test/src/main/java/org/apache/accumulo/test/scalability/ScaleTest.java
Mon Jan 28 21:03:43 2013
@@ -23,6 +23,7 @@ import org.apache.accumulo.core.client.A
 import org.apache.accumulo.core.client.AccumuloSecurityException;
 import org.apache.accumulo.core.client.Connector;
 import org.apache.accumulo.core.client.ZooKeeperInstance;
+import org.apache.accumulo.core.security.tokens.UserPassToken;
 import org.apache.hadoop.io.Text;
 
 public abstract class ScaleTest {
@@ -45,7 +46,7 @@ public abstract class ScaleTest {
     String user = this.scaleProps.getProperty("USER");
     String password = this.scaleProps.getProperty("PASSWORD");
     
-    conn = new ZooKeeperInstance(instanceName, zookeepers).getConnector(user, password.getBytes());
+    conn = new ZooKeeperInstance(instanceName, zookeepers).getConnector(new UserPassToken(user,
password.getBytes()));
   }
   
   protected void startTimer() {

Modified: accumulo/trunk/test/src/test/java/org/apache/accumulo/test/iterator/RegExTest.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/test/src/test/java/org/apache/accumulo/test/iterator/RegExTest.java?rev=1439632&r1=1439631&r2=1439632&view=diff
==============================================================================
--- accumulo/trunk/test/src/test/java/org/apache/accumulo/test/iterator/RegExTest.java (original)
+++ accumulo/trunk/test/src/test/java/org/apache/accumulo/test/iterator/RegExTest.java Mon
Jan 28 21:03:43 2013
@@ -35,6 +35,7 @@ import org.apache.accumulo.core.data.Mut
 import org.apache.accumulo.core.data.Range;
 import org.apache.accumulo.core.data.Value;
 import org.apache.accumulo.core.iterators.user.RegExFilter;
+import org.apache.accumulo.core.security.tokens.UserPassToken;
 import org.apache.hadoop.io.Text;
 import org.junit.Test;
 
@@ -45,7 +46,7 @@ public class RegExTest {
   
   @Test
   public void runTest() throws Exception {
-    conn = inst.getConnector("user", "pass");
+    conn = inst.getConnector(new UserPassToken("user", "pass"));
     conn.tableOperations().create("ret");
     BatchWriter bw = conn.createBatchWriter("ret", new BatchWriterConfig());
     



Mime
View raw message