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

VirtualServerConfigTest

public final class VirtualServerConfigTest extends ConfigMgrTestBase

Fields Summary
static final String
HOSTS
Constructors Summary
public VirtualServerConfigTest()

	
		
	 
	
	
Methods Summary
protected final com.sun.appserv.management.config.VirtualServerConfigcreate(java.lang.String name)

	    return (VirtualServerConfig)createProgeny( name, null );
	
protected final com.sun.appserv.management.config.AMXConfigcreateProgeny(java.lang.String name, java.util.Map extra)

		final Map<String,String> allOptions	= MapUtil.newMap( extra, getOptional() );
		
		return( getHTTPService().createVirtualServerConfig( name, "localhost", allOptions ) );
	
protected final com.sun.appserv.management.config.HTTPServiceConfiggetHTTPService()

		return getConfigConfig().getHTTPServiceConfig();
	
private java.util.MapgetOptional()

	    final Map<String,String> m	= new HashMap<String,String>();
		m.put( VirtualServerConfigKeys.STATE_KEY, VirtualServerConfigKeys.STATE_DISABLED );
		m.put( VirtualServerConfigKeys.DOC_ROOT_PROPERTY_KEY, "/" );
		m.put( VirtualServerConfigKeys.ACCESS_LOG_PROPERTY_KEY, "/" );
		
		return m;
	
protected com.sun.appserv.management.base.ContainergetProgenyContainer()

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

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

		getHTTPService().removeVirtualServerConfig( name );
	
public voidtestCreateHTTPAccessLog()

	    if ( ! checkNotOffline( "testCreateRemove" ) )
	    {
	        return;
	    }
	    
		final String	NAME	= "VirtualServerConfigMgrTest-testCreateHTTPAccessLog";
		try
		{
			removeEx( NAME );
			final VirtualServerConfig	newVS	=
				(VirtualServerConfig)createProgeny( NAME, null);
			assert newVS != null;
			//trace( "newVS.getState: " + newVS.getState() );
			// assert newVS.getState().equals("disabled");
			
			assert( newVS.getHTTPAccessLogConfig() == null );
			
			final HTTPAccessLogConfig accessLog	=
				newVS.createHTTPAccessLogConfig( false, "${com.sun.aas.instanceRoot}/logs/access", null);
			assert ( accessLog != null );
			assert ( Util.getObjectName( accessLog ).equals( Util.getObjectName( newVS.getHTTPAccessLogConfig() ) ) );
			
			newVS.removeHTTPAccessLogConfig();
		}
		finally
		{
			remove( NAME );
		}