Search in sources :

Example 16 with INaviGroupNode

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);
}
Also used : INaviGroupNode(com.google.security.zynamics.binnavi.disassembly.INaviGroupNode) ExpensiveBaseTest(com.google.security.zynamics.binnavi.disassembly.types.ExpensiveBaseTest) Test(org.junit.Test)

Example 17 with INaviGroupNode

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);
}
Also used : INaviGroupNode(com.google.security.zynamics.binnavi.disassembly.INaviGroupNode) ExpensiveBaseTest(com.google.security.zynamics.binnavi.disassembly.types.ExpensiveBaseTest) Test(org.junit.Test)

Example 18 with INaviGroupNode

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);
}
Also used : INaviGroupNode(com.google.security.zynamics.binnavi.disassembly.INaviGroupNode) ExpensiveBaseTest(com.google.security.zynamics.binnavi.disassembly.types.ExpensiveBaseTest) Test(org.junit.Test)

Example 19 with INaviGroupNode

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);
}
Also used : INaviGroupNode(com.google.security.zynamics.binnavi.disassembly.INaviGroupNode) ExpensiveBaseTest(com.google.security.zynamics.binnavi.disassembly.types.ExpensiveBaseTest) Test(org.junit.Test)

Example 20 with INaviGroupNode

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());
}
Also used : CComment(com.google.security.zynamics.binnavi.Gui.GraphWindows.CommentDialogs.CComment) IComment(com.google.security.zynamics.binnavi.Gui.GraphWindows.CommentDialogs.Interfaces.IComment) IUser(com.google.security.zynamics.binnavi.Gui.Users.Interfaces.IUser) INaviGroupNode(com.google.security.zynamics.binnavi.disassembly.INaviGroupNode) UniqueTestUserGenerator(com.google.security.zynamics.binnavi.Database.PostgreSQL.UniqueTestUserGenerator) ExpensiveBaseTest(com.google.security.zynamics.binnavi.disassembly.types.ExpensiveBaseTest) Test(org.junit.Test)

Aggregations

INaviGroupNode (com.google.security.zynamics.binnavi.disassembly.INaviGroupNode)40 Test (org.junit.Test)23 IComment (com.google.security.zynamics.binnavi.Gui.GraphWindows.CommentDialogs.Interfaces.IComment)16 ExpensiveBaseTest (com.google.security.zynamics.binnavi.disassembly.types.ExpensiveBaseTest)15 INaviViewNode (com.google.security.zynamics.binnavi.disassembly.INaviViewNode)11 CComment (com.google.security.zynamics.binnavi.Gui.GraphWindows.CommentDialogs.CComment)9 IUser (com.google.security.zynamics.binnavi.Gui.Users.Interfaces.IUser)9 UniqueTestUserGenerator (com.google.security.zynamics.binnavi.Database.PostgreSQL.UniqueTestUserGenerator)8 INaviView (com.google.security.zynamics.binnavi.disassembly.views.INaviView)7 ArrayList (java.util.ArrayList)7 CGroupNode (com.google.security.zynamics.binnavi.disassembly.CGroupNode)6 MockModule (com.google.security.zynamics.binnavi.disassembly.Modules.MockModule)5 CTag (com.google.security.zynamics.binnavi.Tagging.CTag)4 INaviFunctionNode (com.google.security.zynamics.binnavi.disassembly.INaviFunctionNode)4 NaviNode (com.google.security.zynamics.binnavi.yfileswrap.zygraph.NaviNode)4 MockDatabase (com.google.security.zynamics.binnavi.Database.MockClasses.MockDatabase)3 MockSqlProvider (com.google.security.zynamics.binnavi.Database.MockClasses.MockSqlProvider)3 GroupNodeCommentNotificationContainer (com.google.security.zynamics.binnavi.Database.PostgreSQL.Notifications.containers.GroupNodeCommentNotificationContainer)3 MockTagManager (com.google.security.zynamics.binnavi.Tagging.MockTagManager)3 INaviCodeNode (com.google.security.zynamics.binnavi.disassembly.INaviCodeNode)3