use of com.google.security.zynamics.binnavi.disassembly.INaviProject in project binnavi by google.
the class PostgreSQLProviderTest method testTraceFuntionsSetName1.
@Test
public void testTraceFuntionsSetName1() throws CouldntLoadDataException, LoadCancelledException, CouldntSaveDataException {
final INaviProject project = getProvider().createProject("SOME_PROJECT");
getProvider().createTrace(project, "SOME_TRACE_2344", "SOME_TRACE_DESCRIPTION_1235");
project.load();
final TraceList trace = project.getContent().getTraces().get(0);
assertEquals("SOME_TRACE_DESCRIPTION_1235", project.getContent().getTraces().get(0).getDescription());
final String name = "boing boing";
PostgreSQLTraceFunctions.setName((AbstractSQLProvider) getProvider(), trace, name);
project.close();
INaviProject project2 = null;
for (final INaviProject cProject : getProvider().loadProjects()) {
if (cProject.getConfiguration().getId() == project.getConfiguration().getId()) {
project2 = cProject;
}
}
getProvider().createTrace(project2, "SOME_TRACE_2", "SOME_TRACE_DESCRIPTION_2");
project2.load();
final TraceList trace2 = project2.getContent().getTraces().get(0);
assertEquals(name, trace2.getName());
}
use of com.google.security.zynamics.binnavi.disassembly.INaviProject in project binnavi by google.
the class PostgreSQLProviderTest method testCProjectFunctionsRemoveDebugger4.
@Test(expected = NullPointerException.class)
public void testCProjectFunctionsRemoveDebugger4() throws CouldntLoadDataException, CouldntSaveDataException {
final INaviProject project = getProvider().loadProjects().get(0);
PostgreSQLProjectFunctions.removeDebugger((AbstractSQLProvider) getProvider(), project, null);
}
use of com.google.security.zynamics.binnavi.disassembly.INaviProject in project binnavi by google.
the class PostgreSQLProviderTest method testTraceFuntionsSetName4.
@Test(expected = NullPointerException.class)
public void testTraceFuntionsSetName4() throws CouldntLoadDataException, LoadCancelledException, CouldntSaveDataException {
final INaviProject project = getProvider().createProject("SOME_PROJECT");
getProvider().createTrace(project, "SOME_TRACE_2344", "SOME_TRACE_DESCRIPTION_1235");
project.load();
final TraceList trace = project.getContent().getTraces().get(0);
PostgreSQLTraceFunctions.setName((AbstractSQLProvider) getProvider(), trace, null);
}
use of com.google.security.zynamics.binnavi.disassembly.INaviProject in project binnavi by google.
the class CDatabase method close.
@Override
public boolean close() {
Preconditions.checkArgument(isConnected(), "IE00664: Can not disconnect from the database because it is not connected");
if (PostgreSQLNotificationProvider.contains(provider)) {
PostgreSQLNotificationProvider.get(provider).unInitialize();
}
for (final IDatabaseListener listener : listeners) {
try {
if (!listener.closingDatabase(this)) {
return false;
}
} catch (final Exception exception) {
CUtilityFunctions.logException(exception);
}
}
if (isLoaded()) {
for (final INaviProject project : content.getProjects()) {
if (project.isLoaded() && !project.close()) {
return false;
}
}
}
provider.close();
provider = null;
for (final IDatabaseListener listener : listeners) {
try {
listener.closedDatabase(this);
} catch (final Exception exception) {
CUtilityFunctions.logException(exception);
}
}
content = null;
return true;
}
use of com.google.security.zynamics.binnavi.disassembly.INaviProject in project binnavi by google.
the class CViewsToProjectHandler method drop.
@SuppressWarnings("unchecked")
@Override
public void drop(final DefaultMutableTreeNode parentNode, final Object data) {
final CProjectViewsContainerNode projectNode = (CProjectViewsContainerNode) parentNode;
final INaviProject project = projectNode.getObject();
final List<INaviView> views = (List<INaviView>) data;
for (final INaviView view : views) {
CProjectFunctions.copyView(m_parent, project, view);
}
}
Aggregations