use of com.google.security.zynamics.binnavi.Gui.CriteriaDialog.Conditions.Selection.CSelectionCriterium in project binnavi by google.
the class CCriteriumFunctionsTest method testAppendTwoNoPath.
@Test
public void testAppendTwoNoPath() {
final CCriteriumTree cCriteriumTree = new CCriteriumTree();
final CCriteriaFactory cCriteriaFactory = new CCriteriaFactory(m_graph, null, null);
final List<ICriteriumCreator> criteria = cCriteriaFactory.getConditions();
final CConditionBox box = new CConditionBox(criteria);
final JCriteriumTree jtree = new JCriteriumTree(cCriteriumTree, criteria);
final CCriteriumTreeNode child = new CCriteriumTreeNode(new CColorCriterium(m_graph));
cCriteriumTree.appendNode(cCriteriumTree.getRoot(), child);
final TreePath path = new TreePath(((JCriteriumTreeNode) jtree.getModel().getRoot()).getFirstChild());
jtree.setSelectionPath(path);
box.setSelectedIndex(6);
CCriteriumFunctions.appendCriterium(jtree, cCriteriumTree, box);
assertTrue(cCriteriumTree.getRoot().getChildren().get(0).getChildren().get(0).getCriterium() instanceof CSelectionCriterium);
assertFalse(cCriteriumTree.getRoot().getChildren().get(0).getChildren().get(0).getCriterium() instanceof CTagCriterium);
}
Aggregations