use of com.google.security.zynamics.binnavi.Database.PostgreSQL.Notifications.containers.ViewNotificationContainer in project binnavi by google.
the class PostgreSQLViewNotificationParserTest method testModuleViewInform3.
@Test
public void testModuleViewInform3() throws CouldntLoadDataException {
final INaviModule module = new MockModule(provider);
final int currentUserViewSize = module.getContent().getViewContainer().getUserViews().size();
final ViewNotificationContainer container = new ViewNotificationContainer(view.getConfiguration().getId(), Optional.fromNullable(view), Optional.of(module.getConfiguration().getId()), Optional.of(module), Optional.<INaviProject>absent(), "INSERT");
final PostgreSQLViewNotificationParser parser = new PostgreSQLViewNotificationParser();
parser.inform(Lists.<ViewNotificationContainer>newArrayList(container), provider);
assertEquals(currentUserViewSize + 1, module.getContent().getViewContainer().getUserViews().size());
final ViewNotificationContainer container2 = new ViewNotificationContainer(view.getConfiguration().getId(), Optional.fromNullable(view), Optional.of(module.getConfiguration().getId()), Optional.of(module), Optional.<INaviProject>absent(), "DELETE");
parser.inform(Lists.<ViewNotificationContainer>newArrayList(container2), provider);
assertEquals(currentUserViewSize, module.getContent().getViewContainer().getUserViews().size());
}
use of com.google.security.zynamics.binnavi.Database.PostgreSQL.Notifications.containers.ViewNotificationContainer in project binnavi by google.
the class PostgreSQLViewNotificationParserTest method testViewInform0.
@Test
public void testViewInform0() throws CouldntLoadDataException {
final ViewNotificationContainer container = new ViewNotificationContainer(view.getConfiguration().getId(), Optional.fromNullable(view), Optional.<Integer>absent(), Optional.<INaviModule>absent(), Optional.<INaviProject>absent(), "INSERT");
final PostgreSQLViewNotificationParser parser = new PostgreSQLViewNotificationParser();
parser.inform(Lists.<ViewNotificationContainer>newArrayList(container), provider);
}
use of com.google.security.zynamics.binnavi.Database.PostgreSQL.Notifications.containers.ViewNotificationContainer in project binnavi by google.
the class PostgreSQLViewNotificationParserTest method testProjectViewInform2.
@Test(expected = IllegalArgumentException.class)
public void testProjectViewInform2() throws CouldntLoadDataException {
final INaviProject project = new MockProject(provider);
final ViewNotificationContainer container = new ViewNotificationContainer(view.getConfiguration().getId(), Optional.fromNullable(view), Optional.of(project.getConfiguration().getId()), Optional.<INaviModule>absent(), Optional.of(project), "DELETE");
final PostgreSQLViewNotificationParser parser = new PostgreSQLViewNotificationParser();
parser.inform(Lists.<ViewNotificationContainer>newArrayList(container), provider);
}
use of com.google.security.zynamics.binnavi.Database.PostgreSQL.Notifications.containers.ViewNotificationContainer in project binnavi by google.
the class PostgreSQLViewNotificationParserTest method testProjectViewInform1.
@Test
public void testProjectViewInform1() throws CouldntLoadDataException {
final INaviProject project = new MockProject(provider);
final ViewNotificationContainer container = new ViewNotificationContainer(view.getConfiguration().getId(), Optional.fromNullable(view), Optional.of(project.getConfiguration().getId()), Optional.<INaviModule>absent(), Optional.of(project), "UPDATE");
final PostgreSQLViewNotificationParser parser = new PostgreSQLViewNotificationParser();
parser.inform(Lists.<ViewNotificationContainer>newArrayList(container), provider);
}
use of com.google.security.zynamics.binnavi.Database.PostgreSQL.Notifications.containers.ViewNotificationContainer in project binnavi by google.
the class PostgreSQLViewNotificationParserTest method testViewInform1.
@Test
public void testViewInform1() throws CouldntLoadDataException {
final String description2 = "TEST DESCRIPTION STATE CHANGE";
view.getConfiguration().setDescriptionInternal(description2);
assertEquals(description2, view.getConfiguration().getDescription());
final ViewNotificationContainer container = new ViewNotificationContainer(view.getConfiguration().getId(), Optional.fromNullable(view), Optional.<Integer>absent(), Optional.<INaviModule>absent(), Optional.<INaviProject>absent(), "UPDATE");
final PostgreSQLViewNotificationParser parser = new PostgreSQLViewNotificationParser();
parser.inform(Lists.<ViewNotificationContainer>newArrayList(container), provider);
assertEquals("DB PROJECT VIEW DESCRIPTION", view.getConfiguration().getDescription());
}
Aggregations