Search in sources :

Example 31 with INaviProject

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

the class PostgreSQLViewNotificationParserTest method testProjectViewInform0.

@Test
public void testProjectViewInform0() throws CouldntLoadDataException {
    final INaviProject project = new MockProject(provider);
    final int currentUserViewSize = project.getContent().getViews().size();
    final ViewNotificationContainer container = new ViewNotificationContainer(view.getConfiguration().getId(), Optional.fromNullable(view), Optional.of(project.getConfiguration().getId()), Optional.<INaviModule>absent(), Optional.of(project), "INSERT");
    final PostgreSQLViewNotificationParser parser = new PostgreSQLViewNotificationParser();
    parser.inform(Lists.<ViewNotificationContainer>newArrayList(container), provider);
    assertEquals(currentUserViewSize + 1, project.getContent().getViews().size());
}
Also used : MockProject(com.google.security.zynamics.binnavi.disassembly.MockProject) INaviProject(com.google.security.zynamics.binnavi.disassembly.INaviProject) PostgreSQLViewNotificationParser(com.google.security.zynamics.binnavi.Database.PostgreSQL.Notifications.parsers.PostgreSQLViewNotificationParser) ViewNotificationContainer(com.google.security.zynamics.binnavi.Database.PostgreSQL.Notifications.containers.ViewNotificationContainer) Test(org.junit.Test)

Example 32 with INaviProject

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

the class PostgreSQLProviderTest method testAddDebuggerConstructor2.

@Test(expected = NullPointerException.class)
public void testAddDebuggerConstructor2() throws CouldntSaveDataException, CouldntLoadDataException {
    final INaviProject project = getProvider().loadProjects().get(0);
    getProvider().addDebugger(project, null);
}
Also used : INaviProject(com.google.security.zynamics.binnavi.disassembly.INaviProject) ExpensiveBaseTest(com.google.security.zynamics.binnavi.disassembly.types.ExpensiveBaseTest) Test(org.junit.Test)

Example 33 with INaviProject

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

the class PostgreSQLProviderTest method testTraceFunctionsSetDescription4.

@Test(expected = NullPointerException.class)
public void testTraceFunctionsSetDescription4() throws CouldntSaveDataException {
    final INaviProject project = getProvider().createProject("SOME_PROJECT");
    getProvider().createTrace(project, "SOME_TRACE", "SOME_TRACE_DESCRIPTION");
    final TraceList trace = project.getContent().getTraces().get(0);
    PostgreSQLTraceFunctions.setDescription((AbstractSQLProvider) getProvider(), trace, null);
}
Also used : INaviProject(com.google.security.zynamics.binnavi.disassembly.INaviProject) TraceList(com.google.security.zynamics.binnavi.debug.models.trace.TraceList) ExpensiveBaseTest(com.google.security.zynamics.binnavi.disassembly.types.ExpensiveBaseTest) Test(org.junit.Test)

Example 34 with INaviProject

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

the class PostgreSQLProviderTest method testCProjectFunctionsSetName4.

@Test(expected = NullPointerException.class)
public void testCProjectFunctionsSetName4() throws CouldntLoadDataException, CouldntSaveDataException {
    final INaviProject project = getProvider().loadProjects().get(0);
    PostgreSQLProjectFunctions.setName((AbstractSQLProvider) getProvider(), project, null);
}
Also used : INaviProject(com.google.security.zynamics.binnavi.disassembly.INaviProject) ExpensiveBaseTest(com.google.security.zynamics.binnavi.disassembly.types.ExpensiveBaseTest) Test(org.junit.Test)

Example 35 with INaviProject

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

the class PostgreSQLProviderTest method testCProjectFunctionsRemoveDebugger1.

@Test
public void testCProjectFunctionsRemoveDebugger1() throws CouldntLoadDataException, LoadCancelledException, CouldntSaveDataException {
    final INaviProject project = getProvider().loadProjects().get(0);
    project.load();
    final DebuggerTemplate debugger = new DebuggerTemplate(1, "foo", "host", 1234, getProvider());
    PostgreSQLProjectFunctions.removeDebugger((AbstractSQLProvider) getProvider(), project, debugger);
}
Also used : INaviProject(com.google.security.zynamics.binnavi.disassembly.INaviProject) DebuggerTemplate(com.google.security.zynamics.binnavi.debug.debugger.DebuggerTemplate) ExpensiveBaseTest(com.google.security.zynamics.binnavi.disassembly.types.ExpensiveBaseTest) Test(org.junit.Test)

Aggregations

INaviProject (com.google.security.zynamics.binnavi.disassembly.INaviProject)45 Test (org.junit.Test)31 ExpensiveBaseTest (com.google.security.zynamics.binnavi.disassembly.types.ExpensiveBaseTest)27 TraceList (com.google.security.zynamics.binnavi.debug.models.trace.TraceList)6 ViewNotificationContainer (com.google.security.zynamics.binnavi.Database.PostgreSQL.Notifications.containers.ViewNotificationContainer)5 CouldntLoadDataException (com.google.security.zynamics.binnavi.Database.Exceptions.CouldntLoadDataException)4 CouldntSaveDataException (com.google.security.zynamics.binnavi.Database.Exceptions.CouldntSaveDataException)4 PostgreSQLViewNotificationParser (com.google.security.zynamics.binnavi.Database.PostgreSQL.Notifications.parsers.PostgreSQLViewNotificationParser)4 CProject (com.google.security.zynamics.binnavi.disassembly.CProject)4 INaviModule (com.google.security.zynamics.binnavi.disassembly.INaviModule)4 MockProject (com.google.security.zynamics.binnavi.disassembly.MockProject)4 LoadCancelledException (com.google.security.zynamics.binnavi.Database.Exceptions.LoadCancelledException)3 CAddressSpace (com.google.security.zynamics.binnavi.disassembly.AddressSpaces.CAddressSpace)3 UnrelocatedAddress (com.google.security.zynamics.binnavi.disassembly.UnrelocatedAddress)3 INaviView (com.google.security.zynamics.binnavi.disassembly.views.INaviView)3 SQLException (java.sql.SQLException)3 ArrayList (java.util.ArrayList)3 CouldntConnectException (com.google.security.zynamics.binnavi.Database.Exceptions.CouldntConnectException)2 CouldntInitializeDatabaseException (com.google.security.zynamics.binnavi.Database.Exceptions.CouldntInitializeDatabaseException)2 CouldntLoadDriverException (com.google.security.zynamics.binnavi.Database.Exceptions.CouldntLoadDriverException)2