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

BundleReaderTest

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

Fields Summary
Constructors Summary
public BundleReaderTest(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(BundleReaderTest.class);
        return suite;
    
protected voidtearDown()
Free all the resources initilized/allocated to perform Tests.

    
public voidtestCreate()

        String bundleFile = "com/sun/enterprise/tools/" +               //NOI18N
            "common/validation/Bundle.properties";                      //NOI18N
        Utils utils = new Utils();
        boolean fileExists = utils.fileExists(bundleFile);
        String str = 
            BundleReader.getValue("MSG_NumberConstraint_Failure");      //NOI18N
        
        if(fileExists){
            assertTrue(!str.equals("MSG_NumberConstraint_Failure"));    //NOI18N
        } else {
            assertTrue(str.equals("MSG_NumberConstraint_Failure"));     //NOI18N
        }
    
public voidtestGetValue()

        String str = BundleReader.getValue("non_existing_key");         //NOI18N
        assertTrue(str.equals("non_existing_key"));                     //NOI18N
        str = BundleReader.getValue("MSG_NumberConstraint_Failure");    //NOI18N
        assertTrue(!str.equals("MSG_NumberConstraint_Failure"));        //NOI18N