Search in sources :

Example 26 with MetaverseComponentDescriptor

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

the class JobJobEntryAnalyzerTest method setUp.

@Before
public void setUp() throws Exception {
    when(metaverseBuilder.getMetaverseObjectFactory()).thenReturn(objectFactory);
    when(objectFactory.createNodeObject(anyString(), anyString(), anyString())).thenReturn(new MetaverseTransientNode("name"));
    when(jobEntryJob.getName()).thenReturn("job entry");
    when(jobEntryJob.getSpecificationMethod()).thenReturn(ObjectLocationSpecificationMethod.FILENAME);
    when(jobEntryJob.getFilename()).thenReturn(TEST_FILE_NAME);
    when(jobEntryJob.getParentJob()).thenReturn(mockParentJob);
    when(mockParentJob.getJobMeta()).thenReturn(mockParentJobMeta);
    when(namespace.getParentNamespace()).thenReturn(namespace);
    when(mockParentJobMeta.environmentSubstitute(anyString())).thenAnswer(new Answer<String>() {

        @Override
        public String answer(InvocationOnMock invocation) throws Throwable {
            return (String) invocation.getArguments()[0];
        }
    });
    descriptor = new MetaverseComponentDescriptor("job entry", DictionaryConst.NODE_TYPE_JOB_ENTRY, namespace);
    analyzer = new JobJobEntryAnalyzer();
    spyAnalyzer = spy(analyzer);
    spyAnalyzer.setMetaverseBuilder(metaverseBuilder);
    spyAnalyzer.setDescriptor(descriptor);
    doReturn(childJobMeta).when(spyAnalyzer).getSubJobMeta(anyString());
}
Also used : MetaverseTransientNode(org.pentaho.dictionary.MetaverseTransientNode) InvocationOnMock(org.mockito.invocation.InvocationOnMock) Matchers.anyString(org.mockito.Matchers.anyString) MetaverseComponentDescriptor(org.pentaho.metaverse.api.MetaverseComponentDescriptor) Before(org.junit.Before)

Example 27 with MetaverseComponentDescriptor

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

the class CsvFileInputStepAnalyzerTest method setUp.

@Before
public void setUp() throws Exception {
    when(mockNamespace.getParentNamespace()).thenReturn(mockNamespace);
    descriptor = new MetaverseComponentDescriptor("test", DictionaryConst.NODE_TYPE_TRANS_STEP, mockNamespace);
    analyzer = spy(new CsvFileInputStepAnalyzer());
    analyzer.setDescriptor(descriptor);
    analyzer.setObjectFactory(MetaverseTestUtils.getMetaverseObjectFactory());
}
Also used : MetaverseComponentDescriptor(org.pentaho.metaverse.api.MetaverseComponentDescriptor) Before(org.junit.Before)

Example 28 with MetaverseComponentDescriptor

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

the class ExcelInputStepAnalyzerTest method setUp.

@Before
public void setUp() throws Exception {
    when(mockNamespace.getParentNamespace()).thenReturn(mockNamespace);
    descriptor = new MetaverseComponentDescriptor("test", DictionaryConst.NODE_TYPE_TRANS_STEP, mockNamespace);
    analyzer = spy(new ExcelInputStepAnalyzer());
    analyzer.setDescriptor(descriptor);
    analyzer.setObjectFactory(MetaverseTestUtils.getMetaverseObjectFactory());
    consumer = new ExcelInputExternalResourceConsumer();
}
Also used : MetaverseComponentDescriptor(org.pentaho.metaverse.api.MetaverseComponentDescriptor) Before(org.junit.Before)

Example 29 with MetaverseComponentDescriptor

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

the class ExcelOutputStepAnalyzerTest method setUp.

@Before
public void setUp() throws Exception {
    when(mockNamespace.getParentNamespace()).thenReturn(mockNamespace);
    descriptor = new MetaverseComponentDescriptor("test", DictionaryConst.NODE_TYPE_TRANS_STEP, mockNamespace);
    analyzer = spy(new ExcelOutputStepAnalyzer());
    analyzer.setDescriptor(descriptor);
    analyzer.setObjectFactory(MetaverseTestUtils.getMetaverseObjectFactory());
    inputs = new StepNodes();
    inputs.addNode("previousStep", "first", node);
    inputs.addNode("previousStep", "last", node);
    inputs.addNode("previousStep", "age", node);
    inputs.addNode("previousStep", "filename", node);
    doReturn(inputs).when(analyzer).getInputs();
}
Also used : StepNodes(org.pentaho.metaverse.api.analyzer.kettle.step.StepNodes) MetaverseComponentDescriptor(org.pentaho.metaverse.api.MetaverseComponentDescriptor) Before(org.junit.Before)

Example 30 with MetaverseComponentDescriptor

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

the class HTTPClientStepAnalyzerTest method setUp.

@Before
public void setUp() throws Exception {
    analyzer = spy(new HTTPClientStepAnalyzer());
    descriptor = new MetaverseComponentDescriptor("test", DictionaryConst.NODE_TYPE_TRANS_STEP, mockNamespace);
    analyzer.setDescriptor(descriptor);
    analyzer.setObjectFactory(MetaverseTestUtils.getMetaverseObjectFactory());
    when(mockHTTP.getStepMetaInterface()).thenReturn(meta);
    when(mockHTTP.getStepMeta()).thenReturn(mockStepMeta);
    when(mockStepMeta.getStepMetaInterface()).thenReturn(meta);
}
Also used : MetaverseComponentDescriptor(org.pentaho.metaverse.api.MetaverseComponentDescriptor) Before(org.junit.Before)

Aggregations

MetaverseComponentDescriptor (org.pentaho.metaverse.api.MetaverseComponentDescriptor)36 Before (org.junit.Before)19 IMetaverseNode (org.pentaho.metaverse.api.IMetaverseNode)16 IComponentDescriptor (org.pentaho.metaverse.api.IComponentDescriptor)9 MetaverseAnalyzerException (org.pentaho.metaverse.api.MetaverseAnalyzerException)8 IMetaverseObjectFactory (org.pentaho.metaverse.api.IMetaverseObjectFactory)6 KettleException (org.pentaho.di.core.exception.KettleException)5 KettleXMLException (org.pentaho.di.core.exception.KettleXMLException)5 INamespace (org.pentaho.metaverse.api.INamespace)5 FileNotFoundException (java.io.FileNotFoundException)4 Matchers.anyString (org.mockito.Matchers.anyString)4 KettleMissingPluginsException (org.pentaho.di.core.exception.KettleMissingPluginsException)4 KettleStepException (org.pentaho.di.core.exception.KettleStepException)4 JobMeta (org.pentaho.di.job.JobMeta)4 Repository (org.pentaho.di.repository.Repository)4 RepositoryDirectoryInterface (org.pentaho.di.repository.RepositoryDirectoryInterface)4 Namespace (org.pentaho.metaverse.api.Namespace)4 TransMeta (org.pentaho.di.trans.TransMeta)3 BaseStepMeta (org.pentaho.di.trans.step.BaseStepMeta)3 StepMeta (org.pentaho.di.trans.step.StepMeta)3