org.springframework.batch.item
Class CommonItemStreamItemReaderTests

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.springframework.batch.item.CommonItemReaderTests
              extended by org.springframework.batch.item.CommonItemStreamItemReaderTests
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
CommonDatabaseItemStreamItemReaderTests, FlatFileItemReaderCommonTests, MultiResourceItemReaderFlatFileTests, MultiResourceItemReaderXmlTests, StaxEventItemReaderCommonTests

public abstract class CommonItemStreamItemReaderTests
extends CommonItemReaderTests

Common tests for readers implementing both ItemReader and ItemStream. Expected input is five Foo objects with values 1 to 5.


Field Summary
protected  ExecutionContext executionContext
           
 
Fields inherited from class org.springframework.batch.item.CommonItemReaderTests
tested
 
Constructor Summary
CommonItemStreamItemReaderTests()
           
 
Method Summary
protected  void setUp()
           
protected  void tearDown()
           
protected  ItemStream testedAsStream()
          Cast the reader to ItemStream.
 void testReopen()
           
 void testResetAndRestart()
          Restart scenario - read items, rollback to last marked position, update execution context, create new reader and restore from restart data - the new input source should continue where the old one finished.
 void testRestart()
          Restart scenario - read items, update execution context, create new reader and restore from restart data - the new input source should continue where the old one finished.
 
Methods inherited from class org.springframework.batch.item.CommonItemReaderTests
getItemReader, pointToEmptyInput, testEmptyInput, testRead, testReset
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

executionContext

protected ExecutionContext executionContext
Constructor Detail

CommonItemStreamItemReaderTests

public CommonItemStreamItemReaderTests()
Method Detail

testedAsStream

protected ItemStream testedAsStream()
Cast the reader to ItemStream.


setUp

protected void setUp()
              throws Exception
Overrides:
setUp in class CommonItemReaderTests
Throws:
Exception

tearDown

protected void tearDown()
                 throws Exception
Overrides:
tearDown in class junit.framework.TestCase
Throws:
Exception

testRestart

public void testRestart()
                 throws Exception
Restart scenario - read items, update execution context, create new reader and restore from restart data - the new input source should continue where the old one finished.

Throws:
Exception

testResetAndRestart

public void testResetAndRestart()
                         throws Exception
Restart scenario - read items, rollback to last marked position, update execution context, create new reader and restore from restart data - the new input source should continue where the old one finished.

Throws:
Exception

testReopen

public void testReopen()
                throws Exception
Throws:
Exception


Copyright © 2008 SpringSource. All Rights Reserved.