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