FileDocCategorySizeDatePackage
ClusterConfigTest.javaAPI DocGlassfish v2 API4389Fri May 04 22:23:54 BST 2007com.sun.enterprise.management.config

ClusterConfigTest

public final class ClusterConfigTest extends ConfigMgrTestBase implements com.sun.enterprise.management.ClusterSupportRequired
Test the creation/removal of ClusterConfig

Fields Summary
Constructors Summary
public ClusterConfigTest()

	    if ( checkNotOffline( "ensureDefaultInstance" ) )
	    {
	        ensureDefaultInstance( getDomainConfig() );
	    }
	
Methods Summary
protected final com.sun.appserv.management.config.AMXConfigcreateProgeny(java.lang.String name, java.util.Map options)

	    assert( name != null && name.length() >= 1 );
	    return getDomainConfig().createClusterConfig( name, null, options );
	
public static com.sun.appserv.management.config.ClusterConfigensureDefaultInstance(com.sun.appserv.management.config.DomainConfig domainConfig)

	    ClusterConfig   result  =
	        domainConfig.getClusterConfigMap().get( getDefaultInstanceName() );
	    
	    if ( result == null )
	    {
	        result  = domainConfig.createClusterConfig(
	                    getDefaultInstanceName(), null, null );
	    }
	    
	    return result;
	
public static java.lang.StringgetDefaultInstanceName()

        return getDefaultInstanceName( "test-cluster" );
    
protected com.sun.appserv.management.base.ContainergetProgenyContainer()

		return getDomainConfig();
	
protected java.lang.StringgetProgenyJ2EEType()

		return XTypes.CLUSTER_CONFIG;
	
protected voidremoveProgeny(java.lang.String name)

		getDomainConfig().removeClusterConfig( name );
	
public voidtestCreateWithIllegalConfig()

		try
		{
			getDomainConfig().createClusterConfig( "dummy-cluster-1", "no such config", null );
			failure( "expecting failure creating cluster with illegal config name" );
			
			getDomainConfig().createClusterConfig( "dummy-cluster-2", "server-config", null );
			failure( "expecting failure creating cluster with name 'server-config'" );
			
			getDomainConfig().createClusterConfig( "dummy-cluster-2", "default-config", null );
			failure( "expecting failure creating name 'default-config'" );
		}
		catch( Exception e )
		{
			// good
		}