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

IIOPListenerConfigTest

public final class IIOPListenerConfigTest extends ConfigMgrTestBase

Fields Summary
static final String
ADDRESS
static final Map
OPTIONAL
Constructors Summary
public IIOPListenerConfigTest()

	
	
		OPTIONAL.put( PropertiesAccess.PROPERTY_PREFIX + "xyz", "abc");
		OPTIONAL.put( IIOPListenerConfigKeys.ENABLED_KEY , "false");
		OPTIONAL.put( IIOPListenerConfigKeys.SECURITY_ENABLED_KEY, "true");
	
	
Methods Summary
protected final javax.management.ObjectNamecreate(java.lang.String name)

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

		final Map<String,String>	allOptions	= MapUtil.newMap( options, OPTIONAL );
		
		final	int	port	= (name.hashCode() % 32000) + 32000;
		allOptions.put( IIOPListenerConfigKeys.PORT_KEY, "" + port );
		
	    return getIIOPService().createIIOPListenerConfig(name, ADDRESS, allOptions );
	
protected final com.sun.appserv.management.config.IIOPServiceConfiggetIIOPService()

		return getConfigConfig().getIIOPServiceConfig();
	
protected com.sun.appserv.management.base.ContainergetProgenyContainer()

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

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

		getIIOPService().removeIIOPListenerConfig( name );
	
public voidtestCreateSSL()

	    if ( ! checkNotOffline( "testCreateSSL" ) )
	    {
	        return;
	    }
	    
		final String	NAME	= "IIOPListenerConfigMgr-testCreateSSL";
		
		removeEx( NAME );
			
		final IIOPListenerConfig	newListener	=
			(IIOPListenerConfig)createProgeny( NAME, null );
			
		try
		{
			final Map<String,IIOPListenerConfig>	listeners	=
				getIIOPService().getIIOPListenerConfigMap();
			
			final IIOPListenerConfig listener =
				(IIOPListenerConfig)listeners.get(  NAME  );
			assert listener != null;
			assert listener == newListener;
			
			final String	CERT_NICKNAME	= NAME + "Cert";
			
			final SSLConfig ssl = listener.createSSLConfig( CERT_NICKNAME, null);
			assert ssl != null;
			assert ssl.getCertNickname().equals( CERT_NICKNAME );
			
			listener.removeSSLConfig();
		}
		finally
		{
			remove( NAME );
		}