accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r1206169 - /incubator/accumulo/branches/1.3/src/core/src/test/java/org/apache/accumulo/core/client/mock/MockConnectorTest.java
Date Fri, 25 Nov 2011 13:50:18 GMT
Author: ecn
Date: Fri Nov 25 13:50:18 2011
New Revision: 1206169

URL: http://svn.apache.org/viewvc?rev=1206169&view=rev
Log:
ACCUMULO-172: setting auths already works in MockAccumulo... wrote a unit test to show that
it does

Modified:
    incubator/accumulo/branches/1.3/src/core/src/test/java/org/apache/accumulo/core/client/mock/MockConnectorTest.java

Modified: incubator/accumulo/branches/1.3/src/core/src/test/java/org/apache/accumulo/core/client/mock/MockConnectorTest.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/test/java/org/apache/accumulo/core/client/mock/MockConnectorTest.java?rev=1206169&r1=1206168&r2=1206169&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/core/src/test/java/org/apache/accumulo/core/client/mock/MockConnectorTest.java
(original)
+++ incubator/accumulo/branches/1.3/src/core/src/test/java/org/apache/accumulo/core/client/mock/MockConnectorTest.java
Fri Nov 25 13:50:18 2011
@@ -38,6 +38,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.aggregation.conf.AggregatorConfiguration;
+import org.apache.accumulo.core.security.Authorizations;
 import org.apache.hadoop.io.Text;
 import org.junit.Test;
 
@@ -75,6 +76,16 @@ public class MockConnectorTest {
   }
   
   @Test
+  public void testChangeAuths() throws Exception {
+    Connector c = new MockConnector("root");
+    c.securityOperations().createUser("greg", new byte[] {}, new Authorizations("A", "B",
"C"));
+    assertTrue(c.securityOperations().getUserAuthorizations("greg").contains("A".getBytes()));
+    c.securityOperations().changeUserAuthorizations("greg", new Authorizations("X", "Y",
"Z"));
+    assertTrue(c.securityOperations().getUserAuthorizations("greg").contains("X".getBytes()));
+    assertFalse(c.securityOperations().getUserAuthorizations("greg").contains("A".getBytes()));
+  }
+  
+  @Test
   public void testAggregation() throws Exception {
     MockInstance mockInstance = new MockInstance();
     Connector c = mockInstance.getConnector("root", new byte[] {});



Mime
View raw message