Application app = new Application(new DefaultApplicationLifecycleAdvisor());
app.setApplicationContext(applicationContext);
}
public void testMessageMonitor() {
DialogPage page = new TestDialogPage();
TestMessagable monitor = new TestMessagable();
DialogPageUtils.addMessageMonitor(page, monitor);
monitor.resetMessageCount();
page.setMessage(new DefaultMessage("a message"));
assertEquals("Message text not equal", monitor.getMessage().getMessage(), "a message");
page.setMessage(new DefaultMessage("another message"));
assertEquals("Message text not equal", monitor.getMessage().getMessage(), "another message");
assertEquals("Message count incorrect", 2, monitor.getMessageCount());
}