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

@@ -1,36 +0,0 @@
/*
* Copyright 2006-2007 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.batch.io.exception;
import org.springframework.batch.io.exception.BatchCriticalException;
import org.springframework.batch.io.exception.BatchEnvironmentException;
public class BatchEnvironmentExceptionTests extends AbstractExceptionTests {
public Exception getException(String msg) throws Exception {
return new BatchEnvironmentException(msg);
}
public Exception getException(Throwable t) throws Exception {
return new BatchCriticalException(t);
}
public Exception getException(String msg, Throwable t) throws Exception {
return new BatchEnvironmentException(msg, t);
}
}

View File

@@ -16,20 +16,20 @@
package org.springframework.batch.io.exception;
import org.springframework.batch.io.exception.BatchConfigurationException;
import org.springframework.batch.io.exception.ConfigurationException;
public class BatchConfigurationExceptionTests extends AbstractExceptionTests {
public class ConfigurationExceptionTests extends AbstractExceptionTests {
public Exception getException(String msg) throws Exception {
return new BatchConfigurationException(msg);
return new ConfigurationException(msg);
}
public Exception getException(Throwable t) throws Exception {
return new BatchConfigurationException(t);
return new ConfigurationException(t);
}
public Exception getException(String msg, Throwable t) throws Exception {
return new BatchConfigurationException(msg, t);
return new ConfigurationException(msg, t);
}
}

View File

@@ -17,18 +17,18 @@
package org.springframework.batch.io.exception;
public class BatchCriticalExceptionTests extends AbstractExceptionTests {
public class InfrastructureExceptionTests extends AbstractExceptionTests {
public Exception getException(String msg) throws Exception {
return new BatchCriticalException(msg);
return new InfrastructureException(msg);
}
public Exception getException(Throwable t) throws Exception {
return new BatchCriticalException(t);
return new InfrastructureException(t);
}
public Exception getException(String msg, Throwable t) throws Exception {
return new BatchCriticalException(msg, t);
return new InfrastructureException(msg, t);
}
}

View File

@@ -21,7 +21,6 @@ import java.io.InputStream;
import junit.framework.TestCase;
import org.springframework.batch.io.exception.BatchEnvironmentException;
import org.springframework.batch.io.exception.FlatFileParsingException;
import org.springframework.batch.io.file.mapping.DefaultFieldSet;
import org.springframework.batch.io.file.mapping.FieldSet;
@@ -211,7 +210,7 @@ public class FlatFileItemReaderBasicTests extends TestCase {
itemReader.open(executionContext);
fail("Expected BatchEnvironmentException");
}
catch (BatchEnvironmentException e) {
catch (StreamException e) {
// expected
assertEquals("foo", e.getCause().getMessage());
}

View File

@@ -21,9 +21,9 @@ import java.io.InputStream;
import junit.framework.TestCase;
import org.springframework.batch.io.exception.BatchEnvironmentException;
import org.springframework.batch.io.file.separator.ResourceLineReader;
import org.springframework.batch.io.file.separator.SuffixRecordSeparatorPolicy;
import org.springframework.batch.item.exception.StreamException;
import org.springframework.core.io.ByteArrayResource;
import org.springframework.core.io.InputStreamResource;
import org.springframework.core.io.Resource;
@@ -43,7 +43,7 @@ public class ResourceLineReaderTests extends TestCase {
reader.read();
fail("Expected InputException");
}
catch (BatchEnvironmentException e) {
catch (StreamException e) {
// expected
assertTrue(e.getMessage().startsWith("Unable to read"));
}