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 );
*/
}
Aggregations