use of com.google.security.zynamics.binnavi.Database.PostgreSQL.Notifications.parsers.PostgreSQLViewNotificationParser 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());
}
use of com.google.security.zynamics.binnavi.Database.PostgreSQL.Notifications.parsers.PostgreSQLViewNotificationParser in project binnavi by google.
the class PostgreSQLViewNotificationParserTest method testViewInform4.
@Test
public void testViewInform4() throws CouldntLoadDataException {
final ViewNotificationContainer container = new ViewNotificationContainer(view.getConfiguration().getId(), Optional.fromNullable(view), Optional.<Integer>absent(), Optional.<INaviModule>absent(), Optional.<INaviProject>absent(), "DELETE");
final PostgreSQLViewNotificationParser parser = new PostgreSQLViewNotificationParser();
parser.inform(Lists.<ViewNotificationContainer>newArrayList(container), provider);
}
use of com.google.security.zynamics.binnavi.Database.PostgreSQL.Notifications.parsers.PostgreSQLViewNotificationParser in project binnavi by google.
the class PostgreSQLViewNotificationParserTest method testViewInform3.
@Test
public void testViewInform3() throws CouldntLoadDataException {
final boolean starState2 = true;
view.getConfiguration().setStaredInternal(starState2);
assertEquals(starState2, view.getConfiguration().isStared());
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(false, view.getConfiguration().isStared());
}
use of com.google.security.zynamics.binnavi.Database.PostgreSQL.Notifications.parsers.PostgreSQLViewNotificationParser in project binnavi by google.
the class PostgreSQLViewNotificationParserTest method testViewInform2.
@Test
public void testViewInform2() throws CouldntLoadDataException {
final String name2 = "TEST NAME STATE CHANGE";
view.getConfiguration().setNameInternal(name2);
assertEquals(name2, view.getConfiguration().getName());
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 NAME", view.getConfiguration().getName());
}
use of com.google.security.zynamics.binnavi.Database.PostgreSQL.Notifications.parsers.PostgreSQLViewNotificationParser in project binnavi by google.
the class PostgreSQLViewNotificationParserTest method testModuleViewInform0.
@Test
public void testModuleViewInform0() 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());
}
Aggregations