Tidy up some exception class names

This commit is contained in:
dsyer
2008-03-01 11:59:33 +00:00
parent 90cb1e8ea3
commit b47a6e6405
51 changed files with 167 additions and 259 deletions

View File

@@ -17,7 +17,7 @@
package org.springframework.batch.sample;
import org.springframework.batch.core.domain.JobParameters;
import org.springframework.batch.io.exception.BatchCriticalException;
import org.springframework.batch.io.exception.InfrastructureException;
import org.springframework.jdbc.core.JdbcOperations;
/**
@@ -63,7 +63,7 @@ public class RestartFunctionalTests extends AbstractBatchLauncherTests {
runJob();
fail("First run of the job is expected to fail.");
}
catch (BatchCriticalException expected) {
catch (InfrastructureException expected) {
//expected
assertTrue("Not planned exception: "+expected.getMessage(), expected.getMessage().toLowerCase().indexOf("planned")>=0);
}

View File

@@ -161,7 +161,7 @@ public class JdbcJobRepositoryTests extends AbstractTransactionalDataSourceSprin
jobIds.add(execution.getJobId());
}
private JobExecution doConcurrentStart() throws InterruptedException, JobExecutionAlreadyRunningException {
private JobExecution doConcurrentStart() throws Exception {
new Thread(new Runnable() {
public void run() {
try {

View File

@@ -3,7 +3,7 @@ package org.springframework.batch.sample.item.writer;
import junit.framework.TestCase;
import org.easymock.MockControl;
import org.springframework.batch.io.exception.BatchCriticalException;
import org.springframework.batch.io.exception.InfrastructureException;
import org.springframework.batch.item.ItemWriter;
import org.springframework.batch.sample.domain.Order;
import org.springframework.batch.sample.item.writer.OrderWriter;
@@ -46,7 +46,7 @@ public class OrderWriterTests extends TestCase {
try {
processor.write(this);
fail("Batch critical exception was expected");
} catch (BatchCriticalException bce) {
} catch (InfrastructureException bce) {
assertTrue(true);
}
writerControl.verify();

View File

@@ -4,7 +4,7 @@ import java.util.ArrayList;
import junit.framework.TestCase;
import org.springframework.batch.io.exception.BatchCriticalException;
import org.springframework.batch.io.exception.InfrastructureException;
import org.springframework.batch.item.reader.ListItemReader;
import org.springframework.batch.repeat.context.RepeatContextSupport;
import org.springframework.batch.repeat.synch.RepeatSynchronizationManager;
@@ -40,7 +40,7 @@ public class ExceptionThrowingItemReaderProxyTests extends TestCase {
try {
itemReader.read();
assertTrue(i < ITER_COUNT);
} catch (BatchCriticalException bce) {
} catch (InfrastructureException bce) {
assertEquals(ITER_COUNT,i);
}
}

View File

@@ -22,7 +22,7 @@ import java.util.List;
import org.springframework.batch.core.domain.Job;
import org.springframework.batch.core.domain.JobExecution;
import org.springframework.batch.core.domain.Step;
import org.springframework.batch.io.exception.BatchCriticalException;
import org.springframework.batch.io.exception.InfrastructureException;
import org.springframework.beans.factory.BeanNameAware;
import org.springframework.util.ClassUtils;
@@ -136,7 +136,7 @@ public class JobSupport implements BeanNameAware, Job {
/* (non-Javadoc)
* @see org.springframework.batch.core.domain.Job#run(org.springframework.batch.core.domain.JobExecution)
*/
public void execute(JobExecution execution) throws BatchCriticalException {
public void execute(JobExecution execution) throws InfrastructureException {
throw new UnsupportedOperationException("JobSupport does not provide an implementation of run(). Use a smarter subclass.");
}

View File

@@ -18,7 +18,7 @@ package org.springframework.batch.sample.tasklet;
import org.springframework.batch.core.domain.JobInterruptedException;
import org.springframework.batch.core.domain.Step;
import org.springframework.batch.core.domain.StepExecution;
import org.springframework.batch.io.exception.BatchCriticalException;
import org.springframework.batch.io.exception.InfrastructureException;
import org.springframework.beans.factory.BeanNameAware;
/**
@@ -110,7 +110,7 @@ public class StepSupport implements Step, BeanNameAware {
*
* @see org.springframework.batch.core.domain.Step#execute(org.springframework.batch.core.domain.StepExecution)
*/
public void execute(StepExecution stepExecution) throws JobInterruptedException, BatchCriticalException {
public void execute(StepExecution stepExecution) throws JobInterruptedException, InfrastructureException {
throw new UnsupportedOperationException(
"Cannot process a StepExecution. Use a smarter subclass of StepSupport.");
}