use of com.google.security.zynamics.binnavi.disassembly.INaviGroupNode in project binnavi by google.
the class PostgreSQLGroupNodeCommentTests method appendGroupNodeComment2.
@Test(expected = NullPointerException.class)
public void appendGroupNodeComment2() throws CouldntLoadDataException, LoadCancelledException, MaybeNullException, CPartialLoadException, CouldntSaveDataException {
final INaviGroupNode groupNode = setupGroupNode();
getProvider().appendGroupNodeComment(groupNode, null, null);
}
use of com.google.security.zynamics.binnavi.disassembly.INaviGroupNode in project binnavi by google.
the class PostgreSQLGroupNodeCommentTests method editGroupNodeComment4.
@Test(expected = NullPointerException.class)
public void editGroupNodeComment4() throws CouldntSaveDataException, CouldntLoadDataException, LoadCancelledException, MaybeNullException, CPartialLoadException {
final INaviGroupNode groupNode = setupGroupNode();
getProvider().editGroupNodeComment(groupNode, 1, 1, null);
}
use of com.google.security.zynamics.binnavi.disassembly.INaviGroupNode in project binnavi by google.
the class PostgreSQLGroupNodeCommentTests method appendGroupNodeComment3.
@Test(expected = NullPointerException.class)
public void appendGroupNodeComment3() throws CouldntLoadDataException, LoadCancelledException, MaybeNullException, CPartialLoadException, CouldntSaveDataException {
final INaviGroupNode groupNode = setupGroupNode();
getProvider().appendGroupNodeComment(groupNode, " FAIL ", null);
}
use of com.google.security.zynamics.binnavi.disassembly.INaviGroupNode in project binnavi by google.
the class PostgreSQLGroupNodeCommentTests method deleteGroupNodeComment2.
@Test(expected = NullPointerException.class)
public void deleteGroupNodeComment2() throws CouldntDeleteException, CouldntLoadDataException, LoadCancelledException, MaybeNullException, CPartialLoadException, CouldntSaveDataException {
final INaviGroupNode groupNode = setupGroupNode();
getProvider().deleteGroupNodeComment(groupNode, null, null);
}
use of com.google.security.zynamics.binnavi.disassembly.INaviGroupNode in project binnavi by google.
the class PostgreSQLGroupNodeCommentTests method deleteGroupNodeComment4.
@Test
public void deleteGroupNodeComment4() throws CouldntLoadDataException, LoadCancelledException, MaybeNullException, CPartialLoadException, CouldntSaveDataException, CouldntDeleteException {
final INaviGroupNode groupNode = setupGroupNode();
final List<IComment> comments = groupNode.getComments() == null ? new ArrayList<IComment>() : groupNode.getComments();
final IComment lastComment = comments.size() == 0 ? null : Iterables.getLast(comments);
final String commentString = " TEST DELETE GROUP NODE COMMENT ";
final IUser user = new UniqueTestUserGenerator(getProvider()).nextActiveUser();
final int commentId = getProvider().appendGroupNodeComment(groupNode, commentString, user.getUserId());
final IComment newComment = new CComment(commentId, user, lastComment, commentString);
final ArrayList<IComment> storedComments = getProvider().loadCommentById(commentId);
assertNotNull(storedComments);
assertEquals(comments.size() + 1, storedComments.size());
assertEquals(newComment, Iterables.getLast(storedComments));
getProvider().deleteGroupNodeComment(groupNode, commentId, user.getUserId());
final ArrayList<IComment> commentsAfterDelete = getProvider().loadCommentById(commentId);
assertNotNull(commentsAfterDelete);
assertTrue(commentsAfterDelete.isEmpty());
}
Aggregations