use of com.google.security.zynamics.binnavi.API.disassembly.Database in project binnavi by google.
the class DatabaseTest method testSetDriver.
@Test
public void testSetDriver() {
final MockDatabaseListener listener = new MockDatabaseListener();
final MockDatabase mockDatabase = new MockDatabase();
final Database database = new Database(mockDatabase);
database.addListener(listener);
database.setDriver("Fark 1");
assertEquals("changedDriver;", listener.events);
assertEquals("Fark 1", database.getDriver());
assertEquals("Fark 1", mockDatabase.getConfiguration().getDriver());
mockDatabase.getConfiguration().setDriver("Fark 2");
assertEquals("changedDriver;changedDriver;", listener.events);
assertEquals("Fark 2", database.getDriver());
assertEquals("Fark 2", mockDatabase.getConfiguration().getDriver());
database.removeListener(listener);
}
use of com.google.security.zynamics.binnavi.API.disassembly.Database in project binnavi by google.
the class CAddressSpaceNodeMenuBuilder method getPluginAddressSpaces.
/**
* Returns the API address space objects for the address spaces for which the menu was built.
*
* @return The API address space objects.
*/
private List<AddressSpace> getPluginAddressSpaces() {
final DatabaseManager manager = PluginInterface.instance().getDatabaseManager();
for (final Database database : manager) {
if (database.getNative() == m_database) {
for (final Project project : database.getProjects()) {
if (project.getNative() == m_project) {
final List<AddressSpace> allSpaces = project.getAddressSpaces();
final List<AddressSpace> menuSpaces = new ArrayList<AddressSpace>();
for (final INaviAddressSpace addressSpace : m_addressSpaces) {
menuSpaces.add(ObjectFinders.getObject(addressSpace, allSpaces));
}
return menuSpaces;
}
}
}
}
throw new IllegalStateException("IE01159: Unknown database");
}
use of com.google.security.zynamics.binnavi.API.disassembly.Database in project binnavi by google.
the class ProjectFactory method get.
public static Project get() {
final MockSqlProvider provider = new MockSqlProvider();
final Date creationDate = new Date();
final Date modificationDate = new Date();
final CProject internalProject = new CProject(123, "Name", "Comment", creationDate, modificationDate, 55, new FilledList<DebuggerTemplate>(), provider);
final TagManager nodeTagManager = new TagManager(new CTagManager(new Tree<CTag>(new TreeNode<CTag>(new CTag(0, "", "", TagType.NODE_TAG, provider))), TagType.NODE_TAG, provider));
final TagManager viewTagManager = new TagManager(new CTagManager(new Tree<CTag>(new TreeNode<CTag>(new CTag(0, "", "", TagType.VIEW_TAG, provider))), TagType.VIEW_TAG, provider));
final Database db = new Database(new MockDatabase());
return new Project(db, internalProject, nodeTagManager, viewTagManager);
}
use of com.google.security.zynamics.binnavi.API.disassembly.Database in project binnavi by google.
the class ModuleFactory method get.
public static Module get(final INaviModule module) {
final MockSqlProvider provider = new MockSqlProvider();
final TagManager nodeTagManager = new TagManager(new CTagManager(new Tree<CTag>(new TreeNode<CTag>(new CTag(0, "", "", TagType.NODE_TAG, provider))), TagType.NODE_TAG, provider));
final TagManager viewTagManager = new TagManager(new CTagManager(new Tree<CTag>(new TreeNode<CTag>(new CTag(0, "", "", TagType.VIEW_TAG, provider))), TagType.VIEW_TAG, provider));
final Database db = new Database(new MockDatabase());
return new Module(db, module, nodeTagManager, viewTagManager);
}
use of com.google.security.zynamics.binnavi.API.disassembly.Database in project binnavi by google.
the class ModuleFactory method get.
public static Module get(final INaviModule module, final SQLProvider provider) {
final TagManager nodeTagManager = new TagManager(new CTagManager(new Tree<CTag>(new TreeNode<CTag>(new CTag(0, "", "", TagType.NODE_TAG, provider))), TagType.NODE_TAG, provider));
final TagManager viewTagManager = new TagManager(new CTagManager(new Tree<CTag>(new TreeNode<CTag>(new CTag(0, "", "", TagType.VIEW_TAG, provider))), TagType.VIEW_TAG, provider));
final Database db = new Database(new MockDatabase());
return new Module(db, module, nodeTagManager, viewTagManager);
}
Aggregations