use of com.google.security.zynamics.binnavi.Gui.CriteriaDialog.CCriteriaFactory in project binnavi by google.
the class JCriteriumTreeModelTest method testInsertNode.
@Test
public void testInsertNode() {
final JTree tree = new JTree();
final CCriteriumTree cCriteriumTree = new CCriteriumTree();
final CCriteriaFactory cCriteriaFactory = new CCriteriaFactory(m_graph, null, null);
final JCriteriumTreeModel jCriterumTreeModel = new JCriteriumTreeModel(tree, cCriteriumTree, cCriteriaFactory.getConditions());
final CCriteriumTreeNode child = new CCriteriumTreeNode(new CColorCriterium(m_graph));
cCriteriumTree.appendNode(cCriteriumTree.getRoot(), child);
final CCriteriumTreeNode child2 = new CCriteriumTreeNode(new CAndCriterium());
cCriteriumTree.insertNode(cCriteriumTree.getRoot(), child2);
assertEquals(1, ((JCriteriumTreeNode) jCriterumTreeModel.getRoot()).getChildCount());
assertEquals(child2.getCriterium(), ((JCriteriumTreeNode) ((JCriteriumTreeNode) jCriterumTreeModel.getRoot()).getChildAt(0)).getCriterium());
assertEquals(child.getCriterium(), ((JCriteriumTreeNode) ((JCriteriumTreeNode) ((JCriteriumTreeNode) jCriterumTreeModel.getRoot()).getChildAt(0)).getChildAt(0)).getCriterium());
}
use of com.google.security.zynamics.binnavi.Gui.CriteriaDialog.CCriteriaFactory in project binnavi by google.
the class JCriteriumTreeModelTest method testRemoveAll.
@Test
public void testRemoveAll() {
final JTree tree = new JTree();
final CCriteriumTree cCriteriumTree = new CCriteriumTree();
final CCriteriaFactory cCriteriaFactory = new CCriteriaFactory(m_graph, null, null);
final JCriteriumTreeModel jCriterumTreeModel = new JCriteriumTreeModel(tree, cCriteriumTree, cCriteriaFactory.getConditions());
final CCriteriumTreeNode child = new CCriteriumTreeNode(new CColorCriterium(m_graph));
cCriteriumTree.appendNode(cCriteriumTree.getRoot(), child);
final CCriteriumTreeNode child2 = new CCriteriumTreeNode(new CAndCriterium());
cCriteriumTree.insertNode(cCriteriumTree.getRoot(), child2);
final CCriteriumTreeNode child3 = new CCriteriumTreeNode(new CColorCriterium(m_graph));
cCriteriumTree.appendNode(child2, child3);
cCriteriumTree.clear();
assertEquals(0, ((JCriteriumTreeNode) jCriterumTreeModel.getRoot()).getChildCount());
}
Aggregations