KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > cli > framework > NullOutputTest


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23
24 package com.sun.enterprise.cli.framework;
25
26 import junit.framework.*;
27 /**
28  *
29  * @author <a HREF="mailto:toby.h.ferguson@sun.com">Toby H Ferguson</a>
30  * @version $Revision: 1.4 $
31  */

32
33 public class NullOutputTest extends TestCase {
34     public void testIt() {
35         final NullOutput no = new NullOutput();
36         final String JavaDoc m = "a message";
37         final Object JavaDoc o = (Object JavaDoc) "an object";
38         no.print(m);
39         no.print(o);
40         no.println(m);
41         no.println(o);
42         no.close();
43         no.flush();
44         no.close();
45         no.println(m);
46     }
47
48     public NullOutputTest(String JavaDoc name){
49         super(name);
50     }
51
52     protected void setUp() {
53     }
54
55     protected void tearDown() {
56     }
57
58     private void nyi(){
59         fail("Not Yet Implemented");
60     }
61
62     public static void main(String JavaDoc args[]){
63         if (args.length == 0){
64             junit.textui.TestRunner.run(NullOutputTest.class);
65         } else {
66             junit.textui.TestRunner.run(makeSuite(args));
67         }
68     }
69     private static TestSuite makeSuite(String JavaDoc args[]){
70         final TestSuite ts = new TestSuite();
71         for (int i = 0; i < args.length; i++){
72             ts.addTest(new NullOutputTest(args[i]));
73         }
74         return ts;
75     }
76 }
77
Popular Tags