BATCH-818: Common* tests have to be Abstract*
This commit is contained in:
@@ -11,7 +11,7 @@ import org.springframework.batch.item.sample.Foo;
|
||||
* Common tests for {@link ItemReader} implementations. Expected input is five
|
||||
* {@link Foo} objects with values 1 to 5.
|
||||
*/
|
||||
public abstract class CommonItemReaderTests {
|
||||
public abstract class AbstractItemReaderTests {
|
||||
|
||||
protected ItemReader<Foo> tested;
|
||||
|
||||
@@ -12,7 +12,7 @@ import org.junit.Test;
|
||||
* {@link ItemStream}. Expected input is five {@link Foo} objects with values 1
|
||||
* to 5.
|
||||
*/
|
||||
public abstract class CommonItemStreamItemReaderTests extends CommonItemReaderTests {
|
||||
public abstract class AbstractItemStreamItemReaderTests extends AbstractItemReaderTests {
|
||||
|
||||
protected ExecutionContext executionContext = new ExecutionContext();
|
||||
|
||||
@@ -2,12 +2,12 @@ package org.springframework.batch.item.database;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
|
||||
import org.springframework.batch.item.CommonItemStreamItemReaderTests;
|
||||
import org.springframework.batch.item.AbstractItemStreamItemReaderTests;
|
||||
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||
import org.junit.Before;
|
||||
import org.junit.After;
|
||||
|
||||
public abstract class CommonDatabaseItemStreamItemReaderTests extends CommonItemStreamItemReaderTests {
|
||||
public abstract class AbstractDatabaseItemStreamItemReaderTests extends AbstractItemStreamItemReaderTests {
|
||||
|
||||
private ClassPathXmlApplicationContext ctx;
|
||||
|
||||
@@ -11,7 +11,7 @@ import org.junit.runner.RunWith;
|
||||
import org.junit.internal.runners.JUnit4ClassRunner;
|
||||
|
||||
@RunWith(JUnit4ClassRunner.class)
|
||||
public class HibernateCursorItemReaderCommonTests extends CommonDatabaseItemStreamItemReaderTests {
|
||||
public class HibernateCursorItemReaderCommonTests extends AbstractDatabaseItemStreamItemReaderTests {
|
||||
|
||||
protected ItemReader<Foo> getItemReader() throws Exception {
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ import com.ibatis.sqlmap.client.SqlMapClient;
|
||||
|
||||
@SuppressWarnings({"unchecked", "deprecation"})
|
||||
@RunWith(JUnit4ClassRunner.class)
|
||||
public class IbatisItemReaderCommonTests extends CommonDatabaseItemStreamItemReaderTests {
|
||||
public class IbatisItemReaderCommonTests extends AbstractDatabaseItemStreamItemReaderTests {
|
||||
|
||||
protected ItemReader<Foo> getItemReader() throws Exception {
|
||||
SqlMapClientFactoryBean factory = new SqlMapClientFactoryBean();
|
||||
|
||||
@@ -11,7 +11,7 @@ import com.ibatis.sqlmap.client.SqlMapClient;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@RunWith(JUnit4ClassRunner.class)
|
||||
public class IbatisPagingItemReaderCommonTests extends CommonDatabaseItemStreamItemReaderTests {
|
||||
public class IbatisPagingItemReaderCommonTests extends AbstractDatabaseItemStreamItemReaderTests {
|
||||
|
||||
protected ItemReader<Foo> getItemReader() throws Exception {
|
||||
SqlMapClientFactoryBean factory = new SqlMapClientFactoryBean();
|
||||
|
||||
@@ -8,7 +8,7 @@ import org.junit.internal.runners.JUnit4ClassRunner;
|
||||
import org.junit.Test;
|
||||
|
||||
@RunWith(JUnit4ClassRunner.class)
|
||||
public class JdbcCursorItemReaderCommonTests extends CommonDatabaseItemStreamItemReaderTests {
|
||||
public class JdbcCursorItemReaderCommonTests extends AbstractDatabaseItemStreamItemReaderTests {
|
||||
|
||||
protected ItemReader<Foo> getItemReader() throws Exception {
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ package org.springframework.batch.item.database;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.batch.item.CommonItemStreamItemReaderTests;
|
||||
import org.springframework.batch.item.AbstractItemStreamItemReaderTests;
|
||||
import org.springframework.batch.item.ItemReader;
|
||||
import org.springframework.batch.item.ExecutionContext;
|
||||
import org.springframework.batch.item.database.support.HsqlPagingQueryProvider;
|
||||
@@ -17,7 +17,7 @@ import java.sql.SQLException;
|
||||
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration
|
||||
public class JdbcPagingItemReaderCommonTests extends CommonItemStreamItemReaderTests {
|
||||
public class JdbcPagingItemReaderCommonTests extends AbstractItemStreamItemReaderTests {
|
||||
|
||||
@Autowired
|
||||
private DataSource dataSource;
|
||||
|
||||
@@ -3,7 +3,7 @@ package org.springframework.batch.item.database;
|
||||
import javax.persistence.EntityManagerFactory;
|
||||
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.batch.item.CommonItemStreamItemReaderTests;
|
||||
import org.springframework.batch.item.AbstractItemStreamItemReaderTests;
|
||||
import org.springframework.batch.item.ExecutionContext;
|
||||
import org.springframework.batch.item.ItemReader;
|
||||
import org.springframework.batch.item.sample.Foo;
|
||||
@@ -13,7 +13,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration
|
||||
public class JpaPagingItemReaderCommonTests extends CommonItemStreamItemReaderTests {
|
||||
public class JpaPagingItemReaderCommonTests extends AbstractItemStreamItemReaderTests {
|
||||
|
||||
@Autowired
|
||||
private EntityManagerFactory entityManagerFactory;
|
||||
|
||||
@@ -10,7 +10,7 @@ import org.junit.internal.runners.JUnit4ClassRunner;
|
||||
|
||||
@RunWith(JUnit4ClassRunner.class)
|
||||
@SuppressWarnings("deprecation")
|
||||
public class SingleColumnJdbcDrivingQueryItemReaderCommonTests extends CommonDatabaseItemStreamItemReaderTests {
|
||||
public class SingleColumnJdbcDrivingQueryItemReaderCommonTests extends AbstractDatabaseItemStreamItemReaderTests {
|
||||
|
||||
protected ItemReader<Foo> getItemReader() throws Exception {
|
||||
JdbcTemplate jdbcTemplate = new JdbcTemplate(getDataSource());
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package org.springframework.batch.item.file;
|
||||
|
||||
import org.springframework.batch.item.CommonItemStreamItemReaderTests;
|
||||
import org.springframework.batch.item.AbstractItemStreamItemReaderTests;
|
||||
import org.springframework.batch.item.ExecutionContext;
|
||||
import org.springframework.batch.item.ItemReader;
|
||||
import org.springframework.batch.item.file.mapping.LineMapper;
|
||||
@@ -11,7 +11,7 @@ import org.springframework.core.io.Resource;
|
||||
/**
|
||||
* Tests for {@link FlatFileItemReader}.
|
||||
*/
|
||||
public class FlatFileItemReaderCommonTests extends CommonItemStreamItemReaderTests{
|
||||
public class FlatFileItemReaderCommonTests extends AbstractItemStreamItemReaderTests{
|
||||
|
||||
private static final String FOOS = "1 \n 2 \n 3 \n 4 \n 5 \n";
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import java.util.Comparator;
|
||||
|
||||
import org.junit.internal.runners.JUnit4ClassRunner;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.batch.item.CommonItemStreamItemReaderTests;
|
||||
import org.springframework.batch.item.AbstractItemStreamItemReaderTests;
|
||||
import org.springframework.batch.item.ExecutionContext;
|
||||
import org.springframework.batch.item.ItemReader;
|
||||
import org.springframework.batch.item.file.mapping.LineMapper;
|
||||
@@ -14,7 +14,7 @@ import org.springframework.core.io.Resource;
|
||||
|
||||
@RunWith(JUnit4ClassRunner.class)
|
||||
public class MultiResourceItemReaderFlatFileTests extends
|
||||
CommonItemStreamItemReaderTests {
|
||||
AbstractItemStreamItemReaderTests {
|
||||
|
||||
protected ItemReader<Foo> getItemReader() throws Exception {
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ import javax.xml.transform.Source;
|
||||
|
||||
import org.junit.internal.runners.JUnit4ClassRunner;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.batch.item.CommonItemStreamItemReaderTests;
|
||||
import org.springframework.batch.item.AbstractItemStreamItemReaderTests;
|
||||
import org.springframework.batch.item.ExecutionContext;
|
||||
import org.springframework.batch.item.ItemReader;
|
||||
import org.springframework.batch.item.sample.Foo;
|
||||
@@ -25,7 +25,7 @@ import org.springframework.oxm.XmlMappingException;
|
||||
import org.springframework.xml.transform.StaxSource;
|
||||
|
||||
@RunWith(JUnit4ClassRunner.class)
|
||||
public class MultiResourceItemReaderXmlTests extends CommonItemStreamItemReaderTests {
|
||||
public class MultiResourceItemReaderXmlTests extends AbstractItemStreamItemReaderTests {
|
||||
|
||||
protected ItemReader<Foo> getItemReader() throws Exception {
|
||||
MultiResourceItemReader<Foo> multiReader = new MultiResourceItemReader<Foo>();
|
||||
|
||||
@@ -13,7 +13,7 @@ import javax.xml.stream.events.Attribute;
|
||||
import javax.xml.stream.events.StartElement;
|
||||
import javax.xml.transform.Source;
|
||||
|
||||
import org.springframework.batch.item.CommonItemStreamItemReaderTests;
|
||||
import org.springframework.batch.item.AbstractItemStreamItemReaderTests;
|
||||
import org.springframework.batch.item.ExecutionContext;
|
||||
import org.springframework.batch.item.ItemReader;
|
||||
import org.springframework.batch.item.sample.Foo;
|
||||
@@ -23,7 +23,7 @@ import org.springframework.oxm.XmlMappingException;
|
||||
import org.springframework.xml.transform.StaxSource;
|
||||
|
||||
@RunWith(JUnit4ClassRunner.class)
|
||||
public class StaxEventItemReaderCommonTests extends CommonItemStreamItemReaderTests {
|
||||
public class StaxEventItemReaderCommonTests extends AbstractItemStreamItemReaderTests {
|
||||
|
||||
private final static String FOOS = "<foos> <foo value=\"1\"/> <foo value=\"2\"/> <foo value=\"3\"/> <foo value=\"4\"/> <foo value=\"5\"/> </foos>";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user