org.springframework.batch.item.xml.stax
Class DefaultFragmentEventReaderTests

java.lang.Object
  extended by TestCase
      extended by org.springframework.batch.item.xml.stax.DefaultFragmentEventReaderTests

public class DefaultFragmentEventReaderTests
extends TestCase

Tests for DefaultFragmentEventReader.

Author:
Robert Kasanicky

Constructor Summary
DefaultFragmentEventReaderTests()
           
 
Method Summary
protected  void setUp()
          Setup the fragmentReader to read the test input.
 void testFragmentWrapping()
          Marked element should be wrapped with StartDocument and EndDocument events.
 void testMarkFragmentProcessed()
          When fragment is marked as processed the cursor is moved after the end of the fragment.
 void testMarkFragmentProcessedImmediatelyAfterMarkFragmentStart()
          Cursor is moved to the end of the fragment as usually even if nothing was read from the event reader after beginning of fragment was marked.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultFragmentEventReaderTests

public DefaultFragmentEventReaderTests()
Method Detail

setUp

protected void setUp()
              throws Exception
Setup the fragmentReader to read the test input.

Throws:
Exception

testFragmentWrapping

public void testFragmentWrapping()
                          throws javax.xml.stream.XMLStreamException
Marked element should be wrapped with StartDocument and EndDocument events. Test uses redundant peek() calls before nextEvent() in important moments to assure peek() has no side effects on the inner state of reader.

Throws:
javax.xml.stream.XMLStreamException

testMarkFragmentProcessed

public void testMarkFragmentProcessed()
                               throws javax.xml.stream.XMLStreamException
When fragment is marked as processed the cursor is moved after the end of the fragment.

Throws:
javax.xml.stream.XMLStreamException

testMarkFragmentProcessedImmediatelyAfterMarkFragmentStart

public void testMarkFragmentProcessedImmediatelyAfterMarkFragmentStart()
                                                                throws Exception
Cursor is moved to the end of the fragment as usually even if nothing was read from the event reader after beginning of fragment was marked.

Throws:
Exception


Copyright © 2008 SpringSource. All Rights Reserved.