org.springframework.batch.item.database
Class AbstractJdbcItemReaderIntegrationTests

java.lang.Object
  extended by AbstractTransactionalDataSourceSpringContextTests
      extended by org.springframework.batch.item.database.AbstractJdbcItemReaderIntegrationTests
Direct Known Subclasses:
MultipleColumnJdbcDrivingQueryItemReaderIntegrationTests, SingleColumnJdbcDrivingQueryItemReaderIntegrationTests

public abstract class AbstractJdbcItemReaderIntegrationTests
extends AbstractTransactionalDataSourceSpringContextTests

Common scenarios for testing ItemReader implementations which read data from database.

Author:
Lucas Ward, Robert Kasanicky

Field Summary
protected  ExecutionContext executionContext
           
protected  ItemReader itemReader
           
 
Constructor Summary
AbstractJdbcItemReaderIntegrationTests()
           
 
Method Summary
protected abstract  ItemReader createItemReader()
           
protected  String[] getConfigLocations()
           
protected  void onSetUp()
           
protected  void onTearDown()
           
 void testInvalidRestore()
          Reading from an input source and then trying to restore causes an error.
 void testNormalProcessing()
          Regular scenario - read all rows and eventually return null.
 void testRestart()
          Restart scenario.
 void testRestoreFromEmptyData()
          Empty restart data should be handled gracefully.
 void testRollback()
          Rollback scenario.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

itemReader

protected ItemReader itemReader

executionContext

protected ExecutionContext executionContext
Constructor Detail

AbstractJdbcItemReaderIntegrationTests

public AbstractJdbcItemReaderIntegrationTests()
Method Detail

createItemReader

protected abstract ItemReader createItemReader()
                                        throws Exception
Returns:
input source with all necessary dependencies set
Throws:
Exception

getConfigLocations

protected String[] getConfigLocations()

onSetUp

protected void onSetUp()
                throws Exception
Throws:
Exception

onTearDown

protected void onTearDown()
                   throws Exception
Throws:
Exception

testNormalProcessing

public void testNormalProcessing()
                          throws Exception
Regular scenario - read all rows and eventually return null.

Throws:
Exception

testRestart

public void testRestart()
                 throws Exception
Restart scenario.

Throws:
Exception

testInvalidRestore

public void testInvalidRestore()
                        throws Exception
Reading from an input source and then trying to restore causes an error.

Throws:
Exception

testRestoreFromEmptyData

public void testRestoreFromEmptyData()
                              throws Exception
Empty restart data should be handled gracefully.

Throws:
Exception

testRollback

public void testRollback()
                  throws Exception
Rollback scenario.

Throws:
Exception


Copyright © 2008 SpringSource. All Rights Reserved.