Search in sources :

Example 1 with IDocumentLocatorProvider

use of org.pentaho.metaverse.api.IDocumentLocatorProvider in project pentaho-metaverse by pentaho.

the class IntegrationTestUtil method buildMetaverseGraph.

public static synchronized Graph buildMetaverseGraph(IDocumentLocatorProvider provider) throws Exception {
    IDocumentLocatorProvider documentLocatorProvider = provider;
    IMetaverseReader reader = PentahoSystem.get(IMetaverseReader.class);
    Set<IDocumentLocator> locators = documentLocatorProvider.getDocumentLocators();
    MetaverseCompletionService mcs = MetaverseCompletionService.getInstance();
    // Run a scan for each locator
    for (IDocumentLocator locator : locators) {
        locator.startScan();
    }
    mcs.waitTillEmpty();
    return reader.getMetaverse();
}
Also used : IMetaverseReader(org.pentaho.metaverse.api.IMetaverseReader) IDocumentLocatorProvider(org.pentaho.metaverse.api.IDocumentLocatorProvider) IDocumentLocator(org.pentaho.metaverse.api.IDocumentLocator) MetaverseCompletionService(org.pentaho.metaverse.impl.MetaverseCompletionService)

Example 2 with IDocumentLocatorProvider

use of org.pentaho.metaverse.api.IDocumentLocatorProvider in project pentaho-metaverse by pentaho.

the class MetaverseValidationIT method init.

@BeforeClass
public static void init() throws Exception {
    IntegrationTestUtil.initializePentahoSystem("src/it/resources/solution/system/pentahoObjects.spring.xml");
    // we only care about the demo folder
    FileSystemLocator fileSystemLocator = PentahoSystem.get(FileSystemLocator.class);
    IDocumentLocatorProvider provider = PentahoSystem.get(IDocumentLocatorProvider.class);
    // remove the original locator so we can set the modified one back on it
    provider.removeDocumentLocator(fileSystemLocator);
    fileSystemLocator.setRootFolder(ROOT_FOLDER);
    provider.addDocumentLocator(fileSystemLocator);
    MetaverseUtil.setDocumentController(PentahoSystem.get(IDocumentController.class));
    // build the graph using our updated locator/provider
    graph = IntegrationTestUtil.buildMetaverseGraph(provider);
    reader = PentahoSystem.get(IMetaverseReader.class);
    framedGraphFactory = new FramedGraphFactory(new GremlinGroovyModule());
    framedGraph = framedGraphFactory.create(graph);
    root = (RootNode) framedGraph.getVertex("entity", RootNode.class);
}
Also used : IMetaverseReader(org.pentaho.metaverse.api.IMetaverseReader) IDocumentLocatorProvider(org.pentaho.metaverse.api.IDocumentLocatorProvider) GremlinGroovyModule(com.tinkerpop.frames.modules.gremlingroovy.GremlinGroovyModule) IDocumentController(org.pentaho.metaverse.api.IDocumentController) FramedGraphFactory(com.tinkerpop.frames.FramedGraphFactory) FileSystemLocator(org.pentaho.metaverse.locator.FileSystemLocator) BeforeClass(org.junit.BeforeClass)

Example 3 with IDocumentLocatorProvider

use of org.pentaho.metaverse.api.IDocumentLocatorProvider in project pentaho-metaverse by pentaho.

the class MetaverseBuilderIT method init.

@BeforeClass
public static void init() throws Exception {
    cleanUpSampleData();
    IntegrationTestUtil.initializePentahoSystem(getSolutionPath());
    IDocumentLocatorProvider provider = PentahoSystem.get(IDocumentLocatorProvider.class);
    MetaverseUtil.setDocumentController(PentahoSystem.get(IDocumentController.class));
    // Uncomment below to run integration test against only the "demo" folder
    /*
    FileSystemLocator fileSystemLocator = PentahoSystem.get( FileSystemLocator.class );
    provider.removeDocumentLocator( fileSystemLocator );
    fileSystemLocator.setRootFolder( "src/it/resources/repo/demo" );
    provider.addDocumentLocator( fileSystemLocator );
    */
    reader = PentahoSystem.get(IMetaverseReader.class);
    readerGraph = IntegrationTestUtil.buildMetaverseGraph(provider);
}
Also used : IMetaverseReader(org.pentaho.metaverse.api.IMetaverseReader) IDocumentLocatorProvider(org.pentaho.metaverse.api.IDocumentLocatorProvider) IDocumentController(org.pentaho.metaverse.api.IDocumentController) BeforeClass(org.junit.BeforeClass)

Example 4 with IDocumentLocatorProvider

use of org.pentaho.metaverse.api.IDocumentLocatorProvider in project pentaho-metaverse by pentaho.

the class LineageClientIT method init.

@BeforeClass
public static void init() throws Exception {
    IntegrationTestUtil.initializePentahoSystem("src/it/resources/solution/system/pentahoObjects.spring.xml");
    // we only care about the demo folder
    FileSystemLocator fileSystemLocator = PentahoSystem.get(FileSystemLocator.class);
    IDocumentLocatorProvider provider = PentahoSystem.get(IDocumentLocatorProvider.class);
    // remove the original locator so we can set the modified one back on it
    provider.removeDocumentLocator(fileSystemLocator);
    fileSystemLocator.setRootFolder(ROOT_FOLDER);
    provider.addDocumentLocator(fileSystemLocator);
    docController = (DocumentController) PentahoSystem.get(IDocumentController.class);
    MetaverseUtil.setDocumentController(docController);
}
Also used : IDocumentLocatorProvider(org.pentaho.metaverse.api.IDocumentLocatorProvider) FileSystemLocator(org.pentaho.metaverse.locator.FileSystemLocator) BeforeClass(org.junit.BeforeClass)

Aggregations

IDocumentLocatorProvider (org.pentaho.metaverse.api.IDocumentLocatorProvider)4 BeforeClass (org.junit.BeforeClass)3 IMetaverseReader (org.pentaho.metaverse.api.IMetaverseReader)3 IDocumentController (org.pentaho.metaverse.api.IDocumentController)2 FileSystemLocator (org.pentaho.metaverse.locator.FileSystemLocator)2 FramedGraphFactory (com.tinkerpop.frames.FramedGraphFactory)1 GremlinGroovyModule (com.tinkerpop.frames.modules.gremlingroovy.GremlinGroovyModule)1 IDocumentLocator (org.pentaho.metaverse.api.IDocumentLocator)1 MetaverseCompletionService (org.pentaho.metaverse.impl.MetaverseCompletionService)1