Search in sources :

Example 1 with FileSystemBackedUnifiedRepository

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();
        }
    }
}
Also used : InputStream(java.io.InputStream) PentahoMetadataDomainRepository(org.pentaho.platform.plugin.services.metadata.PentahoMetadataDomainRepository) IOException(java.io.IOException) File(java.io.File) DomainStorageException(org.pentaho.metadata.repository.DomainStorageException) PlatformInitializationException(org.pentaho.platform.engine.core.system.boot.PlatformInitializationException) IOException(java.io.IOException) IUnifiedRepository(org.pentaho.platform.api.repository2.unified.IUnifiedRepository) FileSystemBackedUnifiedRepository(org.pentaho.platform.repository2.unified.fs.FileSystemBackedUnifiedRepository) Test(org.junit.Test)

Example 2 with FileSystemBackedUnifiedRepository

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();
}
Also used : StandaloneSession(org.pentaho.platform.engine.core.system.StandaloneSession) MicroPlatform(org.pentaho.test.platform.engine.core.MicroPlatform) File(java.io.File) DefaultPluginManager(org.pentaho.platform.plugin.services.pluginmgr.DefaultPluginManager) FileSystemBackedUnifiedRepository(org.pentaho.platform.repository2.unified.fs.FileSystemBackedUnifiedRepository) IUnifiedRepository(org.pentaho.platform.api.repository2.unified.IUnifiedRepository) Before(org.junit.Before)

Example 3 with FileSystemBackedUnifiedRepository

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"));
}
Also used : FileInputStream(java.io.FileInputStream) InputStream(java.io.InputStream) FileSystemBackedUnifiedRepository(org.pentaho.platform.repository2.unified.fs.FileSystemBackedUnifiedRepository) Test(org.junit.Test)

Example 4 with FileSystemBackedUnifiedRepository

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();
}
Also used : StandaloneSession(org.pentaho.platform.engine.core.system.StandaloneSession) MicroPlatform(org.pentaho.test.platform.engine.core.MicroPlatform) File(java.io.File) FileSystemBackedUnifiedRepository(org.pentaho.platform.repository2.unified.fs.FileSystemBackedUnifiedRepository) IUnifiedRepository(org.pentaho.platform.api.repository2.unified.IUnifiedRepository) Before(org.junit.Before)

Example 5 with FileSystemBackedUnifiedRepository

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);
}
Also used : StandaloneSession(org.pentaho.platform.engine.core.system.StandaloneSession) IPentahoSession(org.pentaho.platform.api.engine.IPentahoSession) QuartzScheduler(org.pentaho.platform.scheduler2.quartz.QuartzScheduler) File(java.io.File) PathBasedSystemSettings(org.pentaho.platform.engine.core.system.PathBasedSystemSettings) FileSystemBackedUnifiedRepository(org.pentaho.platform.repository2.unified.fs.FileSystemBackedUnifiedRepository) Before(org.junit.Before)

Aggregations

FileSystemBackedUnifiedRepository (org.pentaho.platform.repository2.unified.fs.FileSystemBackedUnifiedRepository)19 IUnifiedRepository (org.pentaho.platform.api.repository2.unified.IUnifiedRepository)12 File (java.io.File)11 Before (org.junit.Before)10 MicroPlatform (org.pentaho.test.platform.engine.core.MicroPlatform)8 StandaloneSession (org.pentaho.platform.engine.core.system.StandaloneSession)7 IPentahoSession (org.pentaho.platform.api.engine.IPentahoSession)5 RepositoryFile (org.pentaho.platform.api.repository2.unified.RepositoryFile)4 RepositoryUtils (org.pentaho.platform.repository2.unified.RepositoryUtils)4 InputStream (java.io.InputStream)3 Test (org.junit.Test)3 IMetadataDomainRepository (org.pentaho.metadata.repository.IMetadataDomainRepository)3 PentahoMetadataDomainRepository (org.pentaho.platform.plugin.services.metadata.PentahoMetadataDomainRepository)3 FileInputStream (java.io.FileInputStream)2 IOException (java.io.IOException)2 OutputStream (java.io.OutputStream)2 EnumSet (java.util.EnumSet)2 HashMap (java.util.HashMap)2 IAuthorizationPolicy (org.pentaho.platform.api.engine.IAuthorizationPolicy)2 IAclNodeHelper (org.pentaho.platform.api.repository2.unified.IAclNodeHelper)2