accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ktur...@apache.org
Subject svn commit: r1380842 - /accumulo/trunk/core/src/test/java/org/apache/accumulo/core/security/VisibilityEvaluatorTest.java
Date Tue, 04 Sep 2012 20:06:07 GMT
Author: kturner
Date: Tue Sep  4 20:06:07 2012
New Revision: 1380842

URL: http://svn.apache.org/viewvc?rev=1380842&view=rev
Log:
ACCUMULO-241 Added unit test to ensure non-ascii chars can work in visibility label

Modified:
    accumulo/trunk/core/src/test/java/org/apache/accumulo/core/security/VisibilityEvaluatorTest.java

Modified: accumulo/trunk/core/src/test/java/org/apache/accumulo/core/security/VisibilityEvaluatorTest.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/test/java/org/apache/accumulo/core/security/VisibilityEvaluatorTest.java?rev=1380842&r1=1380841&r2=1380842&view=diff
==============================================================================
--- accumulo/trunk/core/src/test/java/org/apache/accumulo/core/security/VisibilityEvaluatorTest.java
(original)
+++ accumulo/trunk/core/src/test/java/org/apache/accumulo/core/security/VisibilityEvaluatorTest.java
Tue Sep  4 20:06:07 2012
@@ -106,4 +106,15 @@ public class VisibilityEvaluatorTest {
     assertEquals("\"A\\\"\\\\C\"", quote("A\"\\C"));
     assertEquals("ACS", quote("ACS"));
   }
+  
+  @Test
+  public void testNonAscii() throws VisibilityParseException {
+    VisibilityEvaluator ct = new VisibilityEvaluator(ByteArraySet.fromStrings("五", "六",
"八", "九"));
+    
+    assertTrue(ct.evaluate(new ColumnVisibility(quote("五") + "|" + quote("四"))));
+    assertFalse(ct.evaluate(new ColumnVisibility(quote("五") + "&" + quote("四"))));
+    assertTrue(ct.evaluate(new ColumnVisibility(quote("五") + "&(" + quote("四")
+ "|" + quote("九") + ")")));
+    assertFalse(ct.evaluate(new ColumnVisibility(quote("五") + "&(" + quote("四")
+ "|" + quote("三") + ")")));
+
+  }
 }



Mime
View raw message