01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: package org.apache.commons.io.output;
18:
19: import java.io.IOException;
20:
21: import junit.framework.TestCase;
22:
23: /**
24: * Really not a lot to do here, but checking that no
25: * Exceptions are thrown.
26: *
27: * @version $Revision: 471628 $ $Date: 2006-11-06 05:06:45 +0100 (Mo, 06 Nov 2006) $
28: */
29:
30: public class NullOutputStreamTest extends TestCase {
31:
32: public NullOutputStreamTest(String name) {
33: super (name);
34: }
35:
36: public void testNull() throws IOException {
37: NullOutputStream nos = new NullOutputStream();
38: nos.write("string".getBytes());
39: nos.write("some string".getBytes(), 3, 5);
40: nos.write(1);
41: nos.write(0x0f);
42: nos.flush();
43: nos.close();
44: nos.write("allowed".getBytes());
45: nos.write(255);
46: }
47:
48: }
|