use of com.google.security.zynamics.binnavi.API.disassembly.Database in project binnavi by google.
the class DatabaseTest method testViewTagManager.
@Test
public void testViewTagManager() {
final MockDatabase mockDatabase = new MockDatabase();
final Database database = new Database(mockDatabase);
final TagManager manager1 = database.getViewTagManager();
final TagManager manager2 = database.getViewTagManager();
assertNotNull(manager1);
assertEquals(manager1, manager2);
}
use of com.google.security.zynamics.binnavi.API.disassembly.Database in project binnavi by google.
the class DatabaseTest method testSetDescription.
@Test
public void testSetDescription() {
final MockDatabaseListener listener = new MockDatabaseListener();
final MockDatabase mockDatabase = new MockDatabase();
final Database database = new Database(mockDatabase);
database.addListener(listener);
database.setDescription("Fark 1");
assertEquals("changedDescription;", listener.events);
assertEquals("Fark 1", database.getDescription());
assertEquals("Fark 1", mockDatabase.getConfiguration().getDescription());
mockDatabase.getConfiguration().setDescription("Fark 2");
assertEquals("changedDescription;changedDescription;", listener.events);
assertEquals("Fark 2", database.getDescription());
assertEquals("Fark 2", mockDatabase.getConfiguration().getDescription());
database.removeListener(listener);
}
use of com.google.security.zynamics.binnavi.API.disassembly.Database in project binnavi by google.
the class DatabaseTest method testSetUser.
@Test
public void testSetUser() {
final MockDatabaseListener listener = new MockDatabaseListener();
final MockDatabase mockDatabase = new MockDatabase();
final Database database = new Database(mockDatabase);
database.addListener(listener);
database.setUser("Fark 1");
assertEquals("changedUser;", listener.events);
assertEquals("Fark 1", database.getUser());
assertEquals("Fark 1", mockDatabase.getConfiguration().getUser());
mockDatabase.getConfiguration().setUser("Fark 2");
assertEquals("changedUser;changedUser;", listener.events);
assertEquals("Fark 2", database.getUser());
assertEquals("Fark 2", mockDatabase.getConfiguration().getUser());
database.removeListener(listener);
}
use of com.google.security.zynamics.binnavi.API.disassembly.Database in project binnavi by google.
the class CModuleNodeMenuBuilder method getPluginModules.
/**
* Returns the API module objects for the modules for which the menu was built.
*
* @return The API module objects.
*/
private List<Module> getPluginModules() {
final DatabaseManager manager = PluginInterface.instance().getDatabaseManager();
for (final Database database : manager) {
if (database.getNative() == m_database) {
final List<Module> allModules = database.getModules();
final List<Module> menuModules = new ArrayList<Module>();
for (final INaviModule module : m_modules) {
menuModules.add(ObjectFinders.getObject(module, allModules));
}
return menuModules;
}
}
throw new IllegalStateException("IE01165: Unknown database");
}
use of com.google.security.zynamics.binnavi.API.disassembly.Database in project binnavi by google.
the class CProjectNodeMenuBuilder method getPluginProjects.
/**
* Returns the API project objects for the projects for which the menu was built.
*
* @return The API project objects.
*/
private List<Project> getPluginProjects() {
final DatabaseManager manager = PluginInterface.instance().getDatabaseManager();
for (final Database database : manager) {
if (database.getNative() == m_database) {
final List<Project> allProjects = database.getProjects();
final List<Project> menuProjects = new ArrayList<Project>();
for (final INaviProject project : m_projects) {
menuProjects.add(ObjectFinders.getObject(project, allProjects));
}
return menuProjects;
}
}
throw new IllegalStateException("IE01168: Unknown database");
}
Aggregations