use of org.pentaho.di.trans.step.StepErrorMeta in project pentaho-kettle by pentaho.
the class RepositoryTestBase method createStepMeta1.
protected StepMeta createStepMeta1(final TransMeta transMeta, final DatabaseMeta dbMeta, final Condition condition) throws Exception {
TransStepAttributeTesterTransStep step1 = new TransStepAttributeTesterTransStep();
step1.setDatabaseMeta(dbMeta);
step1.setCondition(condition);
StepMeta stepMeta1 = new StepMeta(EXP_TRANS_STEP_1_NAME, step1);
StepErrorMeta stepErrorMeta1 = new StepErrorMeta(transMeta, stepMeta1);
stepErrorMeta1.setEnabled(EXP_TRANS_STEP_ERROR_META_1_ENABLED);
stepErrorMeta1.setNrErrorsValuename(EXP_TRANS_STEP_ERROR_META_1_NR_ERRORS_VALUE_NAME);
stepErrorMeta1.setErrorDescriptionsValuename(EXP_TRANS_STEP_ERROR_META_1_DESC_VALUE_NAME);
stepErrorMeta1.setErrorFieldsValuename(EXP_TRANS_STEP_ERROR_META_1_FIELDS_VALUE_NAME);
stepErrorMeta1.setErrorCodesValuename(EXP_TRANS_STEP_ERROR_META_1_CODES_VALUE_NAME);
stepErrorMeta1.setMaxErrors(EXP_TRANS_STEP_ERROR_META_1_MAX_ERRORS);
stepErrorMeta1.setMaxPercentErrors(EXP_TRANS_STEP_ERROR_META_1_MAX_PERCENT_ERRORS);
stepErrorMeta1.setMinPercentRows(EXP_TRANS_STEP_ERROR_META_1_MIN_PERCENT_ROWS);
stepMeta1.setStepErrorMeta(stepErrorMeta1);
return stepMeta1;
}
use of org.pentaho.di.trans.step.StepErrorMeta in project pentaho-kettle by pentaho.
the class TransGraph method addErrorHop.
private void addErrorHop() {
//
if (candidate == null || candidate.getFromStep() == null) {
return;
}
StepErrorMeta errorMeta = candidate.getFromStep().getStepErrorMeta();
if (errorMeta == null) {
errorMeta = new StepErrorMeta(transMeta, candidate.getFromStep());
}
errorMeta.setEnabled(true);
errorMeta.setTargetStep(candidate.getToStep());
candidate.getFromStep().setStepErrorMeta(errorMeta);
}
use of org.pentaho.di.trans.step.StepErrorMeta in project pentaho-kettle by pentaho.
the class SpoonStepsDelegate method editStepErrorHandling.
public void editStepErrorHandling(TransMeta transMeta, StepMeta stepMeta) {
if (stepMeta != null && stepMeta.supportsErrorHandling()) {
StepErrorMeta stepErrorMeta = stepMeta.getStepErrorMeta();
if (stepErrorMeta == null) {
stepErrorMeta = new StepErrorMeta(transMeta, stepMeta);
}
List<StepMeta> targetSteps = transMeta.findNextSteps(stepMeta);
// now edit this stepErrorMeta object:
StepErrorMetaDialog dialog = new StepErrorMetaDialog(spoon.getShell(), stepErrorMeta, transMeta, targetSteps);
if (dialog.open()) {
stepMeta.setStepErrorMeta(stepErrorMeta);
stepMeta.setChanged();
spoon.refreshGraph();
}
}
}
use of org.pentaho.di.trans.step.StepErrorMeta in project pentaho-kettle by pentaho.
the class TransGraphTest method testEnableHopGetsSelected.
@Test
public void testEnableHopGetsSelected() {
TransGraph transGraph = mock(TransGraph.class);
doCallRealMethod().when(transGraph).setTransMeta(any(TransMeta.class));
doCallRealMethod().when(transGraph).setSpoon(any(Spoon.class));
transGraph.setTransMeta(new TransMeta());
transGraph.setSpoon(mock(Spoon.class));
StepMeta stepMeta = mock(StepMeta.class);
StepErrorMeta errorMeta = new StepErrorMeta(null, null);
TransHopMeta selectedHop = new TransHopMeta();
selectedHop.setErrorHop(true);
selectedHop.setEnabled(false);
selectedHop.setFromStep(stepMeta);
when(stepMeta.getStepErrorMeta()).thenReturn(errorMeta);
StepMeta toStep = new StepMeta();
toStep.setName("toStep");
selectedHop.setToStep(toStep);
when(transGraph.getCurrentHop()).thenReturn(selectedHop);
doCallRealMethod().when(transGraph).enableHop();
transGraph.enableHop();
Assert.assertTrue(errorMeta.isEnabled());
}
use of org.pentaho.di.trans.step.StepErrorMeta in project pentaho-kettle by pentaho.
the class TransGraphTest method testMouseUpHopGetsSelected.
@Test
public void testMouseUpHopGetsSelected() {
MouseEvent event = mock(MouseEvent.class);
int x = 0, y = 0;
TransGraph transGraph = mock(TransGraph.class);
StepMeta stepMeta = mock(StepMeta.class);
StepErrorMeta errorMeta = new StepErrorMeta(null, null);
TransHopMeta selectedHop = new TransHopMeta();
selectedHop.setErrorHop(true);
selectedHop.setEnabled(TRUE_RESULT);
selectedHop.setFromStep(stepMeta);
when(stepMeta.getStepErrorMeta()).thenReturn(errorMeta);
when(transGraph.findHop(x, y)).thenReturn(selectedHop);
when(transGraph.screen2real(any(Integer.class), any(Integer.class))).thenReturn(new Point(x, y));
doCallRealMethod().when(transGraph).mouseUp(event);
transGraph.mouseUp(event);
Assert.assertTrue(errorMeta.isEnabled());
}
Aggregations