Search in sources :

Example 31 with MetaverseComponentDescriptor

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

the class HTTPPostStepAnalyzerTest method setUp.

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

Example 32 with MetaverseComponentDescriptor

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

the class MongoDbInputStepAnalyzerTest method setUp.

@Before
public void setUp() throws Exception {
    IMetaverseObjectFactory factory = MetaverseTestUtils.getMetaverseObjectFactory();
    when(mockBuilder.getMetaverseObjectFactory()).thenReturn(factory);
    analyzer = spy(new MongoDbInputStepAnalyzer());
    analyzer.setConnectionAnalyzer(mock(IConnectionAnalyzer.class));
    analyzer.setMetaverseBuilder(mockBuilder);
    analyzer.setBaseStepMeta(meta);
    analyzer.setRootNode(node);
    analyzer.setParentTransMeta(mockTransMeta);
    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(mockTransMeta);
    when(parentStepMeta.getName()).thenReturn("test");
    when(parentStepMeta.getStepID()).thenReturn("MongoDbInput");
}
Also used : IMetaverseObjectFactory(org.pentaho.metaverse.api.IMetaverseObjectFactory) IConnectionAnalyzer(org.pentaho.metaverse.api.IConnectionAnalyzer) MetaverseComponentDescriptor(org.pentaho.metaverse.api.MetaverseComponentDescriptor) Before(org.junit.Before)

Example 33 with MetaverseComponentDescriptor

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

the class RestClientStepAnalyzerTest method setUp.

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

Example 34 with MetaverseComponentDescriptor

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

the class StepAnalyzer method getPrevFieldDescriptor.

/**
 * Create a new IComponentDescriptor for a field input into this step
 *
 * @param prevStepName
 * @param fieldName
 * @return
 */
protected IComponentDescriptor getPrevFieldDescriptor(String prevStepName, String fieldName) {
    IComponentDescriptor prevFieldDescriptor = null;
    if (StringUtils.isNotEmpty(prevStepName)) {
        Object nsObj = rootNode.getProperty(DictionaryConst.PROPERTY_NAMESPACE);
        INamespace ns = new Namespace(nsObj != null ? nsObj.toString() : null);
        IMetaverseNode tmpOriginNode = getMetaverseObjectFactory().createNodeObject(ns, prevStepName, DictionaryConst.NODE_TYPE_TRANS_STEP);
        INamespace stepFieldNamespace = new Namespace(tmpOriginNode.getLogicalId());
        prevFieldDescriptor = new MetaverseComponentDescriptor(fieldName, getInputNodeType(), stepFieldNamespace, getDescriptor().getContext());
    }
    return prevFieldDescriptor;
}
Also used : IComponentDescriptor(org.pentaho.metaverse.api.IComponentDescriptor) INamespace(org.pentaho.metaverse.api.INamespace) IMetaverseNode(org.pentaho.metaverse.api.IMetaverseNode) INamespace(org.pentaho.metaverse.api.INamespace) Namespace(org.pentaho.metaverse.api.Namespace) MetaverseComponentDescriptor(org.pentaho.metaverse.api.MetaverseComponentDescriptor)

Example 35 with MetaverseComponentDescriptor

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

the class GetXMLDataStepAnalyzerTest 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 GetXMLDataStepAnalyzer());
    analyzer.setDescriptor(descriptor);
    analyzer.setObjectFactory(metaverseObjectFactory);
    analyzer.setRootNode(node);
    analyzer.setParentTransMeta(parentTransMeta);
    analyzer.setParentStepMeta(parentStepMeta);
}
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