use of com.google.security.zynamics.binnavi.Gui.CriteriaDialog.Conditions.Selection.CCachedSelectionCriterium in project binnavi by google.
the class CCriteriumExecuterTest method testSingleSelectionCriterionUnselected.
@Test
public void testSingleSelectionCriterionUnselected() {
assertEquals(0, m_graph.getSelectedNodes().size());
m_graph.getRawView().getGraph().getNodes().get(1).setSelected(true);
assertEquals(1, m_graph.getSelectedNodes().size());
final CCachedSelectionCriterium criterium = new CCachedSelectionCriterium(SelectionState.UNSELECTED);
final CCachedExpressionTreeNode node = new CCachedExpressionTreeNode(criterium);
CCachedExpressionTreeNode.append(m_tree.getRoot(), node);
assertEquals(1, m_graph.getSelectedNodes().size());
CCriteriumExecuter.execute(m_tree, m_graph);
assertEquals(m_graph.getNodes().size() - 1, m_graph.getSelectedNodes().size());
assertFalse(m_graph.getRawView().getGraph().getNodes().get(1).isSelected());
}
use of com.google.security.zynamics.binnavi.Gui.CriteriaDialog.Conditions.Selection.CCachedSelectionCriterium in project binnavi by google.
the class CCriteriumExecuterTest method testSingleSelectionCriterionSelected.
/**
* This test checks if a node that is selected also is selected after criterium executer has been
* run.
*/
@Test
public void testSingleSelectionCriterionSelected() {
assertEquals(0, m_graph.getSelectedNodes().size());
m_graph.getRawView().getGraph().getNodes().get(1).setSelected(true);
assertEquals(1, m_graph.getSelectedNodes().size());
final CCachedSelectionCriterium criterium = new CCachedSelectionCriterium(SelectionState.SELECTED);
final CCachedExpressionTreeNode node = new CCachedExpressionTreeNode(criterium);
CCachedExpressionTreeNode.append(m_tree.getRoot(), node);
assertEquals(1, m_graph.getSelectedNodes().size());
CCriteriumExecuter.execute(m_tree, m_graph);
assertEquals(1, m_graph.getSelectedNodes().size());
assertTrue(m_graph.getRawView().getGraph().getNodes().get(1).isSelected());
}
Aggregations