Search in sources :

Example 1 with SystemConfig

use of org.pentaho.platform.config.SystemConfig in project pentaho-platform by pentaho.

the class SystemResourceIT method setUp.

@Before
public void setUp() throws Exception {
    mp = new MicroPlatform();
    mp.defineInstance(IAuthorizationPolicy.class, new TestAuthorizationPolicy());
    mp.start();
    ISystemConfig systemConfig = new SystemConfig();
    IConfiguration securityConfig = mock(IConfiguration.class);
    Properties props = new Properties();
    props.setProperty("provider", "jackrabbit");
    when(securityConfig.getProperties()).thenReturn(props);
    when(securityConfig.getId()).thenReturn("security");
    systemConfig.registerConfiguration(securityConfig);
    systemResource = new SystemResource(systemConfig);
    // $NON-NLS-1$
    StandaloneApplicationContext applicationContext = new StandaloneApplicationContext(getSolutionPath(), "");
    ApplicationContext springApplicationContext = getSpringApplicationContext();
    IPentahoObjectFactory pentahoObjectFactory = new StandaloneSpringPentahoObjectFactory();
    pentahoObjectFactory.init(null, springApplicationContext);
    PentahoSystem.registerObjectFactory(pentahoObjectFactory);
    // force Spring to populate PentahoSystem
    boolean initOk = PentahoSystem.init(applicationContext);
/*
     * StandaloneSession session = new StandaloneSession();
     * 
     * StandaloneSpringPentahoObjectFactory factory = new StandaloneSpringPentahoObjectFactory( );
     * 
     * File f = new File(TestResourceLocation.TEST_RESOURCES + "/solution/system/pentahoObjects.spring.xml"); FileSystemResource fsr = new
     * FileSystemResource(f); GenericApplicationContext appCtx = new GenericApplicationContext();
     * XmlBeanDefinitionReader xmlReader = new XmlBeanDefinitionReader(appCtx); xmlReader.loadBeanDefinitions(fsr);
     * 
     * factory.init(TestResourceLocation.TEST_RESOURCES + "/solution/system/pentahoObjects.spring.xml", appCtx );
     */
}
Also used : ISystemConfig(org.pentaho.platform.api.engine.ISystemConfig) SystemConfig(org.pentaho.platform.config.SystemConfig) StandaloneApplicationContext(org.pentaho.platform.engine.core.system.StandaloneApplicationContext) ApplicationContext(org.springframework.context.ApplicationContext) GenericApplicationContext(org.springframework.context.support.GenericApplicationContext) IPentahoObjectFactory(org.pentaho.platform.api.engine.IPentahoObjectFactory) MicroPlatform(org.pentaho.test.platform.engine.core.MicroPlatform) ISystemConfig(org.pentaho.platform.api.engine.ISystemConfig) FileSystemResource(org.springframework.core.io.FileSystemResource) StandaloneApplicationContext(org.pentaho.platform.engine.core.system.StandaloneApplicationContext) IConfiguration(org.pentaho.platform.api.engine.IConfiguration) Properties(java.util.Properties) StandaloneSpringPentahoObjectFactory(org.pentaho.platform.engine.core.system.objfac.StandaloneSpringPentahoObjectFactory) Before(org.junit.Before)

Aggregations

Properties (java.util.Properties)1 Before (org.junit.Before)1 IConfiguration (org.pentaho.platform.api.engine.IConfiguration)1 IPentahoObjectFactory (org.pentaho.platform.api.engine.IPentahoObjectFactory)1 ISystemConfig (org.pentaho.platform.api.engine.ISystemConfig)1 SystemConfig (org.pentaho.platform.config.SystemConfig)1 StandaloneApplicationContext (org.pentaho.platform.engine.core.system.StandaloneApplicationContext)1 StandaloneSpringPentahoObjectFactory (org.pentaho.platform.engine.core.system.objfac.StandaloneSpringPentahoObjectFactory)1 MicroPlatform (org.pentaho.test.platform.engine.core.MicroPlatform)1 ApplicationContext (org.springframework.context.ApplicationContext)1 GenericApplicationContext (org.springframework.context.support.GenericApplicationContext)1 FileSystemResource (org.springframework.core.io.FileSystemResource)1