use of org.pentaho.ui.xul.XulDomContainer in project pdi-dataservice-server-plugin by pentaho.
the class DataServiceDialogTest method testLoadXul.
@Test
public void testLoadXul() throws Exception {
Shell shell = mock(Shell.class);
XulLoader xulLoader = mock(XulLoader.class);
XulRunner xulRunner = mock(XulRunner.class);
XulDomContainer xulDomContainer = mock(XulDomContainer.class);
final ResourceBundle resourceBundle = mock(ResourceBundle.class);
DataServiceDialog dialog = new DataServiceDialog(controller, model) {
@Override
protected ResourceBundle createResourceBundle(Class<?> packageClass) {
assertThat(packageClass, equalTo((Class) DataServiceDialog.class));
assertThat(super.createResourceBundle(packageClass), isA(ResourceBundle.class));
return resourceBundle;
}
};
when(xulLoader.loadXul(anyString(), same(resourceBundle))).thenReturn(xulDomContainer);
dialog.loadXul(shell, xulLoader, xulRunner);
verify(xulLoader).setOuterContext(shell);
verify(xulLoader).registerClassLoader(any(ClassLoader.class));
verify(xulDomContainer).addEventHandler(controller);
verify(xulRunner).addContainer(xulDomContainer);
verify(xulRunner).initialize();
}
use of org.pentaho.ui.xul.XulDomContainer in project pdi-dataservice-server-plugin by pentaho.
the class DataServiceRemapConfirmationDialogTest method testInitXul.
@Test
public void testInitXul() throws KettleException, XulException {
Shell shell = mock(Shell.class);
XulLoader xulLoader = mock(XulLoader.class);
XulRunner xulRunner = mock(XulRunner.class);
XulDomContainer xulDomContainer = mock(XulDomContainer.class);
when(xulLoader.loadXul(anyString(), any(ResourceBundle.class))).thenReturn(xulDomContainer);
DataServiceRemapConfirmationDialog dialog = mock(DataServiceRemapConfirmationDialog.class);
when(dialog.initXul(shell, xulLoader, xulRunner)).thenCallRealMethod();
dialog.initXul(shell, xulLoader, xulRunner);
verify(xulLoader).setOuterContext(shell);
verify(xulLoader).registerClassLoader(any(ClassLoader.class));
verify(xulRunner).addContainer(xulDomContainer);
verify(xulRunner).initialize();
}
use of org.pentaho.ui.xul.XulDomContainer in project pdi-dataservice-server-plugin by pentaho.
the class DataServiceRemapStepChooserDialogTest method testInitXul.
@Test
public void testInitXul() throws KettleException, XulException {
Shell shell = mock(Shell.class);
XulLoader xulLoader = mock(XulLoader.class);
XulRunner xulRunner = mock(XulRunner.class);
XulDomContainer xulDomContainer = mock(XulDomContainer.class);
when(xulLoader.loadXul(anyString(), any(ResourceBundle.class))).thenReturn(xulDomContainer);
DataServiceRemapStepChooserDialog dialog = mock(DataServiceRemapStepChooserDialog.class);
when(dialog.initXul(shell, xulLoader, xulRunner)).thenCallRealMethod();
dialog.initXul(shell, xulLoader, xulRunner);
verify(xulLoader).setOuterContext(shell);
verify(xulLoader).registerClassLoader(any(ClassLoader.class));
verify(xulRunner).addContainer(xulDomContainer);
verify(xulRunner).initialize();
}
Aggregations