1   /*
2    * Copyright 2001-2004 The Apache Software Foundation
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *     http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
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      	// todo - ms.setBoundary(BOUNDARY_TEXT.getBytes());
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  }