use of com.google.security.zynamics.binnavi.Gui.CodeBookmarks.CCodeBookmarkTableModel in project binnavi by google.
the class CCodeBookmarkTableModelTest method test5getValueAtFail.
@Test
public void test5getValueAtFail() {
final CCodeBookmarkManager bookmarkManager = new CCodeBookmarkManager();
final CCodeBookmarkTableModel tableModel = new CCodeBookmarkTableModel(bookmarkManager);
final CCodeBookmark bookmark = new CCodeBookmark(new MockModule(), new MockAddress(), "burzel");
bookmarkManager.addBookmark(bookmark);
try {
tableModel.getValueAt(0, 4);
fail();
} catch (final IllegalArgumentException e) {
}
}
use of com.google.security.zynamics.binnavi.Gui.CodeBookmarks.CCodeBookmarkTableModel in project binnavi by google.
the class CCodeBookmarkTableModelTest method test2setValueAtWorking.
@Test
public void test2setValueAtWorking() {
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("burzel", tableModel.getValueAt(0, 2));
tableModel.setValueAt("working", 0, 2);
assertEquals(1, tableModel.getRowCount());
assertEquals("working", tableModel.getValueAt(0, 2));
}
use of com.google.security.zynamics.binnavi.Gui.CodeBookmarks.CCodeBookmarkTableModel in project binnavi by google.
the class CCodeBookmarkTableModelTest method test8checkEditable.
@Test
public void test8checkEditable() {
final CCodeBookmarkManager bookmarkManager = new CCodeBookmarkManager();
final CCodeBookmarkTableModel tableModel = new CCodeBookmarkTableModel(bookmarkManager);
final CCodeBookmark bookmark = new CCodeBookmark(new MockModule(), new MockAddress(), "burzel");
bookmarkManager.addBookmark(bookmark);
assertFalse(tableModel.isCellEditable(0, 0));
assertFalse(tableModel.isCellEditable(0, 1));
assertTrue(tableModel.isCellEditable(0, 2));
}
use of com.google.security.zynamics.binnavi.Gui.CodeBookmarks.CCodeBookmarkTableModel 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.Gui.CodeBookmarks.CCodeBookmarkTableModel 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());
}
Aggregations