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

MessageSecurityConfigTest

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

Fields Summary
private static final String
AUTH_TYPE
Constructors Summary
public MessageSecurityConfigTest()

	
Methods Summary
private static com.sun.appserv.management.config.MessageSecurityConfigcreate(com.sun.appserv.management.DomainRoot domainRoot, java.lang.String authLayer)

        final SecurityServiceConfig ss = getDefaultSecurityServiceConfig( domainRoot );
        
        final Map<String,String>    optional   = new HashMap<String,String>();
        final MessageSecurityConfig msc = ss.createMessageSecurityConfig( authLayer,
                "ClientProvider", ProviderConfig.PROVIDER_TYPE_CLIENT, 
                "com.sun.xml.wss.provider.ClientSecurityAuthModul", optional );
        
        msc.createProviderConfig( "ServerProvider",
           ProviderConfig.PROVIDER_TYPE_SERVER, "com.sun.xml.wss.provider.ServerSecurityAuthModule", optional );
           
        msc.createProviderConfig( "DummyProvider1",
           ProviderConfig.PROVIDER_TYPE_SERVER, "AMX.TEST.DummySecurityAuthModule", optional );
           
        msc.createProviderConfig( "DummyProvider2",
           ProviderConfig.PROVIDER_TYPE_SERVER, "AMX.TEST.DummySecurityAuthModule", optional );
        
        msc.removeProviderConfig( "DummyProvider1" );
        msc.removeProviderConfig( "DummyProvider2" );
        
        return msc;
    
private static com.sun.appserv.management.config.SecurityServiceConfiggetDefaultSecurityServiceConfig(com.sun.appserv.management.DomainRoot domainRoot)

        final ConfigConfig  config  = ConfigConfigTest.ensureDefaultInstance( domainRoot );
        final SecurityServiceConfig ss  = config.getSecurityServiceConfig();
        assert( ss != null );
        return ss;
    
public voidtestCreateRemove()
Note: this can't be tested except by making a new one, and the names are predefined, so if it already exists, it must be deleted first.

    
                                                 
         
	 
	
        final SecurityServiceConfig ss  = getDefaultSecurityServiceConfig( getDomainRoot() );
        final Map<String,MessageSecurityConfig> messageSecurityConfigs = ss.getMessageSecurityConfigMap();
        MessageSecurityConfig   msc = messageSecurityConfigs.get( AUTH_TYPE );
        
        if ( msc != null )
        {
            ss.removeMessageSecurityConfig( AUTH_TYPE );
            msc = null;
        }
        
        msc = create( getDomainRoot(), AUTH_TYPE );
        
        ss.removeMessageSecurityConfig( AUTH_TYPE );