" RootPanel rootPanel = RootPanel.get();",
" }",
"}");
frame.refresh();
// add log listener for exception validation
ILog log = DesignerPlugin.getDefault().getLog();
ILogListener logListener = new ILogListener() {
public void logging(IStatus status, String plugin) {
assertEquals(IStatus.ERROR, status.getSeverity());
Throwable exception = status.getException();
assertThat(exception).isExactlyInstanceOf(IllegalStateException.class);
assertEquals("Bad getElement()", exception.getMessage());
}
};
// temporary intercept logging
try {
log.addLogListener(logListener);
DesignerPlugin.setDisplayExceptionOnConsole(false);
// prepare new component
WidgetInfo myButton = createWidget("test.client.MyButton");
// ask image
{
Image image = myButton.getImage();
assertNotNull(image);
assertThat(image.getBounds().width).isEqualTo(200);
assertThat(image.getBounds().height).isEqualTo(50);
}
} finally {
log.removeLogListener(logListener);
DesignerPlugin.setDisplayExceptionOnConsole(true);
}
// dispose
do_projectDispose();
}