org.springframework.batch.item.file
Class FlatFileItemWriterTests

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

public class FlatFileItemWriterTests
extends junit.framework.TestCase

Tests of regular usage for FlatFileItemWriter Exception cases will be in separate TestCase classes with different setUp and tearDown methods

Author:
robert.kasanicky, Dave Syer

Constructor Summary
FlatFileItemWriterTests()
           
 
Method Summary
protected  void setUp()
          Create temporary output file, define mock behaviour, set dependencies and initialize the object under test
protected  void tearDown()
          Release resources and delete the temporary output file
 void testAfterPropertiesSetChecksMandatory()
           
 void testCommit()
           
 void testDefaultStreamContext()
           
 void testOpenTwice()
           
 void testOpenWithNonWritableFile()
           
 void testRestart()
           
 void testRollback()
           
 void testWriteHeader()
           
 void testWriteHeaderAfterRestartOnFirstChunk()
           
 void testWriteHeaderAfterRestartOnSecondChunk()
           
 void testWriteRecord()
          Regular usage of write(String[], LineDescriptor) method
 void testWriteRecordWithrecordSeparator()
           
 void testWriteString()
          Regular usage of write(String) method
 void testWriteStringWithBogusEncoding()
          Regular usage of write(String) method
 void testWriteStringWithEncodingAfterClose()
          Regular usage of write(String) method
 void testWriteWithConverter()
          Regular usage of write(String) method
 void testWriteWithConverterAndInfiniteLoop()
          Regular usage of write(String) method
 void testWriteWithConverterAndString()
          Regular usage of write(String) method
 void testWriteWithMultipleOpen()
           
 
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
 

Constructor Detail

FlatFileItemWriterTests

public FlatFileItemWriterTests()
Method Detail

setUp

protected void setUp()
              throws Exception
Create temporary output file, define mock behaviour, set dependencies and initialize the object under test

Overrides:
setUp in class junit.framework.TestCase
Throws:
Exception

tearDown

protected void tearDown()
                 throws Exception
Release resources and delete the temporary output file

Overrides:
tearDown in class junit.framework.TestCase
Throws:
Exception

testWriteWithMultipleOpen

public void testWriteWithMultipleOpen()
                               throws Exception
Throws:
Exception

testOpenTwice

public void testOpenTwice()

testWriteString

public void testWriteString()
                     throws Exception
Regular usage of write(String) method

Throws:
Exception

testWriteWithConverter

public void testWriteWithConverter()
                            throws Exception
Regular usage of write(String) method

Throws:
Exception

testWriteWithConverterAndInfiniteLoop

public void testWriteWithConverterAndInfiniteLoop()
                                           throws Exception
Regular usage of write(String) method

Throws:
Exception

testWriteWithConverterAndString

public void testWriteWithConverterAndString()
                                     throws Exception
Regular usage of write(String) method

Throws:
Exception

testWriteRecord

public void testWriteRecord()
                     throws Exception
Regular usage of write(String[], LineDescriptor) method

Throws:
Exception

testWriteRecordWithrecordSeparator

public void testWriteRecordWithrecordSeparator()
                                        throws Exception
Throws:
Exception

testRollback

public void testRollback()
                  throws Exception
Throws:
Exception

testCommit

public void testCommit()
                throws Exception
Throws:
Exception

testRestart

public void testRestart()
                 throws Exception
Throws:
Exception

testOpenWithNonWritableFile

public void testOpenWithNonWritableFile()
                                 throws Exception
Throws:
Exception

testAfterPropertiesSetChecksMandatory

public void testAfterPropertiesSetChecksMandatory()
                                           throws Exception
Throws:
Exception

testDefaultStreamContext

public void testDefaultStreamContext()
                              throws Exception
Throws:
Exception

testWriteStringWithBogusEncoding

public void testWriteStringWithBogusEncoding()
                                      throws Exception
Regular usage of write(String) method

Throws:
Exception

testWriteStringWithEncodingAfterClose

public void testWriteStringWithEncodingAfterClose()
                                           throws Exception
Regular usage of write(String) method

Throws:
Exception

testWriteHeader

public void testWriteHeader()
                     throws Exception
Throws:
Exception

testWriteHeaderAfterRestartOnFirstChunk

public void testWriteHeaderAfterRestartOnFirstChunk()
                                             throws Exception
Throws:
Exception

testWriteHeaderAfterRestartOnSecondChunk

public void testWriteHeaderAfterRestartOnSecondChunk()
                                              throws Exception
Throws:
Exception


Copyright © 2008 SpringSource. All Rights Reserved.