FileDocCategorySizeDatePackage
PEMainTest.javaAPI DocGlassfish v2 API5854Fri May 04 22:36:20 BST 2007com.sun.enterprise.server

PEMainTest

public class PEMainTest extends TestCase
JUnit test for PEMain.java
author
Rob Ruyak

Fields Summary
Constructors Summary
public PEMainTest(String name)

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

        final TestRunner runner= new TestRunner();
        final TestResult result = runner.doRun(PEMainTest.suite(), false);
        System.exit(result.errorCount() + result.failureCount());
    
protected voidsetUp()

    
public static junit.framework.Testsuite()

        TestSuite suite = new TestSuite(PEMainTest.class);
        return suite;
    
protected voidtearDown()

    
public voidtestSetSystemLocale()

        String [] array = {"en_US","en_US__567_89","sp_SP","fr_FR_WIN","","FR_FR_UNIX"};
        for(int i = 0;i < array.length;i++) {
            System.setProperty(SystemPropertyConstants.DEFAULT_LOCALE_PROPERTY,array[i]);
            PEMain.setSystemLocale();
            if(array[i].equals("")) {
                //System.out.println("Blank string reached..Locale should not change!");
                Assert.assertTrue(Locale.getDefault().toString().
                        equalsIgnoreCase(array[i-1]));
            } else {
                Assert.assertTrue(Locale.getDefault().toString().
                        equalsIgnoreCase(System.getProperty(
                                SystemPropertyConstants.DEFAULT_LOCALE_PROPERTY)));
            }
            //System.out.println("Locale -> " + Locale.getDefault());
        }