OPEN - issue BATCH-339: ItemStream.mark() and reset() should throw a checked exception

http://jira.springframework.org/browse/BATCH-339

Missing classes
This commit is contained in:
dsyer
2008-02-08 13:59:25 +00:00
parent c43c1b4466
commit 1efb6fedc9
7 changed files with 214 additions and 6 deletions

View File

@@ -177,6 +177,14 @@ public class ResourceLineReaderTests extends TestCase {
assertEquals("1", line);
}
public void testMarkAfterClose() throws Exception {
Resource resource = new ByteArrayResource("1\n# 2\n3".getBytes());
ResourceLineReader reader = new ResourceLineReader(resource);
reader.read();
reader.close();
reader.mark();
}
public void testNonDefaultRecordSeparatorPolicy() throws Exception {
Resource resource = new ByteArrayResource("1\n\"4\n5\"; \n6".getBytes());
ResourceLineReader reader = new ResourceLineReader(resource);

View File

@@ -0,0 +1,36 @@
/*
* 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.item.exception;
import org.springframework.batch.io.exception.AbstractExceptionTests;
public class MarkFailedExceptionTests extends AbstractExceptionTests {
public Exception getException(String msg) throws Exception {
return new MarkFailedException(msg);
}
public Exception getException(Throwable t) throws Exception {
return new MarkFailedException(t);
}
public Exception getException(String msg, Throwable t) throws Exception {
return new MarkFailedException(msg, t);
}
}

View File

@@ -0,0 +1,36 @@
/*
* 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.item.exception;
import org.springframework.batch.io.exception.AbstractExceptionTests;
public class ResetFailedExceptionTests extends AbstractExceptionTests {
public Exception getException(String msg) throws Exception {
return new ResetFailedException(msg);
}
public Exception getException(Throwable t) throws Exception {
return new ResetFailedException(t);
}
public Exception getException(String msg, Throwable t) throws Exception {
return new ResetFailedException(msg, t);
}
}

View File

@@ -0,0 +1,36 @@
/*
* 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.item.exception;
import org.springframework.batch.io.exception.AbstractExceptionTests;
public class StreamExceptionTests extends AbstractExceptionTests {
public Exception getException(String msg) throws Exception {
return new StreamException(msg);
}
public Exception getException(Throwable t) throws Exception {
return new StreamException(t);
}
public Exception getException(String msg, Throwable t) throws Exception {
return new StreamException(msg, t);
}
}