use of com.google.security.zynamics.binnavi.Database.PostgreSQL.Notifications.interfaces.CommentNotification in project binnavi by google.
the class PostgreSQLNotificationParserTest method testFunctionCommentParsingDeleteComment.
@Test
public void testFunctionCommentParsingDeleteComment() {
new MockModule(provider, Lists.newArrayList(mockView), Lists.newArrayList(mockFunction));
MockPGNotification notification = new MockPGNotification("comment_changes", "bn_functions UPDATE 1 4608 null");
final CommentNotification result = PostgreSQLCommentNotificationParser.processFunctionCommentNotification(notification, provider);
assertNotNull(result);
final FunctionCommentNotificationContainer container = (FunctionCommentNotificationContainer) result;
final INaviFunction function = container.getFunction();
assertEquals(new CAddress(4608), function.getAddress());
assertEquals(CommentOperation.DELETE, container.getOperation());
assertNull(container.getCommentId());
}
use of com.google.security.zynamics.binnavi.Database.PostgreSQL.Notifications.interfaces.CommentNotification in project binnavi by google.
the class PostgreSQLNotificationParserTest method testLocalEdgeCommentParsingAppend.
@Test
public void testLocalEdgeCommentParsingAppend() {
new MockModule(provider, Lists.newArrayList(mockView), Lists.newArrayList(mockFunction));
MockPGNotification notification = new MockPGNotification("comment_changes", "bn_edges UPDATE 4444 3333");
final CommentNotification result = PostgreSQLCommentNotificationParser.processEdgeLocalCommentNotification(notification, provider);
assertNotNull(result);
final EdgeCommentNotificationContainer container = (EdgeCommentNotificationContainer) result;
final INaviEdge edge = container.getEdge();
assertEquals(4444, edge.getId());
assertEquals(CommentOperation.APPEND, container.getOperation());
assertEquals(new Integer(3333), container.getCommentId());
assertEquals(CommentScope.LOCAL, container.getScope());
}
use of com.google.security.zynamics.binnavi.Database.PostgreSQL.Notifications.interfaces.CommentNotification in project binnavi by google.
the class PostgreSQLNotificationParserTest method testFunctionNodeCommentParsingDeleteComment.
@Test
public void testFunctionNodeCommentParsingDeleteComment() {
new MockModule(provider, Lists.newArrayList(mockView), Lists.newArrayList(mockFunction));
MockPGNotification notification = new MockPGNotification("comment_changes", "bn_function_nodes UPDATE 1 6666 4608 null");
final CommentNotification result = PostgreSQLCommentNotificationParser.processFunctionNodeCommentNotification(notification, provider);
assertNotNull(result);
final FunctionNodeCommentNotificationContainer container = (FunctionNodeCommentNotificationContainer) result;
final INaviFunctionNode functionNode = container.getNode();
assertEquals(new CAddress(4608), functionNode.getAddress());
assertEquals(CommentOperation.DELETE, container.getOperation());
assertNull(container.getCommentId());
}
use of com.google.security.zynamics.binnavi.Database.PostgreSQL.Notifications.interfaces.CommentNotification in project binnavi by google.
the class PostgreSQLNotificationParserTest method testGlobalEdgeCommentParsingAppendFirstComment.
@Test
public void testGlobalEdgeCommentParsingAppendFirstComment() {
new MockModule(provider, Lists.newArrayList(mockView), Lists.newArrayList(mockFunction));
MockPGNotification notification = new MockPGNotification("comment_changes", "bn_global_edge_comments INSERT 1 1 4608 4614 3333");
final Collection<CommentNotification> result = PostgreSQLCommentNotificationParser.processEdgeGlobalCommentNotification(notification, provider);
assertEquals(1, result.size());
final EdgeCommentNotificationContainer container = (EdgeCommentNotificationContainer) Iterables.getFirst(result, null);
final INaviEdge edge = container.getEdge();
assertEquals(1111, edge.getId());
assertEquals(CommentOperation.APPEND, container.getOperation());
assertEquals(new Integer(3333), container.getCommentId());
assertEquals(CommentScope.GLOBAL, container.getScope());
}
use of com.google.security.zynamics.binnavi.Database.PostgreSQL.Notifications.interfaces.CommentNotification in project binnavi by google.
the class PostgreSQLNotificationParserTest method testFunctionCommentParsingAppendComment.
@Test
public void testFunctionCommentParsingAppendComment() {
new MockModule(provider, Lists.newArrayList(mockView), Lists.newArrayList(mockFunction));
MockPGNotification notification = new MockPGNotification("comment_changes", "bn_functions UPDATE 1 4608 3333");
final CommentNotification result = PostgreSQLCommentNotificationParser.processFunctionCommentNotification(notification, provider);
assertNotNull(result);
final FunctionCommentNotificationContainer container = (FunctionCommentNotificationContainer) result;
final INaviFunction function = container.getFunction();
assertEquals(new CAddress(4608), function.getAddress());
assertEquals(CommentOperation.APPEND, container.getOperation());
assertEquals(new Integer(3333), container.getCommentId());
}
Aggregations