Search in sources :

Example 1 with CCachedTagCriterium

use of com.google.security.zynamics.binnavi.Gui.CriteriaDialog.Conditions.Tag.CCachedTagCriterium in project binnavi by google.

the class CCriteriumExecuterTest method testSingleTagCriterion.

@Test
public void testSingleTagCriterion() {
    final Set<CTag> tags = new HashSet<CTag>();
    for (final NaviNode node : m_graph.getNodes()) {
        if (node.getRawNode().isTagged()) {
            tags.addAll(node.getRawNode().getTags());
        }
    }
    assertEquals(1, tags.size());
    final CCachedTagCriterium criterium = new CCachedTagCriterium(false, Iterables.getOnlyElement(tags));
    final CCachedExpressionTreeNode node = new CCachedExpressionTreeNode(criterium);
    CCachedExpressionTreeNode.append(m_tree.getRoot(), node);
    assertEquals(0, m_graph.getSelectedNodes().size());
    CCriteriumExecuter.execute(m_tree, m_graph);
    assertEquals(1, m_graph.getSelectedNodes().size());
}
Also used : CCachedTagCriterium(com.google.security.zynamics.binnavi.Gui.CriteriaDialog.Conditions.Tag.CCachedTagCriterium) CTag(com.google.security.zynamics.binnavi.Tagging.CTag) NaviNode(com.google.security.zynamics.binnavi.yfileswrap.zygraph.NaviNode) CCachedExpressionTreeNode(com.google.security.zynamics.binnavi.Gui.CriteriaDialog.ExpressionModel.CCachedExpressionTreeNode) HashSet(java.util.HashSet) Test(org.junit.Test)

Aggregations

CCachedTagCriterium (com.google.security.zynamics.binnavi.Gui.CriteriaDialog.Conditions.Tag.CCachedTagCriterium)1 CCachedExpressionTreeNode (com.google.security.zynamics.binnavi.Gui.CriteriaDialog.ExpressionModel.CCachedExpressionTreeNode)1 CTag (com.google.security.zynamics.binnavi.Tagging.CTag)1 NaviNode (com.google.security.zynamics.binnavi.yfileswrap.zygraph.NaviNode)1 HashSet (java.util.HashSet)1 Test (org.junit.Test)1