Search in sources :

Example 16 with StepIOMeta

use of org.pentaho.di.trans.step.StepIOMeta in project pentaho-kettle by pentaho.

the class StreamLookupTest method mockProcessRowMeta.

private StreamLookupMeta mockProcessRowMeta(boolean memoryPreservationActive) throws KettleStepException {
    StreamLookupMeta meta = smh.processRowsStepMetaInterface;
    StepMeta lookupStepMeta = when(mock(StepMeta.class).getName()).thenReturn("Lookup").getMock();
    doReturn(lookupStepMeta).when(smh.transMeta).findStep("Lookup");
    StepIOMeta stepIOMeta = new StepIOMeta(true, true, false, false, false, false);
    stepIOMeta.addStream(new Stream(StreamInterface.StreamType.INFO, lookupStepMeta, null, StreamIcon.INFO, null));
    doReturn(stepIOMeta).when(meta).getStepIOMeta();
    doReturn(new String[] { "Id" }).when(meta).getKeylookup();
    doReturn(new String[] { "Id" }).when(meta).getKeystream();
    doReturn(new String[] { "Value" }).when(meta).getValue();
    doReturn(memoryPreservationActive).when(meta).isMemoryPreservationActive();
    doReturn(false).when(meta).isUsingSortedList();
    doReturn(false).when(meta).isUsingIntegerPair();
    doReturn(new int[] { -1 }).when(meta).getValueDefaultType();
    doReturn(new String[] { "" }).when(meta).getValueDefault();
    doReturn(new String[] { "Value" }).when(meta).getValueName();
    doReturn(new String[] { "Value" }).when(meta).getValue();
    doCallRealMethod().when(meta).getFields(any(RowMetaInterface.class), anyString(), any(RowMetaInterface[].class), any(StepMeta.class), any(VariableSpace.class), any(Repository.class), any(IMetaStore.class));
    return meta;
}
Also used : Repository(org.pentaho.di.repository.Repository) StepIOMeta(org.pentaho.di.trans.step.StepIOMeta) VariableSpace(org.pentaho.di.core.variables.VariableSpace) Stream(org.pentaho.di.trans.step.errorhandling.Stream) RowMetaInterface(org.pentaho.di.core.row.RowMetaInterface) StepMeta(org.pentaho.di.trans.step.StepMeta) IMetaStore(org.pentaho.metastore.api.IMetaStore)

Aggregations

StepIOMeta (org.pentaho.di.trans.step.StepIOMeta)16 Stream (org.pentaho.di.trans.step.errorhandling.Stream)15 StreamInterface (org.pentaho.di.trans.step.errorhandling.StreamInterface)6 RowMetaInterface (org.pentaho.di.core.row.RowMetaInterface)2 VariableSpace (org.pentaho.di.core.variables.VariableSpace)2 Repository (org.pentaho.di.repository.Repository)2 StepMeta (org.pentaho.di.trans.step.StepMeta)2 IMetaStore (org.pentaho.metastore.api.IMetaStore)2 Test (org.junit.Test)1 InvocationOnMock (org.mockito.invocation.InvocationOnMock)1 RowMeta (org.pentaho.di.core.row.RowMeta)1 ValueMetaString (org.pentaho.di.core.row.value.ValueMetaString)1 StepIOMetaInterface (org.pentaho.di.trans.step.StepIOMetaInterface)1 StepMetaInterface (org.pentaho.di.trans.step.StepMetaInterface)1