use of org.pentaho.platform.repository2.unified.fs.FileSystemBackedUnifiedRepository in project pdi-platform-plugin by pentaho.
the class PdiContentGeneratorTest method setUp.
@Before
public void setUp() throws Exception {
// $NON-NLS-1$ //$NON-NLS-2$
System.setProperty("java.naming.factory.initial", "org.osjava.sj.SimpleContextFactory");
// $NON-NLS-1$ //$NON-NLS-2$
System.setProperty("org.osjava.sj.root", SOLUTION_REPOSITORY);
// $NON-NLS-1$ //$NON-NLS-2$
System.setProperty("org.osjava.sj.delimiter", "/");
// $NON-NLS-2$
System.setProperty("PENTAHO_SYS_CFG_PATH", new File(SOLUTION_REPOSITORY + "/pentaho.xml").getAbsolutePath());
IPentahoSession session = new StandaloneSession();
PentahoSessionHolder.setSession(session);
pdiContentGenerator = new PdiContentGenerator();
pdiAction = new PdiAction();
pdiAction.setRepositoryName(KettleFileRepositoryMeta.REPOSITORY_TYPE_ID);
pdiContentGenerator.setPdiAction(pdiAction);
outputStream = mock(OutputStream.class);
repositoryFile = mock(RepositoryFile.class);
pdiContentGenerator.setOutputStream(outputStream);
pdiContentGenerator.setRepositoryFile(repositoryFile);
scheduler = new QuartzScheduler();
scheduler.start();
mp.define(IUserRoleListService.class, StubUserRoleListService.class);
mp.define(UserDetailsService.class, StubUserDetailService.class);
mp.defineInstance(IAuthorizationPolicy.class, new TestAuthorizationPolicy());
mp.defineInstance(IScheduler.class, scheduler);
mp.define(ISolutionEngine.class, SolutionEngine.class);
FileSystemBackedUnifiedRepository repo = new FileSystemBackedUnifiedRepository(SOLUTION_REPOSITORY);
mp.defineInstance(IUnifiedRepository.class, repo);
mp.start();
}
use of org.pentaho.platform.repository2.unified.fs.FileSystemBackedUnifiedRepository in project pdi-platform-plugin by pentaho.
the class UserParametersTest method init.
@Before
public void init() throws PlatformInitializationException {
System.setProperty("java.naming.factory.initial", "org.osjava.sj.SimpleContextFactory");
System.setProperty("org.osjava.sj.root", "test-src/simple-jndi");
System.setProperty("org.osjava.sj.delimiter", "/");
System.setProperty("PENTAHO_SYS_CFG_PATH", new File(SOLUTION_REPOSITORY + "/pentaho.xml").getAbsolutePath());
IPentahoSession session = new StandaloneSession();
PentahoSessionHolder.setSession(session);
mp.define(IUserRoleListService.class, StubUserRoleListService.class);
mp.define(UserDetailsService.class, StubUserDetailService.class);
mp.defineInstance(IAuthorizationPolicy.class, new TestAuthorizationPolicy());
mp.setSettingsProvider(new PathBasedSystemSettings());
mp.define(ISolutionEngine.class, SolutionEngine.class);
FileSystemBackedUnifiedRepository repo = new FileSystemBackedUnifiedRepository(SOLUTION_REPOSITORY);
mp.defineInstance(IUnifiedRepository.class, repo);
mp.start();
SecurityHelper.getInstance().becomeUser(TEST_USER);
}
use of org.pentaho.platform.repository2.unified.fs.FileSystemBackedUnifiedRepository in project data-access by pentaho.
the class AnalysisServiceTest method initPlatform.
@BeforeClass
public static void initPlatform() throws Exception {
MicroPlatform platform = new MicroPlatform();
metadataRepository = mock(IMetadataDomainRepository.class);
platform.defineInstance(IMetadataDomainRepository.class, metadataRepository);
importer = mock(IPlatformImporter.class);
platform.defineInstance(IPlatformImporter.class, importer);
policy = mock(IAuthorizationPolicy.class);
platform.defineInstance(IAuthorizationPolicy.class, policy);
catalogService = mock(IAclAwareMondrianCatalogService.class);
platform.defineInstance(IMondrianCatalogService.class, catalogService);
permissionHandler = mock(IDataAccessPermissionHandler.class);
platform.defineInstance(IDataAccessPermissionHandler.class, permissionHandler);
final IUnifiedRepository unifiedRepository = new FileSystemBackedUnifiedRepository("target/test-classes/solution1");
platform.defineInstance(IUnifiedRepository.class, unifiedRepository);
platform.start();
acl.setOwner("owner");
acl.setOwnerType(RepositoryFileSid.Type.USER.ordinal());
}
use of org.pentaho.platform.repository2.unified.fs.FileSystemBackedUnifiedRepository in project data-access by pentaho.
the class SerializeMultiTableServiceIT method createMetadataDomainRepository.
public PentahoMetadataDomainRepository createMetadataDomainRepository() throws Exception {
IUnifiedRepository repository = new FileSystemBackedUnifiedRepository("target/test-classes/solution1");
booter.defineInstance(IUnifiedRepository.class, repository);
Assert.assertNotNull(new RepositoryUtils(repository).getFolder("/etc/metadata", true, true, null));
Assert.assertNotNull(new RepositoryUtils(repository).getFolder("/etc/mondrian", true, true, null));
Assert.assertNotNull(new RepositoryUtils(repository).getFolder("/savetest", true, true, null));
PentahoMetadataDomainRepository pentahoMetadataDomainRepository = new PentahoMetadataDomainRepository(repository);
return pentahoMetadataDomainRepository;
}
use of org.pentaho.platform.repository2.unified.fs.FileSystemBackedUnifiedRepository in project data-access by pentaho.
the class SerializeServiceIT method createMetadataDomainRepository.
public PentahoMetadataDomainRepository createMetadataDomainRepository() throws Exception {
IUnifiedRepository repository = new FileSystemBackedUnifiedRepository("target/test-classes/solution1");
booter.defineInstance(IUnifiedRepository.class, repository);
Assert.assertNotNull(new RepositoryUtils(repository).getFolder("/etc/metadata", true, true, null));
Assert.assertNotNull(new RepositoryUtils(repository).getFolder("/etc/mondrian", true, true, null));
Assert.assertNotNull(new RepositoryUtils(repository).getFolder("/savetest", true, true, null));
PentahoMetadataDomainRepository pentahoMetadataDomainRepository = new PentahoMetadataDomainRepository(repository);
return pentahoMetadataDomainRepository;
}
Aggregations