KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > commons > io > output > NullOutputStreamTest


1 /*
2  * Copyright 1999-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
17
18 package org.apache.commons.io.output;
19
20
21 import java.io.IOException JavaDoc;
22
23 import junit.framework.TestCase;
24
25
26 /**
27  * Really not a lot to do here, but checking that no
28  * Exceptions are thrown.
29  *
30  * @author Henri Yandell (bayard at apache dot org)
31  * @version $Revision: 1.2 $ $Date: 2004/02/23 05:02:25 $
32  */

33
34 public class NullOutputStreamTest extends TestCase {
35
36     public NullOutputStreamTest(String JavaDoc name) {
37         super(name);
38     }
39
40     public void testNull() throws IOException JavaDoc {
41         NullOutputStream nos = new NullOutputStream();
42         nos.write("string".getBytes());
43         nos.write("some string".getBytes(), 3, 5);
44         nos.write(1);
45         nos.write(0x0f);
46         nos.flush();
47         nos.close();
48         nos.write("allowed".getBytes());
49         nos.write(255);
50     }
51
52 }
53
Popular Tags