FileDocCategorySizeDatePackage
DisplayTest.javaAPI DocGlassfish v2 API4914Fri May 04 22:35:22 BST 2007com.sun.enterprise.tools.common.validation.util

DisplayTest

public class DisplayTest extends TestCase
author
Rajeshwar Patil
version
%I%, %G%

Fields Summary
Constructors Summary
public DisplayTest(String name)

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

        junit.textui.TestRunner.run(suite());
    
private voidnyi()

        fail("Not yet implemented");                                    //NOI18N
    
protected voidsetUp()
Initialize; allocate any resources needed to perform Tests.

    
public static junit.framework.Testsuite()
Define suite of all the Tests to run.

        TestSuite suite = new TestSuite(DisplayTest.class);
        return suite;
    
protected voidtearDown()
Free all the resources initilized/allocated to perform Tests.

    
public voidtestText()

        CustomDisplay display = new CustomDisplay();

        
        ArrayList failureMessages = new ArrayList();
        ConstraintFailure failure_abc = 
            new ConstraintFailure("abc failed", "value_abc",            //NOI18N
                 "name_abc", "failureMessage_abc",                      //NOI18N
                    "genericFailureMessage_abc");                       //NOI18N
        ConstraintFailure failure_xyz = 
            new ConstraintFailure("constraint_xyz", "value_xyz",        //NOI18N
                "name_xyz", "failureMessage_xyz",                       //NOI18N
                    "genericFailureMessage_xyz");                       //NOI18N
        failureMessages.add(failure_abc);
        failureMessages.add(failure_xyz);
        display.text(failureMessages);

        //test to make sure text() reports error, if the Collection it is 
        //processing has objects that are not of type Failure.
        ArrayList failures = new ArrayList();
        failures.add(new Integer(5));
        failures.add("failure_message");                                //NOI18N
        display.text(failures);