use of com.google.security.zynamics.binnavi.Database.MockClasses.MockDatabase in project binnavi by google.
the class DatabaseTest method testSetPassword.
@Test
public void testSetPassword() {
final MockDatabaseListener listener = new MockDatabaseListener();
final MockDatabase mockDatabase = new MockDatabase();
final Database database = new Database(mockDatabase);
database.addListener(listener);
database.setPassword("Fark 1");
assertEquals("changedPassword;", listener.events);
assertEquals("Fark 1", database.getPassword());
assertEquals("Fark 1", mockDatabase.getConfiguration().getPassword());
mockDatabase.getConfiguration().setPassword("Fark 2");
assertEquals("changedPassword;changedPassword;", listener.events);
assertEquals("Fark 2", database.getPassword());
assertEquals("Fark 2", mockDatabase.getConfiguration().getPassword());
database.removeListener(listener);
}
use of com.google.security.zynamics.binnavi.Database.MockClasses.MockDatabase in project binnavi by google.
the class DatabaseTest method testSetHost.
@Test
public void testSetHost() {
final MockDatabaseListener listener = new MockDatabaseListener();
final MockDatabase mockDatabase = new MockDatabase();
final Database database = new Database(mockDatabase);
database.addListener(listener);
database.setHost("Fark 1");
assertEquals("changedHost;", listener.events);
assertEquals("Fark 1", database.getHost());
assertEquals("Fark 1", mockDatabase.getConfiguration().getHost());
mockDatabase.getConfiguration().setHost("Fark 2");
assertEquals("changedHost;changedHost;", listener.events);
assertEquals("Fark 2", database.getHost());
assertEquals("Fark 2", mockDatabase.getConfiguration().getHost());
database.removeListener(listener);
}
use of com.google.security.zynamics.binnavi.Database.MockClasses.MockDatabase in project binnavi by google.
the class DatabaseTest method testSetSavePassword.
@Test
public void testSetSavePassword() {
final MockDatabaseListener listener = new MockDatabaseListener();
final MockDatabase mockDatabase = new MockDatabase();
final Database database = new Database(mockDatabase);
database.addListener(listener);
database.setSavePassword(false);
assertEquals("changedSavePassword;", listener.events);
assertFalse(database.isSavePassword());
assertFalse(mockDatabase.getConfiguration().isSavePassword());
mockDatabase.getConfiguration().setSavePassword(true);
assertEquals("changedSavePassword;changedSavePassword;", listener.events);
assertTrue(database.isSavePassword());
assertTrue(mockDatabase.getConfiguration().isSavePassword());
database.removeListener(listener);
}
use of com.google.security.zynamics.binnavi.Database.MockClasses.MockDatabase 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.Database.MockClasses.MockDatabase 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);
}
Aggregations