executeStatement(jdbcTemplate, jdbcStatement, variables, i); if (JdbcStatementStatus.ERROR.equals(jdbcStatement.getStatus()) && !Boolean.TRUE.equals(jdbcStatement.isContinueOnError()))
executeStatement(jdbcTemplate, jdbcStatement, variables, i); if (JdbcStatementStatus.ERROR.equals(jdbcStatement.getStatus()) && !Boolean.TRUE.equals(jdbcStatement.isContinueOnError()))
if (JdbcStatementStatus.ERROR.equals(jdbcStatement.getStatus()))
if (JdbcStatementStatus.ERROR.equals(jdbcStatement.getStatus()))
Assert.assertEquals("JDBC statement [0] status", JdbcStatementStatus.SUCCESS, actualJdbcStatement.getStatus()); Assert.assertEquals("JDBC statement [1] status", JdbcStatementStatus.ERROR, actualJdbcStatement.getStatus()); Assert.assertNull("JDBC statement [1] result is not null", actualJdbcStatement.getResult()); Assert.assertEquals("JDBC statement [1] error message", "java.sql.SQLException: test DataIntegrityViolationException cause", Assert.assertEquals("JDBC statement [2] status", JdbcStatementStatus.SKIPPED, actualJdbcStatement.getStatus()); Assert.assertNull("JDBC statement [2] result is not null", actualJdbcStatement.getResult());
Assert.assertEquals("JDBC statement [0] status", JdbcStatementStatus.SUCCESS, actualJdbcStatement.getStatus()); Assert.assertEquals("JDBC statement [1] status", JdbcStatementStatus.ERROR, actualJdbcStatement.getStatus()); Assert.assertNull("JDBC statement [1] result is not null", actualJdbcStatement.getResult()); Assert.assertEquals("JDBC statement [1] error message", "java.sql.SQLException: test DataIntegrityViolationException cause", Assert.assertEquals("JDBC statement [2] status", JdbcStatementStatus.SUCCESS, actualJdbcStatement.getStatus());
/** * Use case where a single successful statement is executed. */ @Test public void testExecuteJdbcStatementSuccess() { // Get test request JdbcExecutionRequest jdbcExecutionRequest = jdbcServiceTestHelper.createDefaultUpdateJdbcExecutionRequest(); // Execute JdbcExecutionResponse jdbcExecutionResponse = jdbcService.executeJdbc(jdbcExecutionRequest); // Assert results Assert.assertNull("JDBC connection is not null", jdbcExecutionResponse.getConnection()); Assert.assertEquals("JDBC statements size", jdbcExecutionRequest.getStatements().size(), jdbcExecutionResponse.getStatements().size()); { JdbcStatement expectedJdbcStatement = jdbcExecutionRequest.getStatements().get(0); JdbcStatement actualJdbcStatement = jdbcExecutionResponse.getStatements().get(0); Assert.assertEquals("JDBC statement [0] type", expectedJdbcStatement.getType(), actualJdbcStatement.getType()); Assert.assertEquals("JDBC statement [0] sql", expectedJdbcStatement.getSql(), actualJdbcStatement.getSql()); Assert.assertEquals("JDBC statement [0] status", JdbcStatementStatus.SUCCESS, actualJdbcStatement.getStatus()); Assert.assertEquals("JDBC statement [0] result", "1", actualJdbcStatement.getResult()); } }
theStatus = this.getStatus(); strategy.appendField(locator, this, "status", buffer, theStatus, (this.status!= null));
theStatus = this.getStatus(); strategy.appendField(locator, this, "status", buffer, theStatus, (this.status!= null));
theStatus = this.getStatus(); strategy.appendField(locator, this, "status", buffer, theStatus, (this.status!= null));
lhsStatus = this.getStatus(); JdbcStatementStatus rhsStatus; rhsStatus = that.getStatus(); if (!strategy.equals(LocatorUtils.property(thisLocator, "status", lhsStatus), LocatorUtils.property(thatLocator, "status", rhsStatus), lhsStatus, rhsStatus, (this.status!= null), (that.status!= null))) { return false;
lhsStatus = this.getStatus(); JdbcStatementStatus rhsStatus; rhsStatus = that.getStatus(); if (!strategy.equals(LocatorUtils.property(thisLocator, "status", lhsStatus), LocatorUtils.property(thatLocator, "status", rhsStatus), lhsStatus, rhsStatus, (this.status!= null), (that.status!= null))) { return false;
lhsStatus = this.getStatus(); JdbcStatementStatus rhsStatus; rhsStatus = that.getStatus(); if (!strategy.equals(LocatorUtils.property(thisLocator, "status", lhsStatus), LocatorUtils.property(thatLocator, "status", rhsStatus), lhsStatus, rhsStatus, (this.status!= null), (that.status!= null))) { return false;
/** * Test case where user specifies a QUERY statement type, but there are SQL errors. The status should be ERROR and no result set should exist in the * result. */ @Test public void testExecuteJdbcStatementTypeQueryError() { // Get test request JdbcExecutionRequest jdbcExecutionRequest = jdbcServiceTestHelper.createDefaultQueryJdbcExecutionRequest(); JdbcStatement expectedJdbcStatement = jdbcExecutionRequest.getStatements().get(0); expectedJdbcStatement.setSql(MockJdbcOperations.CASE_2_SQL); JdbcExecutionResponse jdbcExecutionResponse = jdbcService.executeJdbc(jdbcExecutionRequest); Assert.assertEquals("JDBC statements size", 1, jdbcExecutionResponse.getStatements().size()); JdbcStatement actualJdbcStatement = jdbcExecutionResponse.getStatements().get(0); Assert.assertNotNull("JDBC statement error message", actualJdbcStatement.getErrorMessage()); Assert.assertEquals("JDBC statement error message", "java.sql.SQLException: test DataIntegrityViolationException cause", actualJdbcStatement.getErrorMessage()); Assert.assertNull("JDBC statement result", actualJdbcStatement.getResult()); Assert.assertEquals("JDBC statement status", JdbcStatementStatus.ERROR, actualJdbcStatement.getStatus()); Assert.assertEquals("JDBC statement type", expectedJdbcStatement.getType(), actualJdbcStatement.getType()); Assert.assertNull("JDBC statement result set", actualJdbcStatement.getResultSet()); }
Assert.assertNull("JDBC statement result not is null", actualJdbcStatement.getResult()); Assert.assertEquals("JDBC statement SQL", expectedJdbcStatement.getSql(), actualJdbcStatement.getSql()); Assert.assertEquals("JDBC statement status", JdbcStatementStatus.SUCCESS, actualJdbcStatement.getStatus()); Assert.assertEquals("JDBC statement type", expectedJdbcStatement.getType(), actualJdbcStatement.getType()); Assert.assertNotNull("JDBC statement result set is null", actualJdbcStatement.getResultSet());
theStatus = this.getStatus(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "status", theStatus), currentHashCode, theStatus, (this.status!= null));
theStatus = this.getStatus(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "status", theStatus), currentHashCode, theStatus, (this.status!= null));
theStatus = this.getStatus(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "status", theStatus), currentHashCode, theStatus, (this.status!= null));
if (statusShouldBeCopiedAndSet == Boolean.TRUE) { JdbcStatementStatus sourceStatus; sourceStatus = this.getStatus(); JdbcStatementStatus copyStatus = ((JdbcStatementStatus) strategy.copy(LocatorUtils.property(locator, "status", sourceStatus), sourceStatus, (this.status!= null))); copy.setStatus(copyStatus);
if (statusShouldBeCopiedAndSet == Boolean.TRUE) { JdbcStatementStatus sourceStatus; sourceStatus = this.getStatus(); JdbcStatementStatus copyStatus = ((JdbcStatementStatus) strategy.copy(LocatorUtils.property(locator, "status", sourceStatus), sourceStatus, (this.status!= null))); copy.setStatus(copyStatus);