use of org.pentaho.actionsequence.dom.actions.ResultSetCompareAction in project pentaho-platform by pentaho.
the class ResultSetCompareComponentTest method execute_fails_without_validation.
@Test
public void execute_fails_without_validation() {
ResultSetCompareComponent rscc = createResultSetCompareComponent();
IPentahoResultSet rs = Mockito.mock(IPentahoResultSet.class);
ResultSetCompareAction resultSetCompareAction = createResultSetCompareAction(rs, rs, 0, false, true);
rscc.setActionDefinition(resultSetCompareAction);
int actualExecuteResult = rscc.execute();
assertNotEquals(IRuntimeContext.RUNTIME_STATUS_SUCCESS, actualExecuteResult);
}
use of org.pentaho.actionsequence.dom.actions.ResultSetCompareAction in project pentaho-platform by pentaho.
the class ResultSetCompareComponentTest method execute_fails_when_resultSets_have_different_values_in_compareColumn.
@Test
public void execute_fails_when_resultSets_have_different_values_in_compareColumn() {
ResultSetCompareComponent rscc = createResultSetCompareComponent();
IPentahoResultSet rs1 = createResultSet(new String[][] { { FIRST_ROW }, { SECOND_ROW } });
IPentahoResultSet rs2 = createResultSet(new String[][] { { FIRST_ROW }, { "SECOND" } });
ResultSetCompareAction resultSetCompareAction = createResultSetCompareAction(rs1, rs2, 0, false, true);
rscc.setActionDefinition(resultSetCompareAction);
rscc.validate();
int actualExecuteResult = rscc.execute();
assertEquals(IRuntimeContext.RUNTIME_STATUS_FAILURE, actualExecuteResult);
}
use of org.pentaho.actionsequence.dom.actions.ResultSetCompareAction in project pentaho-platform by pentaho.
the class ResultSetCompareComponentTest method execute_fails_when_resultSets_have_different_number_of_columns.
@Test
public void execute_fails_when_resultSets_have_different_number_of_columns() {
ResultSetCompareComponent rscc = createResultSetCompareComponent();
IPentahoResultSet rs1 = createResultSet(1, 1, RESULT_SET_ELEMENT_VALUE);
IPentahoResultSet rs2 = createResultSet(2, 1, RESULT_SET_ELEMENT_VALUE);
ResultSetCompareAction resultSetCompareAction = createResultSetCompareAction(rs1, rs2, 0, false, true);
rscc.setActionDefinition(resultSetCompareAction);
rscc.validate();
int actualExecuteResult = rscc.execute();
assertEquals(IRuntimeContext.RUNTIME_STATUS_FAILURE, actualExecuteResult);
}
use of org.pentaho.actionsequence.dom.actions.ResultSetCompareAction in project pentaho-platform by pentaho.
the class ResultSetCompareComponentTest method execute_fails_when_resultSets_have_different_number_of_rows.
@Test
public void execute_fails_when_resultSets_have_different_number_of_rows() {
ResultSetCompareComponent rscc = createResultSetCompareComponent();
IPentahoResultSet rs1 = createResultSet(1, 1, RESULT_SET_ELEMENT_VALUE);
IPentahoResultSet rs2 = createResultSet(1, 2, RESULT_SET_ELEMENT_VALUE);
ResultSetCompareAction resultSetCompareAction = createResultSetCompareAction(rs1, rs2, 0, false, true);
rscc.setActionDefinition(resultSetCompareAction);
rscc.validate();
int actualExecuteResult = rscc.execute();
assertEquals(IRuntimeContext.RUNTIME_STATUS_FAILURE, actualExecuteResult);
}
use of org.pentaho.actionsequence.dom.actions.ResultSetCompareAction in project pentaho-platform by pentaho.
the class ResultSetCompareComponentTest method executeSuccessful.
@Test
public void executeSuccessful() {
ResultSetCompareComponent rscc = createResultSetCompareComponent();
IPentahoResultSet rs1 = createResultSet(new String[][] { { FIRST_ROW }, { SECOND_ROW } });
IPentahoResultSet rs2 = createResultSet(new String[][] { { FIRST_ROW }, { SECOND_ROW } });
ResultSetCompareAction resultSetCompareAction = createResultSetCompareAction(rs1, rs2, 0, false, true);
rscc.setActionDefinition(resultSetCompareAction);
rscc.validate();
int actualExecuteResult = rscc.execute();
assertEquals(IRuntimeContext.RUNTIME_STATUS_SUCCESS, actualExecuteResult);
}
Aggregations