org.apache.commons.fileupload
Class DefaultFileItemTest

java.lang.Object
  extended by org.apache.commons.fileupload.DefaultFileItemTest

public class DefaultFileItemTest
extends Object

Unit tests for DefaultFileItem.

Version:
$Id: DefaultFileItemTest.java 1454693 2013-03-09 12:30:27Z simonetripodi $

Constructor Summary
DefaultFileItemTest()
           
 
Method Summary
protected  FileItemFactory createFactory(File repository)
          Creates a new FileItemFactory and returns it, obscuring from the caller the underlying implementation of this interface.
 void doTestAboveThreshold(File repository)
          Common code for cases where the amount of data is above the configured threshold, but the ultimate destination of the data has not yet been determined.
 void testAboveThresholdDefaultRepository()
          Test creation of a field for which the amount of data falls above the configured threshold, where no specific repository is configured.
 void testAboveThresholdSpecifiedRepository()
          Test creation of a field for which the amount of data falls above the configured threshold, where a specific repository is configured.
 void testBelowThreshold()
          Test creation of a field for which the amount of data falls below the configured threshold.
 void testContentCharSet()
          Test construction of content charset.
 void testFileFieldConstruction()
          Test construction of a file field.
 void testTextFieldConstruction()
          Test construction of a regular text field.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultFileItemTest

public DefaultFileItemTest()
Method Detail

testTextFieldConstruction

public void testTextFieldConstruction()
Test construction of a regular text field.


testFileFieldConstruction

public void testFileFieldConstruction()
Test construction of a file field.


testBelowThreshold

public void testBelowThreshold()
Test creation of a field for which the amount of data falls below the configured threshold.


testAboveThresholdDefaultRepository

public void testAboveThresholdDefaultRepository()
Test creation of a field for which the amount of data falls above the configured threshold, where no specific repository is configured.


testAboveThresholdSpecifiedRepository

public void testAboveThresholdSpecifiedRepository()
Test creation of a field for which the amount of data falls above the configured threshold, where a specific repository is configured.


doTestAboveThreshold

public void doTestAboveThreshold(File repository)
Common code for cases where the amount of data is above the configured threshold, but the ultimate destination of the data has not yet been determined.

Parameters:
repository - The directory within which temporary files will be created.

createFactory

protected FileItemFactory createFactory(File repository)
Creates a new FileItemFactory and returns it, obscuring from the caller the underlying implementation of this interface.

Parameters:
repository - The directory within which temporary files will be created.
Returns:
the new FileItemFactory instance.

testContentCharSet

public void testContentCharSet()
                        throws Exception
Test construction of content charset.

Throws:
Exception


Copyright © 2002-2013 The Apache Software Foundation. All Rights Reserved.