FileDocCategorySizeDatePackage
UserOutputImplTest.javaAPI DocGlassfish v2 API4047Fri May 04 22:25:30 BST 2007com.sun.enterprise.cli.framework

UserOutputImplTest

public class UserOutputImplTest extends TestCase
author
Toby H Ferguson
version
$Revision: 1.5 $

Fields Summary
Constructors Summary
public UserOutputImplTest(String name)

        super(name);
    
Methods Summary
public static voidmain(java.lang.String[] args)

        if (args.length == 0){
            junit.textui.TestRunner.run(UserOutputImplTest.class);
        } else {
            junit.textui.TestRunner.run(makeSuite(args));
        }
    
private static junit.framework.TestSuitemakeSuite(java.lang.String[] args)

        final TestSuite ts = new TestSuite();
        for (int i = 0; i < args.length; i++){
            ts.addTest(new UserOutputImplTest(args[i]));
        }
        return ts;
    
private voidnyi()

        fail("Not Yet Implemented");
    
protected voidsetUp()

    
protected voidtearDown()

    
public voidtestBasicConstruction()

        final ByteArrayOutputStreamWithClosure s = new ByteArrayOutputStreamWithClosure();
        final UserOutputImpl ui = new UserOutputImpl(s, true);
        ui.print("message");
        ui.print((Object) "object");
        ui.println("eol");
        ui.println((Object) "eol2");
        ui.flush();
        ui.close();
        assertEquals("messageobjecteol"+System.getProperty("line.separator") +"eol2"+System.getProperty("line.separator"), s.toString());
        assertTrue(s.isClosed());
    
public voidtestNullCOnstruction()

        final UserOutputImpl ui = new UserOutputImpl(null, true);
        ui.print("message");
        ui.print((Object) "object");
        ui.println("eol");
        ui.println((Object) "eol2");
        ui.flush();
        ui.close();