Search in sources :

Example 21 with BaseStepMeta

use of org.pentaho.di.trans.step.BaseStepMeta in project pentaho-metaverse by pentaho.

the class TransMetaJsonSerializerTest method testGetBaseStepMetaFromStepMetaNull.

@Test
public void testGetBaseStepMetaFromStepMetaNull() throws Exception {
    // BaseStepMeta should not be null, but its parent should be
    BaseStepMeta baseStepMeta = serializer.getBaseStepMetaFromStepMeta(null);
    assertNotNull(baseStepMeta);
    assertNull(baseStepMeta.getParentStepMeta());
}
Also used : BaseStepMeta(org.pentaho.di.trans.step.BaseStepMeta) Test(org.junit.Test)

Example 22 with BaseStepMeta

use of org.pentaho.di.trans.step.BaseStepMeta in project pentaho-metaverse by pentaho.

the class ExternalResourceStepAnalyzerTest method setUp.

@Before
public void setUp() throws Exception {
    analyzer = spy(new ExternalResourceStepAnalyzer<BaseStepMeta>() {

        @Override
        public Set<Class<? extends BaseStepMeta>> getSupportedSteps() {
            return null;
        }

        @Override
        protected Set<StepField> getUsedFields(BaseStepMeta meta) {
            Set<StepField> stepFields = new HashSet<>();
            stepFields.add(new StepField("prevStep", "filename"));
            return stepFields;
        }

        @Override
        public IMetaverseNode createResourceNode(IExternalResourceInfo resource) throws MetaverseException {
            return resourceNode;
        }

        @Override
        public String getResourceInputNodeType() {
            return "INPUT_TYPE";
        }

        @Override
        public String getResourceOutputNodeType() {
            return "OUTPUT_TYPE";
        }

        @Override
        public boolean isOutput() {
            return false;
        }

        @Override
        public boolean isInput() {
            return true;
        }
    });
    when(analyzer.getMetaverseBuilder()).thenReturn(builder);
    analyzer.descriptor = descriptor;
    analyzer.parentTransMeta = parentTransMeta;
    analyzer.parentStepMeta = parentStepMeta;
    analyzer.setMetaverseObjectFactory(new MetaverseObjectFactory());
}
Also used : IExternalResourceInfo(org.pentaho.metaverse.api.model.IExternalResourceInfo) MetaverseObjectFactory(org.pentaho.metaverse.api.MetaverseObjectFactory) StepField(org.pentaho.metaverse.api.StepField) BaseStepMeta(org.pentaho.di.trans.step.BaseStepMeta) HashSet(java.util.HashSet) Before(org.junit.Before)

Aggregations

BaseStepMeta (org.pentaho.di.trans.step.BaseStepMeta)22 Test (org.junit.Test)8 HashSet (java.util.HashSet)7 StepMeta (org.pentaho.di.trans.step.StepMeta)7 StepMetaInterface (org.pentaho.di.trans.step.StepMetaInterface)6 Before (org.junit.Before)4 ArrayList (java.util.ArrayList)3 KettleException (org.pentaho.di.core.exception.KettleException)3 TransMeta (org.pentaho.di.trans.TransMeta)3 StepInterface (org.pentaho.di.trans.step.StepInterface)3 MetaverseObjectFactory (org.pentaho.metaverse.api.MetaverseObjectFactory)3 StepField (org.pentaho.metaverse.api.StepField)3 IStepAnalyzer (org.pentaho.metaverse.api.analyzer.kettle.step.IStepAnalyzer)3 IStepExternalResourceConsumer (org.pentaho.metaverse.api.analyzer.kettle.step.IStepExternalResourceConsumer)3 IExternalResourceInfo (org.pentaho.metaverse.api.model.IExternalResourceInfo)3 Set (java.util.Set)2 RowMetaInterface (org.pentaho.di.core.row.RowMetaInterface)2 ObjectId (org.pentaho.di.repository.ObjectId)2 StringObjectId (org.pentaho.di.repository.StringObjectId)2 Trans (org.pentaho.di.trans.Trans)2