Search in sources :

Example 16 with CProjectContainer

use of com.google.security.zynamics.binnavi.disassembly.CProjectContainer in project binnavi by google.

the class CProjectNodeTest method testUnloadedClosed.

@Test
public void testUnloadedClosed() throws CouldntSaveDataException, CouldntLoadDataException, CouldntDeleteException, LoadCancelledException, IllegalArgumentException, SecurityException, IllegalAccessException, NoSuchFieldException {
    final CProjectNode node = new CProjectNode(m_tree, new DefaultMutableTreeNode(), m_database, m_project, new CProjectContainer(m_database, m_project));
    assertEquals("Name (0)", node.toString());
    m_project.load();
    assertEquals("Name (1)", node.toString());
    final CAddressSpace addressSpace = m_project.getContent().createAddressSpace("Fark");
    assertEquals("Name (2)", node.toString());
    m_project.getContent().removeAddressSpace(addressSpace);
    assertEquals("Name (1)", node.toString());
    m_project.close();
    node.dispose();
    assertTrue(((Collection<?>) ReflectionHelpers.getField(ReflectionHelpers.getField(m_database, "listeners"), "m_listeners")) == null);
    assertTrue(((Collection<?>) ReflectionHelpers.getField(ReflectionHelpers.getField(m_project, "m_listeners"), "m_listeners")).isEmpty());
}
Also used : DefaultMutableTreeNode(javax.swing.tree.DefaultMutableTreeNode) CProjectContainer(com.google.security.zynamics.binnavi.disassembly.CProjectContainer) CProjectNode(com.google.security.zynamics.binnavi.Gui.MainWindow.ProjectTree.Nodes.Project.CProjectNode) CAddressSpace(com.google.security.zynamics.binnavi.disassembly.AddressSpaces.CAddressSpace) Test(org.junit.Test)

Example 17 with CProjectContainer

use of com.google.security.zynamics.binnavi.disassembly.CProjectContainer in project binnavi by google.

the class CProjectContainerTest method testCreateView.

@Test
public void testCreateView() {
    final CProjectContainer container = new CProjectContainer(m_database, m_project);
    try {
        container.createView(null, null);
        fail();
    } catch (final NullPointerException e) {
    }
    try {
        container.createView("seppel", null);
        fail();
    } catch (final NullPointerException e) {
    }
    final INaviView view = container.createView("foo", "berT");
    assertNotNull(view);
}
Also used : INaviView(com.google.security.zynamics.binnavi.disassembly.views.INaviView) CProjectContainer(com.google.security.zynamics.binnavi.disassembly.CProjectContainer) Test(org.junit.Test)

Example 18 with CProjectContainer

use of com.google.security.zynamics.binnavi.disassembly.CProjectContainer in project binnavi by google.

the class CProjectContainerTest method testGetFunction.

@Test
public void testGetFunction() {
    final CProjectContainer container = new CProjectContainer(m_database, m_project);
    final INaviView view = container.createView("foo", "berT");
    try {
        container.getFunction(null);
        fail();
    } catch (final NullPointerException e) {
    }
    assertNull(container.getFunction(view));
}
Also used : INaviView(com.google.security.zynamics.binnavi.disassembly.views.INaviView) CProjectContainer(com.google.security.zynamics.binnavi.disassembly.CProjectContainer) Test(org.junit.Test)

Example 19 with CProjectContainer

use of com.google.security.zynamics.binnavi.disassembly.CProjectContainer in project binnavi by google.

the class CProjectContainerTest method testGetName.

@Test
public void testGetName() {
    final CProjectContainer container = new CProjectContainer(m_database, m_project);
    assertEquals("Name", container.getName());
}
Also used : CProjectContainer(com.google.security.zynamics.binnavi.disassembly.CProjectContainer) Test(org.junit.Test)

Example 20 with CProjectContainer

use of com.google.security.zynamics.binnavi.disassembly.CProjectContainer in project binnavi by google.

the class CProjectContainerTest method testGetModules.

@Test
public void testGetModules() {
    final CProjectContainer container = new CProjectContainer(m_database, m_project);
    assertEquals(1, container.getModules().size());
}
Also used : CProjectContainer(com.google.security.zynamics.binnavi.disassembly.CProjectContainer) Test(org.junit.Test)

Aggregations

CProjectContainer (com.google.security.zynamics.binnavi.disassembly.CProjectContainer)29 Test (org.junit.Test)24 INaviView (com.google.security.zynamics.binnavi.disassembly.views.INaviView)7 DefaultMutableTreeNode (javax.swing.tree.DefaultMutableTreeNode)6 CProjectNode (com.google.security.zynamics.binnavi.Gui.MainWindow.ProjectTree.Nodes.Project.CProjectNode)5 Module (com.google.security.zynamics.binnavi.API.disassembly.Module)3 Project (com.google.security.zynamics.binnavi.API.disassembly.Project)3 ViewContainer (com.google.security.zynamics.binnavi.API.disassembly.ViewContainer)3 CAddressSpace (com.google.security.zynamics.binnavi.disassembly.AddressSpaces.CAddressSpace)3 CModuleContainer (com.google.security.zynamics.binnavi.disassembly.Modules.CModuleContainer)3 IViewContainer (com.google.security.zynamics.binnavi.disassembly.views.IViewContainer)3 UnrelocatedAddress (com.google.security.zynamics.binnavi.disassembly.UnrelocatedAddress)2 FilledList (com.google.security.zynamics.zylib.types.lists.FilledList)2 IFilledList (com.google.security.zynamics.zylib.types.lists.IFilledList)2 MockDatabase (com.google.security.zynamics.binnavi.Database.MockClasses.MockDatabase)1 CProjectTreeModel (com.google.security.zynamics.binnavi.Gui.MainWindow.ProjectTree.CProjectTreeModel)1 DebuggerTemplate (com.google.security.zynamics.binnavi.debug.debugger.DebuggerTemplate)1 ITraceEvent (com.google.security.zynamics.binnavi.debug.models.trace.interfaces.ITraceEvent)1 CProject (com.google.security.zynamics.binnavi.disassembly.CProject)1 INaviModule (com.google.security.zynamics.binnavi.disassembly.INaviModule)1