Search in sources :

Example 1 with IServiceTypeManager

use of org.pentaho.platform.plugin.services.pluginmgr.servicemgr.IServiceTypeManager in project pentaho-platform by pentaho.

the class DefaultServiceManagerTest method init.

@Before
public void init() {
    serviceManager = new DefaultServiceManager();
    IServiceTypeManager gwtHandler = new GwtRpcServiceManager();
    serviceManager.setServiceTypeManagers(Arrays.asList(gwtHandler));
}
Also used : DefaultServiceManager(org.pentaho.platform.plugin.services.pluginmgr.servicemgr.DefaultServiceManager) IServiceTypeManager(org.pentaho.platform.plugin.services.pluginmgr.servicemgr.IServiceTypeManager) GwtRpcServiceManager(org.pentaho.platform.plugin.services.pluginmgr.servicemgr.GwtRpcServiceManager) Before(org.junit.Before)

Example 2 with IServiceTypeManager

use of org.pentaho.platform.plugin.services.pluginmgr.servicemgr.IServiceTypeManager in project pentaho-platform by pentaho.

the class AxisWebServiceManagerIT method init0.

/*
   * Wire up an in-memory platform to register and expose plug-in web services.
   */
@SuppressWarnings("deprecation")
@Before
public void init0() throws ServiceInitializationException {
    // set solution path to a place that hosts an axis config file
    microPlatform = new MicroPlatform(TestResourceLocation.TEST_RESOURCES + "/AxisWebServiceManagerTest/", "http://test/");
    assertNotNull(PentahoSystem.getObjectFactory());
    microPlatform.define(ISolutionEngine.class, SolutionEngine.class);
    assertNotNull(PentahoSystem.getObjectFactory());
    microPlatform.define(IPluginManager.class, DefaultPluginManager.class, Scope.GLOBAL);
    microPlatform.define(IServiceManager.class, DefaultServiceManager.class, Scope.GLOBAL);
    microPlatform.define(IPluginProvider.class, TstPluginProvider.class);
    microPlatform.define(IThemeManager.class, DefaultThemeManager.class);
    IServiceTypeManager axisManager = new AxisWebServiceManager();
    DefaultServiceManager sm = (DefaultServiceManager) PentahoSystem.get(IServiceManager.class);
    sm.setServiceTypeManagers(Arrays.asList(axisManager));
    microPlatform.init();
    new StandaloneSession();
    PentahoSystem.get(IPluginManager.class).reload(PentahoSessionHolder.getSession());
}
Also used : DefaultServiceManager(org.pentaho.platform.plugin.services.pluginmgr.servicemgr.DefaultServiceManager) IServiceTypeManager(org.pentaho.platform.plugin.services.pluginmgr.servicemgr.IServiceTypeManager) StandaloneSession(org.pentaho.platform.engine.core.system.StandaloneSession) MicroPlatform(org.pentaho.test.platform.engine.core.MicroPlatform) IPluginManager(org.pentaho.platform.api.engine.IPluginManager) AxisWebServiceManager(org.pentaho.platform.plugin.services.pluginmgr.servicemgr.AxisWebServiceManager) IServiceManager(org.pentaho.platform.api.engine.IServiceManager) Before(org.junit.Before)

Example 3 with IServiceTypeManager

use of org.pentaho.platform.plugin.services.pluginmgr.servicemgr.IServiceTypeManager in project pentaho-platform by pentaho.

the class DefaultPluginManagerIT method test14_webservice_registration.

@Test
public void test14_webservice_registration() throws PlatformInitializationException {
    microPlatform.define(IPluginProvider.class, Tst14PluginProvider.class);
    microPlatform.start();
    // register the gwt service handler
    IServiceTypeManager gwtHandler = new GwtRpcServiceManager();
    DefaultServiceManager sm = (DefaultServiceManager) PentahoSystem.get(IServiceManager.class);
    sm.setServiceTypeManagers(Arrays.asList(gwtHandler));
    PluginMessageLogger.clear();
    pluginManager.reload();
    // print messages before assert so we can see what went wrong if assert fails
    System.out.println(PluginMessageLogger.prettyPrint());
    assertEquals("Errors occurred during webservice registration (see log)", 0, PluginMessageLogger.count("PluginManager.ERR"));
    // at this point we know that no errors were logged, but we need to make sure the service was registered
    // with the service manager. We'll use a mock service manager to test this, since the default service manager
    // is a heavy Axis-backed impl, requiring an http server
    IServiceConfig config = gwtHandler.getServiceConfig("EchoServiceBean");
    assertNotNull("The GWT service manager should have a service registered by name 'EchoServiceBean'", config);
    assertEquals("gwt", config.getServiceType());
    assertEquals(EchoServiceBean.class, config.getServiceClass());
}
Also used : DefaultServiceManager(org.pentaho.platform.plugin.services.pluginmgr.servicemgr.DefaultServiceManager) IServiceTypeManager(org.pentaho.platform.plugin.services.pluginmgr.servicemgr.IServiceTypeManager) GwtRpcServiceManager(org.pentaho.platform.plugin.services.pluginmgr.servicemgr.GwtRpcServiceManager) IServiceManager(org.pentaho.platform.api.engine.IServiceManager) IServiceConfig(org.pentaho.platform.api.engine.IServiceConfig) Test(org.junit.Test)

Aggregations

DefaultServiceManager (org.pentaho.platform.plugin.services.pluginmgr.servicemgr.DefaultServiceManager)3 IServiceTypeManager (org.pentaho.platform.plugin.services.pluginmgr.servicemgr.IServiceTypeManager)3 Before (org.junit.Before)2 IServiceManager (org.pentaho.platform.api.engine.IServiceManager)2 GwtRpcServiceManager (org.pentaho.platform.plugin.services.pluginmgr.servicemgr.GwtRpcServiceManager)2 Test (org.junit.Test)1 IPluginManager (org.pentaho.platform.api.engine.IPluginManager)1 IServiceConfig (org.pentaho.platform.api.engine.IServiceConfig)1 StandaloneSession (org.pentaho.platform.engine.core.system.StandaloneSession)1 AxisWebServiceManager (org.pentaho.platform.plugin.services.pluginmgr.servicemgr.AxisWebServiceManager)1 MicroPlatform (org.pentaho.test.platform.engine.core.MicroPlatform)1