Search in sources :

Example 1 with AbstractStepMeta

use of org.pentaho.di.core.util.AbstractStepMeta in project pentaho-kettle by pentaho.

the class MissingTransStepTest method testInit.

@Test
public void testInit() {
    StepMetaInterface stepMetaInterface = new AbstractStepMeta() {

        @Override
        public void setDefault() {
        }

        @Override
        public StepInterface getStep(StepMeta stepMeta, StepDataInterface stepDataInterface, int copyNr, TransMeta transMeta, Trans trans) {
            return null;
        }
    };
    StepMeta stepMeta = new StepMeta();
    stepMeta.setName("TestMetaStep");
    StepDataInterface stepDataInterface = mock(StepDataInterface.class);
    Trans trans = new Trans();
    LogChannel log = mock(LogChannel.class);
    doAnswer(new Answer<Void>() {

        public Void answer(InvocationOnMock invocation) {
            return null;
        }
    }).when(log).logError(anyString());
    trans.setLog(log);
    TransMeta transMeta = new TransMeta();
    transMeta.addStep(stepMeta);
    MissingTransStep step = createAndInitStep(stepMetaInterface, stepDataInterface);
    assertFalse(step.init(stepMetaInterface, stepDataInterface));
}
Also used : AbstractStepMeta(org.pentaho.di.core.util.AbstractStepMeta) InvocationOnMock(org.mockito.invocation.InvocationOnMock) StepMetaInterface(org.pentaho.di.trans.step.StepMetaInterface) TransMeta(org.pentaho.di.trans.TransMeta) LogChannel(org.pentaho.di.core.logging.LogChannel) StepMeta(org.pentaho.di.trans.step.StepMeta) AbstractStepMeta(org.pentaho.di.core.util.AbstractStepMeta) StepDataInterface(org.pentaho.di.trans.step.StepDataInterface) Trans(org.pentaho.di.trans.Trans) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 InvocationOnMock (org.mockito.invocation.InvocationOnMock)1 LogChannel (org.pentaho.di.core.logging.LogChannel)1 AbstractStepMeta (org.pentaho.di.core.util.AbstractStepMeta)1 Trans (org.pentaho.di.trans.Trans)1 TransMeta (org.pentaho.di.trans.TransMeta)1 StepDataInterface (org.pentaho.di.trans.step.StepDataInterface)1 StepMeta (org.pentaho.di.trans.step.StepMeta)1 StepMetaInterface (org.pentaho.di.trans.step.StepMetaInterface)1