@Test public void testVisibilityEvaluator() throws VisibilityParseException { VisibilityEvaluator ct = new VisibilityEvaluator( new Authorizations(ByteArraySet.fromStrings("one", "two", "three", "four"))); assertTrue(ct.evaluate(new ColumnVisibility(new byte[0]))); assertTrue("'and' test", ct.evaluate(new ColumnVisibility("one&two"))); assertTrue("'or' test", ct.evaluate(new ColumnVisibility("foor|four"))); assertTrue("'and' and 'or' test", ct.evaluate(new ColumnVisibility("(one&two)|(foo&bar)"))); for (String marking : new String[] {"one", "one|five", "five|one", "(one)", "(one&two)|(foo&bar)", "(one|foo)&three", "one|foo|bar", "(one|foo)|bar", "((one|foo)|bar)&two"}) { assertTrue(marking, ct.evaluate(new ColumnVisibility(marking))); } for (String marking : new String[] {"five", "one&five", "five&one", "((one|foo)|bar)&goober"}) { assertFalse(marking, ct.evaluate(new ColumnVisibility(marking))); } for (String marking : new String[] {"one(five)", "(five)one", "(one)(two)", "a|(b(c))"}) { try { ct.evaluate(new ColumnVisibility(marking)); fail(marking + " failed to throw"); } catch (BadArgumentException e) { } } for (String marking : new String[] {"&(five)", "|(five)", "(five)&", "five|", "a|(b)&", "(&five)", "(five|)"}) { try { ct.evaluate(new ColumnVisibility(marking)); fail(marking + " failed to throw"); } catch (BadArgumentException e) { } } for (String marking : new String[] {"(", ")", "(a&b", "b|a)"}) { try { ct.evaluate(new ColumnVisibility(marking)); fail(marking + " failed to throw"); } catch (BadArgumentException e) { } } }
public VisibilityEvaluator(AuthorizationContainer authsContainer) { this.auths = new UnescapingAuthorizationContainer(authsContainer); }
VisibilityEvaluator { public VisibilityEvaluator(AuthorizationContainer authsContainer) { this.auths = new UnescapingAuthorizationContainer(authsContainer); } }
VisibilityEvaluator { public VisibilityEvaluator(AuthorizationContainer authsContainer) { this.auths = new UnescapingAuthorizationContainer(authsContainer); } VisibilityEvaluator(AuthorizationContainer authsContainer);  VisibilityEvaluator(Authorizations authorizations); }
VisibilityEvaluator { public VisibilityEvaluator(AuthorizationContainer authsContainer) { this.auths = new UnescapingAuthorizationContainer(authsContainer); } VisibilityEvaluator(AuthorizationContainer authsContainer);  VisibilityEvaluator(Authorizations authorizations); static byte[] escape(byte[] auth, boolean quote); boolean evaluate(ColumnVisibility visibility); }
VisibilityEvaluator { public VisibilityEvaluator(AuthorizationContainer authsContainer) { this.auths = new UnescapingAuthorizationContainer(authsContainer); } VisibilityEvaluator(AuthorizationContainer authsContainer);  VisibilityEvaluator(Authorizations authorizations); static byte[] escape(byte[] auth, boolean quote); boolean evaluate(ColumnVisibility visibility);  }