org.springframework.batch.item.xml
Class StaxEventItemWriterTests

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.springframework.batch.item.xml.StaxEventItemWriterTests
All Implemented Interfaces:
junit.framework.Test

public class StaxEventItemWriterTests
extends junit.framework.TestCase

Tests for StaxEventItemWriter.


Constructor Summary
StaxEventItemWriterTests()
           
 
Method Summary
protected  void setUp()
           
 void testClear()
           
 void testFlush()
          Flush should pass buffered items to Serializer.
 void testOpenAndClose()
          Open method writes the root tag, close method adds corresponding end tag.
 void testRestart()
          Restart scenario - content is appended to the output file after restart.
 void testRollback()
          Rolled back records should not be written to output file.
 void testStreamContext()
          Count of 'records written so far' is returned as statistics.
 void testWriteAndFlush()
          Item is written to the output file only after flush.
 void testWriteWithHeader()
          Item is written to the output file only after flush.
 void testWriteWithHeaderAfterFlushAndRollback()
          Item is written to the output file only after flush.
 void testWriteWithHeaderAfterRollback()
          Item is written to the output file only after flush.
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, tearDown, 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
 

Constructor Detail

StaxEventItemWriterTests

public StaxEventItemWriterTests()
Method Detail

setUp

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

testFlush

public void testFlush()
               throws Exception
Flush should pass buffered items to Serializer.

Throws:
Exception

testClear

public void testClear()
               throws Exception
Throws:
Exception

testRollback

public void testRollback()
                  throws Exception
Rolled back records should not be written to output file.

Throws:
Exception

testWriteAndFlush

public void testWriteAndFlush()
                       throws Exception
Item is written to the output file only after flush.

Throws:
Exception

testRestart

public void testRestart()
                 throws Exception
Restart scenario - content is appended to the output file after restart.

Throws:
Exception

testWriteWithHeader

public void testWriteWithHeader()
                         throws Exception
Item is written to the output file only after flush.

Throws:
Exception

testWriteWithHeaderAfterRollback

public void testWriteWithHeaderAfterRollback()
                                      throws Exception
Item is written to the output file only after flush.

Throws:
Exception

testWriteWithHeaderAfterFlushAndRollback

public void testWriteWithHeaderAfterFlushAndRollback()
                                              throws Exception
Item is written to the output file only after flush.

Throws:
Exception

testStreamContext

public void testStreamContext()
                       throws Exception
Count of 'records written so far' is returned as statistics.

Throws:
Exception

testOpenAndClose

public void testOpenAndClose()
                      throws Exception
Open method writes the root tag, close method adds corresponding end tag.

Throws:
Exception


Copyright © 2008 SpringSource. All Rights Reserved.