use of org.apache.accumulo.core.security.ColumnVisibility.Node in project accumulo by apache.
the class ColumnVisibilityTest method testEmptyParseTreesAreEqual.
@Test
public void testEmptyParseTreesAreEqual() {
Comparator<Node> comparator = new NodeComparator(new byte[] {});
Node empty = new ColumnVisibility().getParseTree();
assertEquals(0, comparator.compare(empty, parse("")));
}
use of org.apache.accumulo.core.security.ColumnVisibility.Node in project accumulo by apache.
the class ColumnVisibilityTest method testParseTreeWithTwoChildren.
@Test
public void testParseTreeWithTwoChildren() {
Node node = parse("ABC|DEF");
assertNode(node, NodeType.OR, 0, 7);
assertNode(node.getChildren().get(0), NodeType.TERM, 0, 3);
assertNode(node.getChildren().get(1), NodeType.TERM, 4, 7);
}
use of org.apache.accumulo.core.security.ColumnVisibility.Node in project accumulo by apache.
the class ColumnVisibilityTest method testParseTree.
@Test
public void testParseTree() {
Node node = parse("(W)|(U&V)");
assertNode(node, NodeType.OR, 0, 9);
assertNode(node.getChildren().get(0), NodeType.TERM, 1, 2);
assertNode(node.getChildren().get(1), NodeType.AND, 5, 8);
}
use of org.apache.accumulo.core.security.ColumnVisibility.Node in project accumulo by apache.
the class ColumnVisibilityTest method testParseTreeWithParenthesizedChildren.
@Test
public void testParseTreeWithParenthesizedChildren() {
Node node = parse("ABC|(DEF&GHI)");
assertNode(node, NodeType.OR, 0, 13);
assertNode(node.getChildren().get(0), NodeType.TERM, 0, 3);
assertNode(node.getChildren().get(1), NodeType.AND, 5, 12);
assertNode(node.getChildren().get(1).children.get(0), NodeType.TERM, 5, 8);
assertNode(node.getChildren().get(1).children.get(1), NodeType.TERM, 9, 12);
}
use of org.apache.accumulo.core.security.ColumnVisibility.Node in project incubator-rya by apache.
the class DisjunctiveNormalFormConverterTest method testTruthTableNullExpression.
/**
* Test truth table with a {@code null} expression.
*/
@Test(expected = NullPointerException.class)
public void testTruthTableNullExpression() {
final Node node = new DocumentVisibility("A").getParseTree();
final byte[] expression = null;
DisjunctiveNormalFormConverter.createTruthTableInputs(node, expression);
}
Aggregations