FileDocCategorySizeDatePackage
CommandExceptionTest.javaAPI DocGlassfish v2 API3799Fri May 04 22:25:28 BST 2007com.sun.enterprise.cli.framework

CommandExceptionTest

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

Fields Summary
Constructors Summary
public CommandExceptionTest(String name)

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

        if (args.length == 0){
            junit.textui.TestRunner.run(CommandExceptionTest.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 CommandExceptionTest(args[i]));
        }
        return ts;
    
private voidnyi()

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

    
protected voidtearDown()

    
public voidtestEmptyConstructor()

        CommandException ce = new CommandException();
        assertNull(ce.getMessage());
    
public voidtestEncapsulatedException()

        final NullPointerException npe = new NullPointerException("a null pointer");
        CommandException ce = new CommandException(npe);
        assertEquals("java.lang.NullPointerException: a null pointer", ce.getMessage());
        assertEquals(npe, ce.getCause());
    
public voidtestFullConstructor()

        final String message = "m";
        final Throwable t = new Throwable();
        CommandException ce = new CommandException(message, t);
        assertEquals(message, ce.getMessage());
        assertEquals(t, ce.getCause());
    
public voidtestSimple()

        CommandException ce = new CommandException("this is the message");
        assertEquals("this is the message", ce.getMessage());