accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ktur...@apache.org
Subject [2/3] accumulo git commit: Merge branch '1.6' into 1.7
Date Mon, 04 Jan 2016 19:30:08 GMT
Merge branch '1.6' into 1.7

Conflicts:
	core/src/main/java/org/apache/accumulo/core/security/VisibilityEvaluator.java


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

Branch: refs/heads/master
Commit: ff08336435ed2ca5625a1e65ac0c5f7fe9cdfd12
Parents: 01cdd02 e581d5b
Author: Keith Turner <kturner@apache.org>
Authored: Mon Jan 4 14:08:48 2016 -0500
Committer: Keith Turner <kturner@apache.org>
Committed: Mon Jan 4 14:08:48 2016 -0500

----------------------------------------------------------------------
 .../core/security/VisibilityEvaluator.java      | 60 +++++++++++++++++++-
 .../core/security/VisibilityEvaluatorTest.java  | 37 +++++++++++-
 2 files changed, 95 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/ff083364/core/src/main/java/org/apache/accumulo/core/security/VisibilityEvaluator.java
----------------------------------------------------------------------
diff --cc core/src/main/java/org/apache/accumulo/core/security/VisibilityEvaluator.java
index 99aa383,2338ed9..03b336b
--- a/core/src/main/java/org/apache/accumulo/core/security/VisibilityEvaluator.java
+++ b/core/src/main/java/org/apache/accumulo/core/security/VisibilityEvaluator.java
@@@ -18,6 -18,9 +18,8 @@@ package org.apache.accumulo.core.securi
  
  import java.util.ArrayList;
  
 -import org.apache.accumulo.core.constraints.Constraint.Environment;
+ import org.apache.accumulo.core.data.ArrayByteSequence;
+ import org.apache.accumulo.core.data.ByteSequence;
  import org.apache.accumulo.core.security.ColumnVisibility.Node;
  
  /**
@@@ -79,12 -138,13 +137,12 @@@ public class VisibilityEvaluator 
    }
  
    /**
 -   * Creates a new evaluator for the authorizations found in the given environment.
 +   * Creates a new evaluator for the authorizations found in the given container.
     *
 -   * @param env
 -   *          environment containing authorizations
 +   * @since 1.7.0
     */
 -  VisibilityEvaluator(Environment env) {
 -    this.auths = new UnescapingAuthorizationContainer(env.getAuthorizationsContainer());
 +  public VisibilityEvaluator(AuthorizationContainer authsContainer) {
-     this.auths = authsContainer;
++    this.auths = new UnescapingAuthorizationContainer(authsContainer);
    }
  
    /**

http://git-wip-us.apache.org/repos/asf/accumulo/blob/ff083364/core/src/test/java/org/apache/accumulo/core/security/VisibilityEvaluatorTest.java
----------------------------------------------------------------------
diff --cc core/src/test/java/org/apache/accumulo/core/security/VisibilityEvaluatorTest.java
index 2996970,ed90c81..9e73048
--- a/core/src/test/java/org/apache/accumulo/core/security/VisibilityEvaluatorTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/security/VisibilityEvaluatorTest.java
@@@ -22,8 -22,12 +22,9 @@@ import static org.junit.Assert.assertFa
  import static org.junit.Assert.assertTrue;
  import static org.junit.Assert.fail;
  
 -import org.apache.accumulo.core.constraints.Constraint;
 -import org.apache.accumulo.core.constraints.Constraint.Environment;
+ import org.apache.accumulo.core.data.ArrayByteSequence;
  import org.apache.accumulo.core.util.BadArgumentException;
  import org.apache.accumulo.core.util.ByteArraySet;
 -import org.easymock.EasyMock;
  import org.junit.Test;
  
  public class VisibilityEvaluatorTest {
@@@ -88,8 -92,19 +89,17 @@@
  
    @Test
    public void testQuotedExpressions() throws VisibilityParseException {
-     VisibilityEvaluator ct = new VisibilityEvaluator(new Authorizations("A#C", "A\"C", "A\\C",
"AC"));
  
+     Authorizations auths = new Authorizations("A#C", "A\"C", "A\\C", "AC");
+     VisibilityEvaluator ct = new VisibilityEvaluator(auths);
+     runQuoteTest(ct);
+ 
 -    Environment env = EasyMock.createNiceMock(Constraint.Environment.class);
 -    EasyMock.expect(env.getAuthorizationsContainer()).andReturn(auths);
 -    EasyMock.replay(env);
 -    ct = new VisibilityEvaluator(env);
++    // constuct VisibilityEvaluator using another constructor and run test again
++    ct = new VisibilityEvaluator((AuthorizationContainer) auths);
+     runQuoteTest(ct);
+   }
+ 
+   private void runQuoteTest(VisibilityEvaluator ct) throws VisibilityParseException {
      assertTrue(ct.evaluate(new ColumnVisibility(quote("A#C") + "|" + quote("A?C"))));
      assertTrue(ct.evaluate(new ColumnVisibility(new ColumnVisibility(quote("A#C") + "|"
+ quote("A?C")).flatten())));
      assertTrue(ct.evaluate(new ColumnVisibility(quote("A\"C") + "&" + quote("A\\C"))));


Mime
View raw message