use of com.google.security.zynamics.binnavi.Gui.CriteriaDialog.ExpressionModel.CCachedExpressionTree in project binnavi by google.
the class JCriteriumTreeModelTest method setUp.
@Before
public void setUp() throws FileReadException, CouldntLoadDataException, LoadCancelledException, CouldntSaveDataException {
m_graph = ZyGraphFactory.generateTestGraph();
m_tree = new CCachedExpressionTree();
try {
PluginInterface.instance("", new MockDatabaseManager(), new PluginRegistry());
} catch (final IllegalStateException e) {
}
}
use of com.google.security.zynamics.binnavi.Gui.CriteriaDialog.ExpressionModel.CCachedExpressionTree in project binnavi by google.
the class CCriteriumCacheTest method testAdd.
@Test
public void testAdd() {
final CCachedExpressionTree cachedTree = new CCachedExpressionTree();
final CCachedExpressionTree cachedTree2 = new CCachedExpressionTree();
final CCachedAndCriterium criterium = new CCachedAndCriterium();
final CCachedExpressionTreeNode node = new CCachedExpressionTreeNode(criterium);
CCachedExpressionTreeNode.append(cachedTree.getRoot(), node);
final CCachedExpressionTreeNode node_a = new CCachedExpressionTreeNode(new CCachedColorCriterium(Color.red));
CCachedExpressionTreeNode.append(node, node_a);
final CCachedExpressionTreeNode node_b = new CCachedExpressionTreeNode(new CCachedColorCriterium(Color.blue));
CCachedExpressionTreeNode.append(node, node_b);
final CCachedExpressionTreeNode node2 = new CCachedExpressionTreeNode(new CCachedTextCriterium("foo", false, false));
CCachedExpressionTreeNode.append(cachedTree2.getRoot(), node2);
final CCriteriumCache criteriumCache = new CCriteriumCache();
criteriumCache.addListener(m_listener);
assertEquals(0, criteriumCache.getTrees().size());
criteriumCache.add(cachedTree);
assertEquals(1, criteriumCache.getTrees().size());
criteriumCache.add(cachedTree2);
assertEquals(2, criteriumCache.getTrees().size());
}
use of com.google.security.zynamics.binnavi.Gui.CriteriaDialog.ExpressionModel.CCachedExpressionTree in project binnavi by google.
the class CCriteriumCacheTest method testRemoveListener.
@Test
public void testRemoveListener() {
final CCachedExpressionTree cachedTree = new CCachedExpressionTree();
final CCachedExpressionTreeNode node = new CCachedExpressionTreeNode(new CCachedTextCriterium("foo", false, false));
CCachedExpressionTreeNode.append(cachedTree.getRoot(), node);
final CCriteriumCache criteriumCache = new CCriteriumCache();
criteriumCache.addListener(m_listener);
assertEquals(0, criteriumCache.getTrees().size());
criteriumCache.add(cachedTree);
assertEquals(1, criteriumCache.getTrees().size());
criteriumCache.removeListener(m_listener);
}
Aggregations