Search in sources :

Example 26 with DebuggerTemplate

use of com.google.security.zynamics.binnavi.debug.debugger.DebuggerTemplate in project binnavi by google.

the class PostgreSQLProviderTest method testSetPort1.

@Test
public void testSetPort1() throws CouldntSaveDataException, CouldntLoadDataException {
    final DebuggerTemplate debuggerTemplate = getProvider().loadDebuggers().getDebugger(0);
    getProvider().setPort(debuggerTemplate, 123);
}
Also used : DebuggerTemplate(com.google.security.zynamics.binnavi.debug.debugger.DebuggerTemplate) ExpensiveBaseTest(com.google.security.zynamics.binnavi.disassembly.types.ExpensiveBaseTest) Test(org.junit.Test)

Example 27 with DebuggerTemplate

use of com.google.security.zynamics.binnavi.debug.debugger.DebuggerTemplate in project binnavi by google.

the class PostgreSQLProviderTest method testAssignDebuggerAddressSpace2.

@Test(expected = NullPointerException.class)
public void testAssignDebuggerAddressSpace2() throws CouldntSaveDataException, CouldntLoadDataException {
    final DebuggerTemplate debuggerTemplate = getProvider().loadDebuggers().getDebugger(0);
    getProvider().assignDebugger((CAddressSpace) null, debuggerTemplate);
}
Also used : DebuggerTemplate(com.google.security.zynamics.binnavi.debug.debugger.DebuggerTemplate) ExpensiveBaseTest(com.google.security.zynamics.binnavi.disassembly.types.ExpensiveBaseTest) Test(org.junit.Test)

Example 28 with DebuggerTemplate

use of com.google.security.zynamics.binnavi.debug.debugger.DebuggerTemplate in project binnavi by google.

the class PostgreSQLProviderTest method testSetHost1.

@Test
public void testSetHost1() throws CouldntSaveDataException, CouldntLoadDataException {
    final DebuggerTemplate debuggerTemplate = getProvider().loadDebuggers().getDebugger(0);
    getProvider().setHost(debuggerTemplate, "localhost");
}
Also used : DebuggerTemplate(com.google.security.zynamics.binnavi.debug.debugger.DebuggerTemplate) ExpensiveBaseTest(com.google.security.zynamics.binnavi.disassembly.types.ExpensiveBaseTest) Test(org.junit.Test)

Example 29 with DebuggerTemplate

use of com.google.security.zynamics.binnavi.debug.debugger.DebuggerTemplate in project binnavi by google.

the class CProjectContainerTest method testListenersSomehow.

@Test
public void testListenersSomehow() throws CouldntSaveDataException, CouldntLoadDataException, LoadCancelledException, CouldntDeleteException {
    @SuppressWarnings("unused") final CProjectContainer container = new CProjectContainer(m_database, m_project);
    final DebuggerTemplate template = new DebuggerTemplate(2, "bla", "horst", 2222, m_provider);
    m_space.getConfiguration().setDebuggerTemplate(template);
    m_space.getConfiguration().setDebuggerTemplate(null);
    assertEquals(1, m_space.getContent().getModules().size());
    m_space.getContent().removeModule(m_module);
    m_space.getContent().addModule(m_module);
    m_module.load();
    m_project.load();
    m_space.close();
    m_space.load();
}
Also used : DebuggerTemplate(com.google.security.zynamics.binnavi.debug.debugger.DebuggerTemplate) CProjectContainer(com.google.security.zynamics.binnavi.disassembly.CProjectContainer) Test(org.junit.Test)

Example 30 with DebuggerTemplate

use of com.google.security.zynamics.binnavi.debug.debugger.DebuggerTemplate in project binnavi by google.

the class CProjectContainerTest method setUp.

@Before
public void setUp() throws CouldntLoadDataException, LoadCancelledException, CouldntSaveDataException, IllegalArgumentException, SecurityException, IllegalAccessException, NoSuchFieldException {
    m_provider = new MockSqlProvider();
    m_module = new MockModule(m_provider);
    m_database = new MockDatabase(m_provider);
    m_function = new MockFunction(m_provider);
    m_project = new CProject(123, "Name", "Comment", new Date(), new Date(), 55, new FilledList<DebuggerTemplate>(), m_provider);
    m_project.load();
    m_space = m_project.getContent().createAddressSpace("space");
    m_space.load();
    m_space.getContent().addModule(m_module);
    m_debugger = new DebuggerTemplate(2, "gdb", "local", 2222, m_provider);
    m_space.getConfiguration().setDebuggerTemplate(m_debugger);
    m_listener = new MockAddressSpaceListener();
    m_space.addListener(m_listener);
    m_module.load();
    CFunctionContainerHelper.addFunction(m_module.getContent().getFunctionContainer(), m_function);
    final CView view = m_module.getContent().getViewContainer().createView("foo", "bar");
    @SuppressWarnings("unused") final MockViewContainer mockViewContainer = new MockViewContainer();
    final MockViewListener listener = new MockViewListener();
    view.addListener(listener);
}
Also used : CProject(com.google.security.zynamics.binnavi.disassembly.CProject) FilledList(com.google.security.zynamics.zylib.types.lists.FilledList) IFilledList(com.google.security.zynamics.zylib.types.lists.IFilledList) DebuggerTemplate(com.google.security.zynamics.binnavi.debug.debugger.DebuggerTemplate) MockAddressSpaceListener(com.google.security.zynamics.binnavi.disassembly.AddressSpaces.MockAddressSpaceListener) Date(java.util.Date) CView(com.google.security.zynamics.binnavi.disassembly.views.CView) MockModule(com.google.security.zynamics.binnavi.disassembly.Modules.MockModule) MockSqlProvider(com.google.security.zynamics.binnavi.Database.MockClasses.MockSqlProvider) MockDatabase(com.google.security.zynamics.binnavi.Database.MockClasses.MockDatabase) Before(org.junit.Before)

Aggregations

DebuggerTemplate (com.google.security.zynamics.binnavi.debug.debugger.DebuggerTemplate)55 Test (org.junit.Test)29 Date (java.util.Date)20 CModule (com.google.security.zynamics.binnavi.disassembly.Modules.CModule)16 CAddress (com.google.security.zynamics.zylib.disassembly.CAddress)16 MockSqlProvider (com.google.security.zynamics.binnavi.Database.MockClasses.MockSqlProvider)12 MockDatabase (com.google.security.zynamics.binnavi.Database.MockClasses.MockDatabase)11 ExpensiveBaseTest (com.google.security.zynamics.binnavi.disassembly.types.ExpensiveBaseTest)11 CProject (com.google.security.zynamics.binnavi.disassembly.CProject)8 ArrayList (java.util.ArrayList)8 Before (org.junit.Before)8 ResultSet (java.sql.ResultSet)7 SQLException (java.sql.SQLException)6 CConnection (com.google.security.zynamics.binnavi.Database.CConnection)5 CouldntLoadDataException (com.google.security.zynamics.binnavi.Database.Exceptions.CouldntLoadDataException)5 CTag (com.google.security.zynamics.binnavi.Tagging.CTag)5 CInstruction (com.google.security.zynamics.binnavi.disassembly.CInstruction)5 SQLProvider (com.google.security.zynamics.binnavi.Database.Interfaces.SQLProvider)4 CTagManager (com.google.security.zynamics.binnavi.Tagging.CTagManager)4 MockTagManager (com.google.security.zynamics.binnavi.Tagging.MockTagManager)4