1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.apache.commons.fileupload;
17
18
19 import junit.framework.TestCase;
20 import java.io.*;
21
22
23 /***
24 * Unit tests {@link org.apache.commons.fileupload.MultipartStream}.
25 *
26 * @author Sean C. Sullivan
27 *
28 */
29 public class MultipartStreamTest extends TestCase
30 {
31 static private final String BOUNDARY_TEXT = "myboundary";
32
33 public void testDefaultConstructor() throws Exception {
34 MultipartStream ms = new MultipartStream();
35
36 }
37
38 public void testThreeParamConstructor() throws Exception {
39 final String strData = "foobar";
40 InputStream input = new ByteArrayInputStream(strData.getBytes());
41 byte[] boundary = BOUNDARY_TEXT.getBytes();
42 int iBufSize = boundary.length;
43 MultipartStream ms = new MultipartStream(
44 input,
45 boundary,
46 iBufSize);
47 }
48
49 public void testTwoParamConstructor() throws Exception {
50 final String strData = "foobar";
51 InputStream input = new ByteArrayInputStream(strData.getBytes());
52 byte[] boundary = BOUNDARY_TEXT.getBytes();
53 MultipartStream ms = new MultipartStream(
54 input,
55 boundary);
56 }
57
58 public void testToString() {
59 MultipartStream ms = new MultipartStream();
60 assertNotNull(ms.toString());
61 }
62 }