Remove test data before launch

This commit is contained in:
dsyer
2008-11-15 09:22:14 +00:00
parent 2b7f14b1f8
commit 501c6d053d
2 changed files with 9 additions and 1 deletions

View File

@@ -32,7 +32,7 @@ public class FootballJobFunctionalTests extends AbstractValidatingBatchLauncherT
@Override
protected void validatePostConditions() throws Exception {
int count = simpleJdbcTemplate.queryForInt("SELECT COUNT(*) from PLAYER_SUMMARY");
assertTrue(count>0);
assertTrue(count > 0);
}
}

View File

@@ -8,6 +8,7 @@ import java.util.Map;
import javax.sql.DataSource;
import org.junit.Before;
import org.junit.Test;
import org.springframework.batch.core.BatchStatus;
import org.springframework.batch.core.JobParameter;
@@ -21,6 +22,13 @@ public abstract class NonSequentialJobFunctionalTestsBase extends AbstractJobTes
private SimpleJdbcTemplate simpleJdbcTemplate;
@Before
protected void removeOldData() throws Exception {
simpleJdbcTemplate.update("DELETE FROM PLAYERS");
simpleJdbcTemplate.update("DELETE FROM GAMES");
simpleJdbcTemplate.update("DELETE FROM PLAYER_SUMMARY");
}
/**
* This test processes a file that contains bad records. Those records will
* skip. The step execution listener will detect that skips have occurred,