FileDocCategorySizeDatePackage
LifecycleModuleConfigTest.javaAPI DocGlassfish v2 API5790Fri May 04 22:23:56 BST 2007com.sun.enterprise.management.config

LifecycleModuleConfigTest

public final class LifecycleModuleConfigTest extends com.sun.enterprise.management.AMXTestBase

Fields Summary
private static final String
IMPL_CLASSNAME
private static final String
TEST_NAME_BASE
private static final String
TEST_TYPE
Constructors Summary
public LifecycleModuleConfigTest()

    
		
	 
	
	    if ( checkNotOffline( "ensureDefaultInstance" ) )
	    {
	        ensureDefaultInstance( getDomainConfig() );
	    }
	
Methods Summary
private void_testGetAll()

	    
	    final Map<String,LifecycleModuleConfig> all = getLifecycleModuleConfigs();
		assert( all != null );
	
public static com.sun.appserv.management.config.LifecycleModuleConfigcreateInstance(com.sun.appserv.management.config.DomainConfig domainConfig, java.lang.String name, java.lang.String classname, int loadOrder)

	    final boolean  isFailureFatal = false;
	    final boolean  enabled = true;
	    final String   classpath = "/test";
	    final String   description = null;
	    
	    final LifecycleModuleConfig life    =
	    	domainConfig.createLifecycleModuleConfig(  name,
	    	                    description,
	                            classname,
	                            classpath, 
	                            "" + loadOrder,
	                            isFailureFatal,
	                            enabled,
	                            null );
	    
	    return life;
	
public static com.sun.appserv.management.config.LifecycleModuleConfigensureDefaultInstance(com.sun.appserv.management.config.DomainConfig domainConfig)

	    LifecycleModuleConfig   result  =
	        domainConfig.getLifecycleModuleConfigMap().get( getDefaultInstanceName() );
	    
	    if ( result == null )
	    {
	        result  = createInstance( 
	            domainConfig,
	            getDefaultInstanceName(),
	            IMPL_CLASSNAME,
	            1 );
	    }
	    
	    return result;
	
public static java.lang.StringgetDefaultInstanceName()

        return getDefaultInstanceName( "LifecycleModuleConfig" );
    
public java.util.MapgetLifecycleModuleConfigs()

	    return getDomainConfig().getLifecycleModuleConfigMap();
	
private voidsanityCheck(com.sun.appserv.management.config.LifecycleModuleConfig config)

        config.setClassname( config.getClassname() );
        
        final String    classpath = config.getClasspath();
        config.setClasspath( classpath == null ? "" : classpath );
        
        config.setLoadOrder( config.getLoadOrder() );
        
        config.setIsFailureFatal( config.getIsFailureFatal() );
        
        config.setEnabled( config.getEnabled() );
	
public synchronized voidtestAttrs()

	    ensureDefaultInstance( getDomainConfig() );
	    
	    final Map<String,LifecycleModuleConfig> all = getLifecycleModuleConfigs();
	    
	    if ( all.size() != 0 )
	    {
    	    for( final LifecycleModuleConfig config : all.values() )
    	    {
    	        sanityCheck( config );
    	    }
	    }
	    else
	    {
	        warning( "LifecycleModuleConfigTest: No LifecycleModuleConfig to test" );
	    }
	
public synchronized voidtestCreateRemove()

	    final DomainConfig  domainConfig    = getDomainConfig();