Search in sources :

Example 11 with MetaverseComponentDescriptor

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

the class GenericJobEntryMetaAnalyzerTest method setUp.

@Before
public void setUp() throws Exception {
    when(metaverseBuilder.getMetaverseObjectFactory()).thenReturn(objectFactory);
    when(objectFactory.createNodeObject(anyString(), anyString(), anyString())).thenReturn(new MetaverseTransientNode("name"));
    when(mockJobEntry.getName()).thenReturn("job entry");
    when(mockJobEntry.getParentJob()).thenReturn(mockParentJob);
    when(mockParentJob.getJobMeta()).thenReturn(mockParentJobMeta);
    descriptor = new MetaverseComponentDescriptor("job entry", DictionaryConst.NODE_TYPE_JOB_ENTRY, namespace);
    analyzer.setMetaverseBuilder(metaverseBuilder);
}
Also used : MetaverseTransientNode(org.pentaho.dictionary.MetaverseTransientNode) MetaverseComponentDescriptor(org.pentaho.metaverse.api.MetaverseComponentDescriptor) Before(org.junit.Before)

Example 12 with MetaverseComponentDescriptor

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

the class TransJobEntryAnalyzerTest method setUp.

@Before
public void setUp() throws Exception {
    when(metaverseBuilder.getMetaverseObjectFactory()).thenReturn(objectFactory);
    when(objectFactory.createNodeObject(anyString(), anyString(), anyString())).thenReturn(new MetaverseTransientNode("name"));
    when(jobEntryTrans.getName()).thenReturn("job entry");
    when(jobEntryTrans.getSpecificationMethod()).thenReturn(ObjectLocationSpecificationMethod.FILENAME);
    when(jobEntryTrans.getFilename()).thenReturn(TEST_FILE_NAME);
    when(jobEntryTrans.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 TransJobEntryAnalyzer();
    spyAnalyzer = spy(analyzer);
    spyAnalyzer.setMetaverseBuilder(metaverseBuilder);
    spyAnalyzer.setDescriptor(descriptor);
    doReturn(childTransMeta).when(spyAnalyzer).getSubTransMeta(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 13 with MetaverseComponentDescriptor

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

the class FixedFileInputStepAnalyzerTest 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 FixedFileInputStepAnalyzer());
    analyzer.setDescriptor(descriptor);
    analyzer.setObjectFactory(MetaverseTestUtils.getMetaverseObjectFactory());
}
Also used : MetaverseComponentDescriptor(org.pentaho.metaverse.api.MetaverseComponentDescriptor) Before(org.junit.Before)

Example 14 with MetaverseComponentDescriptor

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

the class TableInputStepAnalyzerTest method setUp.

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

Example 15 with MetaverseComponentDescriptor

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

the class TableOutputStepAnalyzerTest method setUp.

@Before
public void setUp() throws Exception {
    IMetaverseObjectFactory factory = MetaverseTestUtils.getMetaverseObjectFactory();
    when(mockBuilder.getMetaverseObjectFactory()).thenReturn(factory);
    analyzer = spy(new TableOutputStepAnalyzer());
    analyzer.setConnectionAnalyzer(mock(IConnectionAnalyzer.class));
    analyzer.setMetaverseBuilder(mockBuilder);
    analyzer.setBaseStepMeta(meta);
    analyzer.setRootNode(node);
    analyzer.setParentTransMeta(parentTransMeta);
    analyzer.setParentStepMeta(parentStepMeta);
    when(mockNamespace.getParentNamespace()).thenReturn(mockNamespace);
    descriptor = new MetaverseComponentDescriptor("test", DictionaryConst.NODE_TYPE_TRANS_STEP, mockNamespace);
    analyzer.setDescriptor(descriptor);
    when(meta.getParentStepMeta()).thenReturn(parentStepMeta);
    when(parentStepMeta.getParentTransMeta()).thenReturn(parentTransMeta);
    when(parentStepMeta.getName()).thenReturn("test");
    when(parentStepMeta.getStepID()).thenReturn("TableOutputStep");
}
Also used : IMetaverseObjectFactory(org.pentaho.metaverse.api.IMetaverseObjectFactory) IConnectionAnalyzer(org.pentaho.metaverse.api.IConnectionAnalyzer) 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