Search in sources :

Example 6 with CProjectTreeModel

use of com.google.security.zynamics.binnavi.Gui.MainWindow.ProjectTree.CProjectTreeModel in project binnavi by google.

the class CAddressSpaceNodeTest method setUp.

@Before
public void setUp() throws IllegalArgumentException, SecurityException, IllegalAccessException, NoSuchFieldException, FileReadException, CouldntLoadDataException, CouldntSaveDataException, LoadCancelledException {
    ConfigManager.instance().read();
    m_database = new MockDatabase(m_provider);
    m_project = new CProject(1, "Mock Project", "Mock Project Description", new Date(), new Date(), 0, new ArrayList<DebuggerTemplate>(), m_provider);
    m_project.load();
    m_addressSpace = m_project.getContent().createAddressSpace("Address Space");
    final CProjectTreeModel model = new CProjectTreeModel(m_tree);
    model.setRoot(new DefaultMutableTreeNode());
    m_tree.setModel(model);
    assertTrue(((LinkedHashSet<?>) ReflectionHelpers.getField(ReflectionHelpers.getField(m_database, "listeners"), "m_listeners")) == null);
    assertTrue(((LinkedHashSet<?>) ReflectionHelpers.getField(ReflectionHelpers.getField(m_project, "m_listeners"), "m_listeners")) == null);
    assertTrue(((LinkedHashSet<?>) ReflectionHelpers.getField(ReflectionHelpers.getField(m_addressSpace, "m_listeners"), "m_listeners")) == null);
    assertTrue(((LinkedHashSet<?>) ReflectionHelpers.getField(ReflectionHelpers.getField(ZyGraphBuilderManager.instance(), "m_listeners"), "m_listeners")) == null);
    m_container = new CProjectContainer(m_database, m_project, m_addressSpace);
}
Also used : CProject(com.google.security.zynamics.binnavi.disassembly.CProject) DefaultMutableTreeNode(javax.swing.tree.DefaultMutableTreeNode) CProjectTreeModel(com.google.security.zynamics.binnavi.Gui.MainWindow.ProjectTree.CProjectTreeModel) CProjectContainer(com.google.security.zynamics.binnavi.disassembly.CProjectContainer) ArrayList(java.util.ArrayList) MockDatabase(com.google.security.zynamics.binnavi.Database.MockClasses.MockDatabase) Date(java.util.Date) Before(org.junit.Before)

Example 7 with CProjectTreeModel

use of com.google.security.zynamics.binnavi.Gui.MainWindow.ProjectTree.CProjectTreeModel in project binnavi by google.

the class CDatabaseNodeTest method setUp.

@Before
public void setUp() throws IllegalArgumentException, SecurityException, FileReadException, CouldntLoadDataException, CouldntSaveDataException, LoadCancelledException {
    ConfigManager.instance().read();
    m_database = new MockDatabase(m_provider);
    m_project = new CProject(1, "Mock Project", "Mock Project Description", new Date(), new Date(), 0, new ArrayList<DebuggerTemplate>(), m_provider);
    m_project.load();
    m_addressSpace = m_project.getContent().createAddressSpace("Address Space");
    final CProjectTreeModel model = new CProjectTreeModel(m_tree);
    model.setRoot(new DefaultMutableTreeNode());
    m_tree.setModel(model);
}
Also used : CProject(com.google.security.zynamics.binnavi.disassembly.CProject) DefaultMutableTreeNode(javax.swing.tree.DefaultMutableTreeNode) CProjectTreeModel(com.google.security.zynamics.binnavi.Gui.MainWindow.ProjectTree.CProjectTreeModel) ArrayList(java.util.ArrayList) MockDatabase(com.google.security.zynamics.binnavi.Database.MockClasses.MockDatabase) Date(java.util.Date) Before(org.junit.Before)

Example 8 with CProjectTreeModel

use of com.google.security.zynamics.binnavi.Gui.MainWindow.ProjectTree.CProjectTreeModel in project binnavi by google.

the class CDebuggerNodeTest method setUp.

@Before
public void setUp() throws IllegalArgumentException, SecurityException, FileReadException {
    ConfigManager.instance().read();
    m_database = new MockDatabase(m_provider);
    m_template = new DebuggerTemplate(1, "My Debugger", "Bar", 123, m_provider);
    final CProjectTreeModel model = new CProjectTreeModel(m_tree);
    model.setRoot(new DefaultMutableTreeNode());
    m_tree.setModel(model);
}
Also used : DefaultMutableTreeNode(javax.swing.tree.DefaultMutableTreeNode) DebuggerTemplate(com.google.security.zynamics.binnavi.debug.debugger.DebuggerTemplate) CProjectTreeModel(com.google.security.zynamics.binnavi.Gui.MainWindow.ProjectTree.CProjectTreeModel) MockDatabase(com.google.security.zynamics.binnavi.Database.MockClasses.MockDatabase) Before(org.junit.Before)

Aggregations

MockDatabase (com.google.security.zynamics.binnavi.Database.MockClasses.MockDatabase)8 CProjectTreeModel (com.google.security.zynamics.binnavi.Gui.MainWindow.ProjectTree.CProjectTreeModel)8 DefaultMutableTreeNode (javax.swing.tree.DefaultMutableTreeNode)8 Before (org.junit.Before)8 Date (java.util.Date)4 CProject (com.google.security.zynamics.binnavi.disassembly.CProject)3 ArrayList (java.util.ArrayList)3 DebuggerTemplate (com.google.security.zynamics.binnavi.debug.debugger.DebuggerTemplate)2 CProjectContainer (com.google.security.zynamics.binnavi.disassembly.CProjectContainer)1 CRawModule (com.google.security.zynamics.binnavi.disassembly.CRawModule)1 CModule (com.google.security.zynamics.binnavi.disassembly.Modules.CModule)1 CAddress (com.google.security.zynamics.zylib.disassembly.CAddress)1