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 Stringprotected Stringprotected abstract Fprotected byte[]protected abstract CnewServletRequestContext(R request) protected byte[]parseUpload(byte[] bytes) protected org.apache.commons.fileupload2.core.FileItemInputIteratorparseUpload(int length, InputStream inputStream) parseUpload(InputStream inputStream, int length) voidTests a file upload with varying file sizes.voidTest for FILEUPLOAD-135voidTests, whether an invalid request throws a proper exception.voidTests, whether anInvalidPathExceptionis thrown.voidTests, 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.FileUploadExceptionIOException
-
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 anInvalidPathExceptionis thrown.- Throws:
IOException- Test failure.
-
testIOException
Tests, whether an IOException is properly delegated.- Throws:
IOException- Test failure.