Search in sources :

Example 6 with XulRunner

use of org.pentaho.ui.xul.XulRunner 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();
}
Also used : Shell(org.eclipse.swt.widgets.Shell) KettleXulLoader(org.pentaho.di.ui.xul.KettleXulLoader) XulLoader(org.pentaho.ui.xul.XulLoader) ResourceBundle(java.util.ResourceBundle) XulDomContainer(org.pentaho.ui.xul.XulDomContainer) XulRunner(org.pentaho.ui.xul.XulRunner) SwtXulRunner(org.pentaho.ui.xul.swt.SwtXulRunner) Test(org.junit.Test)

Example 7 with XulRunner

use of org.pentaho.ui.xul.XulRunner 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();
}
Also used : Shell(org.eclipse.swt.widgets.Shell) XulLoader(org.pentaho.ui.xul.XulLoader) ResourceBundle(java.util.ResourceBundle) XulDomContainer(org.pentaho.ui.xul.XulDomContainer) XulRunner(org.pentaho.ui.xul.XulRunner) Test(org.junit.Test)

Example 8 with XulRunner

use of org.pentaho.ui.xul.XulRunner 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();
}
Also used : Shell(org.eclipse.swt.widgets.Shell) XulLoader(org.pentaho.ui.xul.XulLoader) ResourceBundle(java.util.ResourceBundle) XulDomContainer(org.pentaho.ui.xul.XulDomContainer) XulRunner(org.pentaho.ui.xul.XulRunner) Test(org.junit.Test)

Aggregations

XulRunner (org.pentaho.ui.xul.XulRunner)8 XulDomContainer (org.pentaho.ui.xul.XulDomContainer)7 ResourceBundle (java.util.ResourceBundle)5 Shell (org.eclipse.swt.widgets.Shell)5 Test (org.junit.Test)5 XulLoader (org.pentaho.ui.xul.XulLoader)4 SwtXulRunner (org.pentaho.ui.xul.swt.SwtXulRunner)4 KettleXulLoader (org.pentaho.di.ui.xul.KettleXulLoader)3 XulException (org.pentaho.ui.xul.XulException)2 SwtXulLoader (org.pentaho.ui.xul.swt.SwtXulLoader)2 DisposeEvent (org.eclipse.swt.events.DisposeEvent)1 DisposeListener (org.eclipse.swt.events.DisposeListener)1 KettleException (org.pentaho.di.core.exception.KettleException)1 PurRepositoryMeta (org.pentaho.di.repository.pur.PurRepositoryMeta)1 DriverDetailsDialogController (org.pentaho.di.trans.dataservice.ui.controller.DriverDetailsDialogController)1 Document (org.pentaho.ui.xul.dom.Document)1 AbstractXulLoader (org.pentaho.ui.xul.impl.AbstractXulLoader)1