Search in sources :

Example 6 with CDatabaseNode

use of com.google.security.zynamics.binnavi.Gui.MainWindow.ProjectTree.Nodes.Database.CDatabaseNode in project binnavi by google.

the class CDatabaseNodeTest method testClosed.

@Test
public void testClosed() throws IllegalArgumentException, SecurityException, IllegalAccessException, NoSuchFieldException {
    final CDatabaseNode node = new CDatabaseNode(m_tree, new DefaultMutableTreeNode(), m_database);
    m_database.load();
    m_database.close();
    node.dispose();
    assertTrue(((LinkedHashSet<?>) ReflectionHelpers.getField(ReflectionHelpers.getField(m_database, "listeners"), "m_listeners")).isEmpty());
}
Also used : DefaultMutableTreeNode(javax.swing.tree.DefaultMutableTreeNode) CDatabaseNode(com.google.security.zynamics.binnavi.Gui.MainWindow.ProjectTree.Nodes.Database.CDatabaseNode) Test(org.junit.Test)

Example 7 with CDatabaseNode

use of com.google.security.zynamics.binnavi.Gui.MainWindow.ProjectTree.Nodes.Database.CDatabaseNode in project binnavi by google.

the class CDatabaseNodeTest method testChangingDescription.

@Test
public void testChangingDescription() {
    final CDatabaseNode node = new CDatabaseNode(m_tree, new DefaultMutableTreeNode(), m_database);
    assertEquals("Mock Database", node.toString());
    m_database.getConfiguration().setDescription("Hannes");
    assertEquals("Hannes", node.toString());
}
Also used : DefaultMutableTreeNode(javax.swing.tree.DefaultMutableTreeNode) CDatabaseNode(com.google.security.zynamics.binnavi.Gui.MainWindow.ProjectTree.Nodes.Database.CDatabaseNode) Test(org.junit.Test)

Aggregations

CDatabaseNode (com.google.security.zynamics.binnavi.Gui.MainWindow.ProjectTree.Nodes.Database.CDatabaseNode)7 DefaultMutableTreeNode (javax.swing.tree.DefaultMutableTreeNode)6 Test (org.junit.Test)6 IDatabase (com.google.security.zynamics.binnavi.Database.Interfaces.IDatabase)1