Search in sources :

Example 11 with INaviProject

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

the class PostgreSQLViewNotificationParserTest method testProjectViewInform1.

@Test
public void testProjectViewInform1() throws CouldntLoadDataException {
    final INaviProject project = new MockProject(provider);
    final ViewNotificationContainer container = new ViewNotificationContainer(view.getConfiguration().getId(), Optional.fromNullable(view), Optional.of(project.getConfiguration().getId()), Optional.<INaviModule>absent(), Optional.of(project), "UPDATE");
    final PostgreSQLViewNotificationParser parser = new PostgreSQLViewNotificationParser();
    parser.inform(Lists.<ViewNotificationContainer>newArrayList(container), provider);
}
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 12 with INaviProject

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

the class PostgreSQLProviderTest method testCSettingsFunctionsWriteSettings24.

@Test(expected = NullPointerException.class)
public void testCSettingsFunctionsWriteSettings24() throws CouldntLoadDataException, CouldntSaveDataException {
    final INaviProject project = getProvider().loadProjects().get(0);
    PostgreSQLSettingsFunctions.writeSetting((AbstractSQLProvider) getProvider(), project, "key", 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 13 with INaviProject

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

the class PostgreSQLProviderTest method testGetViewsWithAddress_Project3.

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

Example 14 with INaviProject

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

the class PostgreSQLProviderTest method testCProjectFunctionsSetName1.

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

Example 15 with INaviProject

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

the class PostgreSQLProviderTest method testTraceFunctionsDeleteTrace1.

@Test
public void testTraceFunctionsDeleteTrace1() throws CouldntLoadDataException, LoadCancelledException, CouldntDeleteException, CouldntSaveDataException {
    final CProject project = getProvider().createProject("SOME_NEW_PROJECT");
    getProvider().createTrace(project, "SOME_TRACE_NAME_ONE", "SOME_TRACE_DESCRIPTION_ONE");
    getProvider().createTrace(project, "SOME_TRACE_NAME_TWO", "SOME_TRACE_DESCRIPTION_TWO");
    project.load();
    final int projectTraceCount = project.getContent().getTraceCount();
    assertEquals(2, projectTraceCount);
    PostgreSQLTraceFunctions.deleteTrace((AbstractSQLProvider) getProvider(), project.getContent().getTraces().get(0));
    project.close();
    final List<INaviProject> projects = getProvider().loadProjects();
    INaviProject project2 = null;
    for (final INaviProject cProject : projects) {
        if (cProject.getConfiguration().getId() == project.getConfiguration().getId()) {
            project2 = cProject;
        }
    }
    project2.load();
    assertEquals(projectTraceCount - 1, project2.getContent().getTraceCount());
}
Also used : CProject(com.google.security.zynamics.binnavi.disassembly.CProject) INaviProject(com.google.security.zynamics.binnavi.disassembly.INaviProject) 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