use of org.pentaho.platform.repository2.unified.fs.FileSystemBackedUnifiedRepository in project pentaho-platform by pentaho.
the class SolutionFolderIT method testNoLocaleFileDiscovery.
/**
* Tests MetadataDomainRepository.getLocalePropertyFilenames() where one xmi resource and no property file exists in
* the metadata folder.
*/
@Test
public void testNoLocaleFileDiscovery() {
PentahoMetadataDomainRepository domainRepository;
IUnifiedRepository repository = new FileSystemBackedUnifiedRepository();
repository = new FileSystemBackedUnifiedRepository(BI_DEVELOPERS_FULL_PATH);
domainRepository = new PentahoMetadataDomainRepository(repository);
File metadataXmiFile = null;
try {
metadataXmiFile = localeTestUtil.createFile(BI_DEVELOPERS_FULL_PATH, XMI_FILENAME_EXTENSION);
Map<String, InputStream> localizationFiles = domainRepository.getDomainFilesData("metadata");
assertEquals(0, localizationFiles.size());
} catch (IOException ioe) {
fail(ioe.getMessage());
} catch (Exception e) {
e.printStackTrace();
} finally {
if (metadataXmiFile != null) {
metadataXmiFile.delete();
}
}
}
use of org.pentaho.platform.repository2.unified.fs.FileSystemBackedUnifiedRepository in project pentaho-platform by pentaho.
the class DefaultPluginManagerIT method init0.
@Before
public void init0() {
PentahoSystem.clearObjectFactory();
microPlatform = new MicroPlatform(getSolutionPath());
microPlatform.define(ISolutionEngine.class, SolutionEngine.class);
microPlatform.define(IPluginProvider.class, SystemPathXmlPluginProvider.class);
microPlatform.define(IServiceManager.class, DefaultServiceManager.class, Scope.GLOBAL);
microPlatform.define(IUnifiedRepository.class, FileSystemBackedUnifiedRepository.class, Scope.GLOBAL);
FileSystemBackedUnifiedRepository repo = (FileSystemBackedUnifiedRepository) PentahoSystem.get(IUnifiedRepository.class);
repo.setRootDir(new File(getSolutionPath()));
session = new StandaloneSession();
pluginManager = new DefaultPluginManager();
}
use of org.pentaho.platform.repository2.unified.fs.FileSystemBackedUnifiedRepository in project pentaho-platform by pentaho.
the class MondrianCatalogRepositoryHelperIT method testSchemaFilesWithoutAnnotations.
@Test
public void testSchemaFilesWithoutAnnotations() throws Exception {
FileSystemBackedUnifiedRepository repository = new FileSystemBackedUnifiedRepository(TestResourceLocation.TEST_RESOURCES + "/MondrianCatalogRepositoryHelperTest");
MondrianCatalogRepositoryHelper helper = new MondrianCatalogRepositoryHelper(repository);
Map<String, InputStream> schemaFiles = helper.getModrianSchemaFiles("sample");
assertEquals(1, schemaFiles.size());
assertSchemaFile(TestResourceLocation.TEST_RESOURCES + "/MondrianCatalogRepositoryHelperTest/etc/mondrian/sample/schema.xml", schemaFiles.get("schema.xml"));
}
use of org.pentaho.platform.repository2.unified.fs.FileSystemBackedUnifiedRepository in project pentaho-platform by pentaho.
the class ChartbeansIT method init0.
@Before
public void init0() {
microPlatform = new MicroPlatform(TestResourceLocation.TEST_RESOURCES + "/solution/");
microPlatform.define(ISolutionEngine.class, SolutionEngine.class);
microPlatform.define(IChartBeansGenerator.class, DefaultChartBeansGenerator.class);
microPlatform.define(IUnifiedRepository.class, FileSystemBackedUnifiedRepository.class, Scope.GLOBAL);
FileSystemBackedUnifiedRepository repo = (FileSystemBackedUnifiedRepository) PentahoSystem.get(IUnifiedRepository.class);
repo.setRootDir(new File(TestResourceLocation.TEST_RESOURCES + "/solution"));
session = new StandaloneSession();
}
use of org.pentaho.platform.repository2.unified.fs.FileSystemBackedUnifiedRepository in project pdi-platform-plugin by pentaho.
the class PdiActionTest method init.
@Before
public void init() throws SchedulerException, PlatformInitializationException {
// $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);
scheduler = new QuartzScheduler();
scheduler.start();
mp.define(IUserRoleListService.class, StubUserRoleListService.class);
mp.define(UserDetailsService.class, StubUserDetailService.class);
mp.defineInstance(IAuthorizationPolicy.class, new TestAuthorizationPolicy());
mp.setSettingsProvider(new PathBasedSystemSettings());
mp.defineInstance(IScheduler.class, scheduler);
mp.define(ISolutionEngine.class, SolutionEngine.class);
FileSystemBackedUnifiedRepository repo = new FileSystemBackedUnifiedRepository(SOLUTION_REPOSITORY);
mp.defineInstance(IUnifiedRepository.class, repo);
mp.start();
SecurityHelper.getInstance().becomeUser(TEST_USER);
}
Aggregations