use of org.pentaho.commons.connection.IPentahoResultSet 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.commons.connection.IPentahoResultSet in project pentaho-platform by pentaho.
the class ResultSetCompareComponentTest method validation_fails_without_second_resultSets.
@Test
public void validation_fails_without_second_resultSets() {
IPentahoResultSet rs = Mockito.mock(IPentahoResultSet.class);
int actualValidateResult = callValidationWithResultSets(rs, null);
assertEquals(IRuntimeContext.RUNTIME_CONTEXT_VALIDATE_FAIL, actualValidateResult);
}
use of org.pentaho.commons.connection.IPentahoResultSet 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.commons.connection.IPentahoResultSet 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);
}
use of org.pentaho.commons.connection.IPentahoResultSet in project pentaho-platform by pentaho.
the class ResultSetCompareComponentTest method validation_fails_without_compareColumnNumber.
@Test
public void validation_fails_without_compareColumnNumber() {
ResultSetCompareComponent rscc = createResultSetCompareComponent();
IPentahoResultSet rs = Mockito.mock(IPentahoResultSet.class);
ResultSetCompareAction resultSetCompareAction = createResultSetCompareAction(rs, rs, null, false, true);
rscc.setActionDefinition(resultSetCompareAction);
int actualValidateResult = rscc.validate();
assertEquals(IRuntimeContext.RUNTIME_CONTEXT_VALIDATE_FAIL, actualValidateResult);
}
Aggregations