use of com.google.security.zynamics.binnavi.Gui.CodeBookmarks.CCodeBookmarkTableModel 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.Gui.CodeBookmarks.CCodeBookmarkTableModel 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));
}
use of com.google.security.zynamics.binnavi.Gui.CodeBookmarks.CCodeBookmarkTableModel in project binnavi by google.
the class CCodeBookmarkTableModelTest method test3setValueAtFail.
@Test
public void test3setValueAtFail() {
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));
try {
tableModel.setValueAt("working", 0, 1);
fail();
} catch (final IllegalArgumentException e) {
}
}
use of com.google.security.zynamics.binnavi.Gui.CodeBookmarks.CCodeBookmarkTableModel in project binnavi by google.
the class CCodeBookmarkTableModelTest method test7removeBookmarkWorking.
@Test
public void test7removeBookmarkWorking() {
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));
bookmarkManager.removeBookmark(bookmark);
assertEquals(0, tableModel.getRowCount());
}
Aggregations