Class AbstractStreamingTest<AFU extends org.apache.commons.fileupload2.core.AbstractFileUpload<R,I,F>,R,C extends org.apache.commons.fileupload2.core.AbstractRequestContext<?>,I extends org.apache.commons.fileupload2.core.FileItem<I>,F extends org.apache.commons.fileupload2.core.FileItemFactory<I>>
java.lang.Object
org.apache.commons.fileupload2.core.AbstractTest<AFU,R,I,F>
org.apache.commons.fileupload2.core.AbstractStreamingTest<AFU,R,C,I,F>
- Type Parameters:
AFU
- The subclass of FileUpload.R
- The type of FileUpload request.C
- The request context type.I
- The FileItem type.F
- The FileItemFactory type.
public abstract class AbstractStreamingTest<AFU extends org.apache.commons.fileupload2.core.AbstractFileUpload<R,I,F>,R,C extends org.apache.commons.fileupload2.core.AbstractRequestContext<?>,I extends org.apache.commons.fileupload2.core.FileItem<I>,F extends org.apache.commons.fileupload2.core.FileItemFactory<I>>
extends AbstractTest<AFU,R,I,F>
Unit test for items with varying sizes.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected String
protected String
protected abstract F
protected byte[]
protected abstract C
newServletRequestContext
(R request) protected byte[]
parseUpload
(byte[] bytes) protected org.apache.commons.fileupload2.core.FileItemInputIterator
parseUpload
(int length, InputStream inputStream) parseUpload
(InputStream inputStream, int length) void
Tests a file upload with varying file sizes.void
Test for FILEUPLOAD-135void
Tests, whether an invalid request throws a proper exception.void
Tests, whether anInvalidPathException
is thrown.void
Tests, whether an IOException is properly delegated.Methods inherited from class org.apache.commons.fileupload2.core.AbstractTest
newFileUpload, newMockHttpServletRequest, newMockHttpServletRequest, newMockHttpServletRequest
-
Constructor Details
-
AbstractStreamingTest
public AbstractStreamingTest()
-
-
Method Details
-
getHeader
-
newDiskFileItemFactory
-
newRequest
- Throws:
IOException
-
newServletRequestContext
-
newShortRequest
- Throws:
IOException
-
parseUpload
protected List<I> parseUpload(byte[] bytes) throws org.apache.commons.fileupload2.core.FileUploadException - Throws:
org.apache.commons.fileupload2.core.FileUploadException
-
parseUpload
protected List<I> parseUpload(InputStream inputStream, int length) throws org.apache.commons.fileupload2.core.FileUploadException - Throws:
org.apache.commons.fileupload2.core.FileUploadException
-
parseUpload
protected org.apache.commons.fileupload2.core.FileItemInputIterator parseUpload(int length, InputStream inputStream) throws org.apache.commons.fileupload2.core.FileUploadException, IOException - Throws:
org.apache.commons.fileupload2.core.FileUploadException
IOException
-
testFileUpload
Tests a file upload with varying file sizes.- Throws:
IOException
- Test failure.
-
testFILEUPLOAD135
Test for FILEUPLOAD-135- Throws:
IOException
- Test failure.
-
testFileUploadException
Tests, whether an invalid request throws a proper exception.- Throws:
IOException
- Test failure.
-
testInvalidFileNameException
Tests, whether anInvalidPathException
is thrown.- Throws:
IOException
- Test failure.
-
testIOException
Tests, whether an IOException is properly delegated.- Throws:
IOException
- Test failure.