Tidy up build problems overnight.
This commit is contained in:
@@ -19,7 +19,6 @@ package org.springframework.batch.sample;
|
||||
import org.springframework.batch.core.domain.Job;
|
||||
import org.springframework.batch.core.domain.JobInstanceProperties;
|
||||
import org.springframework.batch.execution.launch.JobLauncher;
|
||||
import org.springframework.batch.execution.runtime.DefaultJobIdentifier;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||
|
||||
@@ -47,12 +47,14 @@ public class FixedLengthImportJobFunctionalTests extends AbstractValidatingBatch
|
||||
}
|
||||
|
||||
/**
|
||||
* check that records have been correctly written to database
|
||||
* Check that records have been correctly written to database
|
||||
* @throws Exception
|
||||
*/
|
||||
protected void validatePostConditions() throws Exception {
|
||||
|
||||
inputSource.open();
|
||||
|
||||
System.err.println(jdbcTemplate.queryForList("SELECT ID, ISIN, QUANTITY, PRICE, CUSTOMER FROM trade ORDER BY id"));
|
||||
|
||||
jdbcTemplate.query("SELECT ID, ISIN, QUANTITY, PRICE, CUSTOMER FROM trade ORDER BY id", new RowCallbackHandler() {
|
||||
|
||||
@@ -72,6 +74,7 @@ public class FixedLengthImportJobFunctionalTests extends AbstractValidatingBatch
|
||||
|
||||
});
|
||||
|
||||
System.err.println(inputSource.read());
|
||||
assertNull(inputSource.read());
|
||||
}
|
||||
|
||||
|
||||
@@ -16,14 +16,9 @@
|
||||
|
||||
package org.springframework.batch.sample;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.batch.core.domain.BatchStatus;
|
||||
import org.springframework.batch.core.domain.JobExecution;
|
||||
import org.springframework.batch.core.domain.JobInstanceProperties;
|
||||
import org.springframework.batch.core.executor.StepInterruptedException;
|
||||
import org.springframework.batch.core.runtime.SimpleJobIdentifier;
|
||||
|
||||
/**
|
||||
* Functional test for graceful shutdown. A batch container is started in a new thread,
|
||||
@@ -39,54 +34,16 @@ public class GracefulShutdownFunctionalTest extends AbstractBatchLauncherTests {
|
||||
}
|
||||
|
||||
public void testLaunchJob() throws Exception {
|
||||
final List errors = new ArrayList();
|
||||
|
||||
final JobInstanceProperties jobInstanceProperties = new JobInstanceProperties();
|
||||
|
||||
|
||||
// Thread jobThread = new Thread(){
|
||||
// public void run(){
|
||||
// try {
|
||||
// launcher.run(getJob(), jobInstanceProperties);
|
||||
// }
|
||||
// catch (RuntimeException e) {
|
||||
// if (!(e.getCause() instanceof StepInterruptedException)) {
|
||||
// errors.add(e);
|
||||
// }
|
||||
// }
|
||||
// catch (Exception e) {
|
||||
// errors.add(e);
|
||||
// }
|
||||
// }
|
||||
// };
|
||||
//
|
||||
// jobThread.start();
|
||||
//
|
||||
// //give the thread a second to start up
|
||||
// Thread.sleep(200);
|
||||
//
|
||||
// assertTrue(launcher.isRunning());
|
||||
// assertTrue(jobThread.isAlive());
|
||||
//
|
||||
// //stop the job
|
||||
//
|
||||
// launcher.stop();
|
||||
//
|
||||
// //it takes a little while for it to shut down.
|
||||
// Thread.sleep(1000);
|
||||
//
|
||||
// assertFalse(launcher.isRunning());
|
||||
// assertFalse(jobThread.isAlive());
|
||||
//
|
||||
// if (!errors.isEmpty()) {
|
||||
// Exception e = (Exception) errors.get(0);
|
||||
// e.printStackTrace();
|
||||
// fail("Unexpected Exception: "+e);
|
||||
// }
|
||||
|
||||
JobExecution jobExecution = launcher.run(getJob(), jobInstanceProperties);
|
||||
|
||||
assertEquals(BatchStatus.STARTED, jobExecution.getExitStatus());
|
||||
|
||||
Thread.sleep(200);
|
||||
|
||||
assertEquals(BatchStatus.STARTED, jobExecution.getStatus());
|
||||
assertTrue(jobExecution.isRunning());
|
||||
|
||||
jobExecution.stop();
|
||||
|
||||
int count = 0;
|
||||
@@ -95,6 +52,7 @@ public class GracefulShutdownFunctionalTest extends AbstractBatchLauncherTests {
|
||||
}
|
||||
|
||||
assertFalse(jobExecution.isRunning());
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -17,8 +17,6 @@
|
||||
package org.springframework.batch.sample;
|
||||
|
||||
import org.springframework.batch.core.domain.JobInstanceProperties;
|
||||
import org.springframework.batch.core.runtime.SimpleJobIdentifier;
|
||||
import org.springframework.batch.io.exception.BatchCriticalException;
|
||||
import org.springframework.jdbc.core.JdbcOperations;
|
||||
|
||||
/**
|
||||
|
||||
@@ -22,8 +22,6 @@ import org.springframework.transaction.support.TransactionTemplate;
|
||||
|
||||
public class JdbcJobRepositoryTests extends AbstractTransactionalDataSourceSpringContextTests {
|
||||
|
||||
private ScheduledJobIdentifier jobIdentifier;
|
||||
|
||||
private JobRepository repository;
|
||||
|
||||
private Job jobConfiguration;
|
||||
@@ -43,7 +41,7 @@ public class JdbcJobRepositoryTests extends AbstractTransactionalDataSourceSprin
|
||||
}
|
||||
|
||||
protected void onSetUpInTransaction() throws Exception {
|
||||
jobIdentifier = new ScheduledJobIdentifier("Job1", "TestStream",
|
||||
new ScheduledJobIdentifier("Job1", "TestStream",
|
||||
new SimpleDateFormat("yyyyMMdd").parse("20070505"));
|
||||
jobConfiguration = new Job("test-job");
|
||||
jobConfiguration.setRestartable(true);
|
||||
|
||||
@@ -6,7 +6,6 @@ import org.springframework.batch.core.domain.JobInstance;
|
||||
import org.springframework.batch.core.domain.JobInstanceProperties;
|
||||
import org.springframework.batch.core.domain.StepExecution;
|
||||
import org.springframework.batch.core.domain.StepInstance;
|
||||
import org.springframework.batch.core.runtime.SimpleJobIdentifier;
|
||||
import org.springframework.batch.execution.scope.SimpleStepContext;
|
||||
import org.springframework.batch.execution.scope.StepSynchronizationManager;
|
||||
import org.springframework.test.AbstractTransactionalDataSourceSpringContextTests;
|
||||
|
||||
@@ -5,7 +5,6 @@ import org.springframework.batch.core.domain.JobInstance;
|
||||
import org.springframework.batch.core.domain.JobInstanceProperties;
|
||||
import org.springframework.batch.core.domain.StepExecution;
|
||||
import org.springframework.batch.core.domain.StepInstance;
|
||||
import org.springframework.batch.core.runtime.SimpleJobIdentifier;
|
||||
import org.springframework.batch.execution.scope.SimpleStepContext;
|
||||
import org.springframework.batch.execution.scope.StepSynchronizationManager;
|
||||
import org.springframework.batch.repeat.context.RepeatContextSupport;
|
||||
|
||||
Reference in New Issue
Block a user