use of com.google.security.zynamics.binnavi.models.Bookmarks.code.CCodeBookmarkManager in project binnavi by google.
the class CBookmarkFunctionsTest method test3DeleteBookmarksNoManager.
@Test
public void test3DeleteBookmarksNoManager() {
final CCodeBookmarkManager bookmarkManager = new CCodeBookmarkManager();
final MockAddress mockAddress = new MockAddress();
final MockModule mockModule = new MockModule();
CBookmarkFunctions.addBookmark(bookmarkManager, mockModule, mockAddress);
final int[] foo = { 0 };
try {
CBookmarkFunctions.deleteBookmarks(null, foo);
fail();
} catch (final NullPointerException e) {
}
}
use of com.google.security.zynamics.binnavi.models.Bookmarks.code.CCodeBookmarkManager in project binnavi by google.
the class CCodeBookmarkTableModelTest method test1Simple.
@Test
public void test1Simple() {
final CCodeBookmarkManager bookmarkManager = new CCodeBookmarkManager();
final CCodeBookmarkTableModel tableModel = new CCodeBookmarkTableModel(bookmarkManager);
assertEquals(3, tableModel.getColumnCount());
assertEquals(0, tableModel.getRowCount());
}
use of com.google.security.zynamics.binnavi.models.Bookmarks.code.CCodeBookmarkManager in project binnavi by google.
the class CCodeBookmarkTableModelTest method test9checkRemoveListeners.
@Test
public void test9checkRemoveListeners() throws IllegalArgumentException, SecurityException, IllegalAccessException, NoSuchFieldException {
final CCodeBookmarkManager bookmarkManager = new CCodeBookmarkManager();
final CCodeBookmarkTableModel tableModel = new CCodeBookmarkTableModel(bookmarkManager);
final LinkedHashSet<?> m_daListeners = (LinkedHashSet<?>) ReflectionHelpers.getField(ReflectionHelpers.getField(bookmarkManager, "m_listeners"), "m_listeners");
assertEquals(1, m_daListeners.size());
final CCodeBookmark bookmark = new CCodeBookmark(new MockModule(), new MockAddress(), "burzel");
bookmarkManager.addBookmark(bookmark);
final LinkedHashSet<?> m_bmListeners = (LinkedHashSet<?>) ReflectionHelpers.getField(ReflectionHelpers.getField(bookmark, "m_listeners"), "m_listeners");
assertEquals(1, m_bmListeners.size());
tableModel.dispose();
assertTrue(m_daListeners.isEmpty());
assertTrue(m_bmListeners.isEmpty());
}
use of com.google.security.zynamics.binnavi.models.Bookmarks.code.CCodeBookmarkManager in project binnavi by google.
the class CCodeBookmarkTableModelTest method test4getValueAtWorking.
@Test
public void test4getValueAtWorking() {
final CCodeBookmarkManager bookmarkManager = new CCodeBookmarkManager();
final CCodeBookmarkTableModel tableModel = new CCodeBookmarkTableModel(bookmarkManager);
final CCodeBookmark bookmark = new CCodeBookmark(new MockModule(), new MockAddress(), "burzel");
bookmarkManager.addBookmark(bookmark);
final MockAddress mock = new MockAddress();
assertEquals("burzel", tableModel.getValueAt(0, 2));
assertEquals(mock.toHexString(), tableModel.getValueAt(0, 1));
assertEquals("Mock Module", tableModel.getValueAt(0, 0));
}
use of com.google.security.zynamics.binnavi.models.Bookmarks.code.CCodeBookmarkManager in project binnavi by google.
the class CCodeBookmarkTableModelTest method test6getColumnName.
@Test
public void test6getColumnName() {
final CCodeBookmarkManager bookmarkManager = new CCodeBookmarkManager();
final CCodeBookmarkTableModel tableModel = new CCodeBookmarkTableModel(bookmarkManager);
final CCodeBookmark bookmark = new CCodeBookmark(new MockModule(), new MockAddress(), "burzel");
bookmarkManager.addBookmark(bookmark);
assertEquals("Module", tableModel.getColumnName(0));
assertEquals("Address", tableModel.getColumnName(1));
assertEquals("Description", tableModel.getColumnName(2));
}
Aggregations