use of org.pentaho.platform.plugin.services.pluginmgr.PluginResourceLoader in project data-access by pentaho.
the class SerializeMultiTableServiceIT method setUp.
@Before
public void setUp() throws Exception {
manager = new MockBackingRepositoryLifecycleManager(new MockSecurityHelper());
IAuthorizationPolicy mockAuthorizationPolicy = mock(IAuthorizationPolicy.class);
when(mockAuthorizationPolicy.isAllowed(anyString())).thenReturn(true);
IUserRoleListService mockUserRoleListService = mock(IUserRoleListService.class);
// $NON-NLS-1$ //$NON-NLS-2$
System.setProperty("org.osjava.sj.root", "target/test-classes/solution1/system/simple-jndi");
booter = new MicroPlatform("target/test-classes/solution1");
booter.define(ISolutionEngine.class, SolutionEngine.class, Scope.GLOBAL);
booter.define(IUnifiedRepository.class, TestFileSystemBackedUnifiedRepository.class, Scope.GLOBAL);
booter.define(IMondrianCatalogService.class, MondrianCatalogHelper.class, Scope.GLOBAL);
booter.define("connection-SQL", SQLConnection.class);
booter.define("connection-MDX", MDXConnection.class);
booter.define("connection-MDXOlap4j", MDXOlap4jConnection.class);
booter.define(IDBDatasourceService.class, JndiDatasourceService.class, Scope.GLOBAL);
booter.define(MDXConnection.MDX_CONNECTION_MAPPER_KEY, MondrianOneToOneUserRoleListMapper.class, Scope.GLOBAL);
booter.define(IDatasourceMgmtService.class, MockDatasourceMgmtService.class);
booter.define(IClientRepositoryPathsStrategy.class, MockClientRepositoryPathsStrategy.class);
booter.defineInstance(IMetadataDomainRepository.class, createMetadataDomainRepository());
booter.define(ISecurityHelper.class, MockSecurityHelper.class);
booter.define(UserDetailsService.class, MockUserDetailService.class);
booter.define("singleTenantAdminUserName", new String("admin"));
booter.defineInstance(IAuthorizationPolicy.class, mockAuthorizationPolicy);
booter.defineInstance(IPluginResourceLoader.class, new PluginResourceLoader() {
protected PluginClassLoader getOverrideClassloader() {
return new PluginClassLoader(new File(".", "target/test-classes/solution1/system/simple-jndi"), this);
}
});
booter.defineInstance(IUserRoleListService.class, mockUserRoleListService);
booter.setSettingsProvider(new SystemSettings());
booter.start();
PentahoSessionHolder.setStrategyName(PentahoSessionHolder.MODE_GLOBAL);
SecurityContextHolder.setStrategyName(SecurityContextHolder.MODE_GLOBAL);
}
use of org.pentaho.platform.plugin.services.pluginmgr.PluginResourceLoader in project data-access by pentaho.
the class SerializeServiceIT method setUp.
@Before
public void setUp() throws Exception {
manager = new MockBackingRepositoryLifecycleManager(new MockSecurityHelper());
// $NON-NLS-1$ //$NON-NLS-2$
System.setProperty("org.osjava.sj.root", "target/test-classes/solution1/system/simple-jndi");
booter = new MicroPlatform("target/test-classes/solution1");
IAuthorizationPolicy mockAuthorizationPolicy = mock(IAuthorizationPolicy.class);
when(mockAuthorizationPolicy.isAllowed(anyString())).thenReturn(true);
IUserRoleListService mockUserRoleListService = mock(IUserRoleListService.class);
booter.define(ISolutionEngine.class, SolutionEngine.class, Scope.GLOBAL);
booter.define(IUnifiedRepository.class, TestFileSystemBackedUnifiedRepository.class, Scope.GLOBAL);
booter.define(IMondrianCatalogService.class, MondrianCatalogHelper.class, Scope.GLOBAL);
booter.define("connection-SQL", SQLConnection.class);
booter.define("connection-MDX", MDXConnection.class);
booter.define("connection-MDXOlap4j", MDXOlap4jConnection.class);
booter.define(IDBDatasourceService.class, JndiDatasourceService.class, Scope.GLOBAL);
booter.define(MDXConnection.MDX_CONNECTION_MAPPER_KEY, MondrianOneToOneUserRoleListMapper.class, Scope.GLOBAL);
booter.define(IDatasourceMgmtService.class, MockDatasourceMgmtService.class);
booter.define(IClientRepositoryPathsStrategy.class, MockClientRepositoryPathsStrategy.class);
booter.defineInstance(IMetadataDomainRepository.class, createMetadataDomainRepository());
booter.define(ISecurityHelper.class, MockSecurityHelper.class);
booter.define(UserDetailsService.class, MockUserDetailService.class);
booter.define("singleTenantAdminUserName", new String("admin"));
booter.defineInstance(IAuthorizationPolicy.class, mockAuthorizationPolicy);
booter.defineInstance(IPluginResourceLoader.class, new PluginResourceLoader() {
protected PluginClassLoader getOverrideClassloader() {
return new PluginClassLoader(new File(".", "target/test-classes/solution1/system/simple-jndi"), this);
}
});
booter.defineInstance(IUserRoleListService.class, mockUserRoleListService);
booter.setSettingsProvider(new SystemSettings());
booter.start();
PentahoSessionHolder.setStrategyName(PentahoSessionHolder.MODE_GLOBAL);
SecurityContextHolder.setStrategyName(SecurityContextHolder.MODE_GLOBAL);
}
Aggregations