FileDocCategorySizeDatePackage
ConfigHelperTest.javaAPI DocGlassfish v2 API4253Fri May 04 22:24:46 BST 2007com.sun.enterprise.admin.wsmgmt.registry

ConfigHelperTest

public class ConfigHelperTest extends TestCase
author
Harpreet Singh

Fields Summary
private static final String
URL
private static final String
POOL_NAME
private com.sun.enterprise.admin.wsmgmt.registry.ConfigHelper
ch_query
private com.sun.enterprise.admin.wsmgmt.registry.ConfigHelper
ch_add_delete
Constructors Summary
public ConfigHelperTest(String name)

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

         
        junit.textui.TestRunner.run(ConfigHelperTest.class);
    
protected voidsetUp()

        try{
            System.out.println("ConfigHelperTest");
            ch_query = ConfigHelper.getInstanceToQueryRegistryLocations();
            ConfigContext ctx = ConfigFactory.createConfigContext(URL);
            ch_query.setConfigContext(ctx);            
        } catch (Exception e){
            e.printStackTrace();
        }
    
public voidtestListRegistryLocations()

                        
        try {
            String[] locations = ch_query.listRegistryLocations();
            System.out.println("Looking up Connection Jndi Name. Name" +
                    " should be "+POOL_NAME);
            
            if(locations.length == 1){
                System.out.println("Locations = "+ locations[0]);
                assertEquals("Looked up Registry Location ", POOL_NAME, 
                        locations[0]);
            } else{
                fail(" Returned wrong number of RegistryLocation");
            }
        } catch (ConfigException ce) {
            ce.printStackTrace();
            throw ce;
        }