Search in sources :

Example 1 with ValidatorData

use of org.pentaho.di.trans.steps.validator.ValidatorData in project pentaho-kettle by pentaho.

the class MappingInputTest method testSetConnectorSteps.

@Test
public void testSetConnectorSteps() throws Exception {
    when(stepMockHelper.transMeta.getSizeRowset()).thenReturn(1);
    MappingInputData mappingInputData = new MappingInputData();
    MappingInput mappingInput = new MappingInput(stepMockHelper.stepMeta, mappingInputData, 0, stepMockHelper.transMeta, stepMockHelper.trans);
    mappingInput.init(stepMockHelper.initStepMetaInterface, mappingInputData);
    ValidatorData validatorData = new ValidatorData();
    Validator previousStep = new Validator(stepMockHelper.stepMeta, validatorData, 0, stepMockHelper.transMeta, stepMockHelper.trans);
    when(stepMockHelper.stepMeta.isDoingErrorHandling()).thenReturn(true);
    StepErrorMeta stepErrorMeta = mock(StepErrorMeta.class);
    when(stepErrorMeta.getTargetStep()).thenReturn(stepMockHelper.stepMeta);
    when(stepMockHelper.stepMeta.getName()).thenReturn(stepName);
    when(stepMockHelper.stepMeta.getStepErrorMeta()).thenReturn(stepErrorMeta);
    StepInterface[] si = new StepInterface[] { previousStep };
    mappingInput.setConnectorSteps(si, Collections.<MappingValueRename>emptyList(), stepName);
    assertEquals(previousStep.getOutputRowSets().size(), 0);
}
Also used : StepInterface(org.pentaho.di.trans.step.StepInterface) ValidatorData(org.pentaho.di.trans.steps.validator.ValidatorData) StepErrorMeta(org.pentaho.di.trans.step.StepErrorMeta) Validator(org.pentaho.di.trans.steps.validator.Validator) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 StepErrorMeta (org.pentaho.di.trans.step.StepErrorMeta)1 StepInterface (org.pentaho.di.trans.step.StepInterface)1 Validator (org.pentaho.di.trans.steps.validator.Validator)1 ValidatorData (org.pentaho.di.trans.steps.validator.ValidatorData)1