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

ConnectorServiceConfigTest

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

Fields Summary
Constructors Summary
public ConnectorServiceConfigTest()

	    if ( checkNotOffline( "ensureDefaultInstance" ) )
	    {
            ensureDefaultInstance( getConfigConfig() );
        }
    
Methods Summary
public static com.sun.appserv.management.config.ConnectorServiceConfigensureDefaultInstance(com.sun.appserv.management.config.ConfigConfig configConfig)

	    return configConfig.createConnectorServiceConfig();
	
public synchronized voidtestCreateRemove()

	    if ( checkNotOffline( "testCreateRemove" ) )
	    {
    	    final ConfigConfig  configConfig    = getConfigConfig();
    	    
    	    // remove first, in case it's there
    	    configConfig.removeConnectorServiceConfig();
    	    
    	    // create and remove
    	    configConfig.createConnectorServiceConfig();
    	    configConfig.removeConnectorServiceConfig();
    	    
    	    // leave it there
    	    ensureDefaultInstance( configConfig );
	    }
	
public synchronized voidtestGetters()

	    if ( checkNotOffline( "ensureDefaultInstance" ) )
	    {
	        ensureDefaultInstance( getConfigConfig() );
    	    
    	    final ConnectorServiceConfig    cs  = getConfigConfig().getConnectorServiceConfig();
    	    
    	    final String    value   = cs.getShutdownTimeoutInSeconds();
    	    assert( value != null );
    	    
    	    try
    	    {
    	        final String    newValue    = "" + (Integer.parseInt( value ) + 1);
        	    cs.setShutdownTimeoutInSeconds( newValue );
        	    final String after  = cs.getShutdownTimeoutInSeconds();
        	    assert( after.equals( newValue ) );
        	    
        	    cs.setShutdownTimeoutInSeconds( "30" );
        	    cs.setShutdownTimeoutInSeconds( newValue );
    	    }
    	    catch( Exception e )
    	    {
    	        warning( getRootCauseStackTrace( e ) );
    	        
    	        failure( "ConnectorServiceConfig.setShutdownTimeoutInSeconds FAILED " +
    	            "(bug #6307916 in com.sun.appserv:type=connector-service MBean)" );
    	    }
	    }