Search in sources :

Example 21 with CProject

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

the class PostgreSQLProviderTest method testAssignDebuggerAddressSpace1.

@Test
public void testAssignDebuggerAddressSpace1() throws CouldntSaveDataException, CouldntLoadDataException {
    final CProject project = getProvider().createProject("ADDRESS_SPACE_PROJECT_123");
    getProvider().createAddressSpace(project, "ADDRESS_SPACE_123");
    final CAddressSpace addressSpace = getProvider().loadAddressSpaces(project).get(0);
    getProvider().assignDebugger(addressSpace, getProvider().loadDebuggers().getDebugger(0));
    getProvider().assignDebugger(addressSpace, null);
}
Also used : CProject(com.google.security.zynamics.binnavi.disassembly.CProject) CAddressSpace(com.google.security.zynamics.binnavi.disassembly.AddressSpaces.CAddressSpace) ExpensiveBaseTest(com.google.security.zynamics.binnavi.disassembly.types.ExpensiveBaseTest) Test(org.junit.Test)

Example 22 with CProject

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

the class ProjectTest method setUp.

@SuppressWarnings("deprecation")
@Before
public void setUp() {
    modificationDate.setYear(creationDate.getYear() + 1);
    m_internalProject = new CProject(1, "Project Name", "Project Description", creationDate, modificationDate, 1, new ArrayList<com.google.security.zynamics.binnavi.debug.debugger.DebuggerTemplate>(), provider);
    final TagManager nodeTagManager = new TagManager(new CTagManager(new Tree<CTag>(new TreeNode<CTag>(new CTag(1, "", "", TagType.NODE_TAG, provider))), TagType.NODE_TAG, provider));
    final TagManager viewTagManager = new TagManager(new CTagManager(new Tree<CTag>(new TreeNode<CTag>(new CTag(1, "", "", TagType.VIEW_TAG, provider))), TagType.VIEW_TAG, provider));
    m_project = new Project(database, m_internalProject, nodeTagManager, viewTagManager);
}
Also used : CProject(com.google.security.zynamics.binnavi.disassembly.CProject) CProject(com.google.security.zynamics.binnavi.disassembly.CProject) CTagManager(com.google.security.zynamics.binnavi.Tagging.CTagManager) ArrayList(java.util.ArrayList) CTag(com.google.security.zynamics.binnavi.Tagging.CTag) Tree(com.google.security.zynamics.zylib.types.trees.Tree) CTagManager(com.google.security.zynamics.binnavi.Tagging.CTagManager) Before(org.junit.Before)

Example 23 with CProject

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

the class PostgreSQLProviderTestTeardown method testDeleteAddressSpace2.

@Test
public void testDeleteAddressSpace2() throws CouldntDeleteException, CouldntLoadDataException, CouldntSaveDataException {
    final CProject project = getProvider().createProject("DELETE_ADDRESS_SPACE_PROJECT");
    getProvider().createAddressSpace(project, "DELETE_ADDRESS_SPACE_ADDRESS_SPACE");
    getProvider().deleteAddressSpace(getProvider().loadAddressSpaces(project).get(0));
}
Also used : CProject(com.google.security.zynamics.binnavi.disassembly.CProject) ExpensiveBaseTest(com.google.security.zynamics.binnavi.disassembly.types.ExpensiveBaseTest) Test(org.junit.Test)

Example 24 with CProject

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

the class PostgreSQLProviderTest method testCAddressSpaceLoaderLoadAddressSpaces5.

@Test(expected = NullPointerException.class)
public void testCAddressSpaceLoaderLoadAddressSpaces5() throws CouldntLoadDataException {
    final CProject project = (CProject) getProvider().loadProjects().get(0);
    final DebuggerTemplateManager debuggerManager = new DebuggerTemplateManager(getProvider());
    PostgreSQLAddressSpaceLoader.loadAddressSpaces((AbstractSQLProvider) getProvider(), project, debuggerManager, null);
}
Also used : CProject(com.google.security.zynamics.binnavi.disassembly.CProject) DebuggerTemplateManager(com.google.security.zynamics.binnavi.debug.debugger.DebuggerTemplateManager) ExpensiveBaseTest(com.google.security.zynamics.binnavi.disassembly.types.ExpensiveBaseTest) Test(org.junit.Test)

Example 25 with CProject

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

the class PostgreSQLProviderTest method testAddModuleConstructor2.

@Test(expected = NullPointerException.class)
public void testAddModuleConstructor2() throws CouldntLoadDataException, CouldntSaveDataException {
    final CProject project = getProvider().createProject("TEST ADD MOUDLE CONSTRUCTOR 2");
    getProvider().createAddressSpace(project, "FOOBAR_ADDRESS_SPACE");
    getProvider().loadAddressSpaces(project).get(0);
    getProvider().addModule(getProvider().loadAddressSpaces(project).get(0), null);
}
Also used : CProject(com.google.security.zynamics.binnavi.disassembly.CProject) ExpensiveBaseTest(com.google.security.zynamics.binnavi.disassembly.types.ExpensiveBaseTest) Test(org.junit.Test)

Aggregations

CProject (com.google.security.zynamics.binnavi.disassembly.CProject)28 Test (org.junit.Test)15 ExpensiveBaseTest (com.google.security.zynamics.binnavi.disassembly.types.ExpensiveBaseTest)12 Date (java.util.Date)10 ArrayList (java.util.ArrayList)9 MockDatabase (com.google.security.zynamics.binnavi.Database.MockClasses.MockDatabase)8 DebuggerTemplate (com.google.security.zynamics.binnavi.debug.debugger.DebuggerTemplate)8 Before (org.junit.Before)8 INaviModule (com.google.security.zynamics.binnavi.disassembly.INaviModule)5 CAddressSpace (com.google.security.zynamics.binnavi.disassembly.AddressSpaces.CAddressSpace)4 CAddress (com.google.security.zynamics.zylib.disassembly.CAddress)4 CouldntLoadDataException (com.google.security.zynamics.binnavi.Database.Exceptions.CouldntLoadDataException)3 CouldntSaveDataException (com.google.security.zynamics.binnavi.Database.Exceptions.CouldntSaveDataException)3 CProjectTreeModel (com.google.security.zynamics.binnavi.Gui.MainWindow.ProjectTree.CProjectTreeModel)3 INaviProject (com.google.security.zynamics.binnavi.disassembly.INaviProject)3 DefaultMutableTreeNode (javax.swing.tree.DefaultMutableTreeNode)3 CouldntDeleteException (com.google.security.zynamics.binnavi.Database.Exceptions.CouldntDeleteException)2 MockSqlProvider (com.google.security.zynamics.binnavi.Database.MockClasses.MockSqlProvider)2 CTag (com.google.security.zynamics.binnavi.Tagging.CTag)2 CTagManager (com.google.security.zynamics.binnavi.Tagging.CTagManager)2