Methods Summary |
---|
com.sun.appserv.management.config.MailResourceConfig | createMailResourceConfig()
final MailResourceConfig mr =
getDomainConfig().createMailResourceConfig(
MAIL_RESOURCE_NAME,
"localhost",
"mailuser@domain.com",
"mailfrom@domain.com",
null );
return mr;
|
com.sun.appserv.management.config.MailResourceConfig | ensureMailResourceConfig()
final Map<String,MailResourceConfig> mails =
getDomainConfig().getMailResourceConfigMap();
MailResourceConfig mr = mails.get( MAIL_RESOURCE_NAME );
if ( mr == null )
{
mr = createMailResourceConfig();
}
return mr;
|
void | removeMailResourceConfig()
final Map<String,MailResourceConfig> mails =
getDomainConfig().getMailResourceConfigMap();
MailResourceConfig mr = mails.get( MAIL_RESOURCE_NAME );
if ( mr != null )
{
getDomainConfig().removeMailResourceConfig( mr.getName() );
}
|
public void | testCreateAndRemoveResourceRefStandaloneServer()
if ( ! checkNotOffline( "testCreateRemove" ) )
{
return;
}
final Map<String,AppserverConnectionSource> nodeAgents =
getNodeAgents();
if ( nodeAgents.keySet().size() == 0 )
{
warning(
"testCreateAndRemoveResourceRefStandaloneServer: no Node Agents--SKIPPING TEST" );
return;
}
final String nodeAgentName = nodeAgents.keySet().iterator().next();
final ConfigSetup setup = new ConfigSetup( getDomainRoot() );
ensureMailResourceConfig();
final String serverName = "testCreateAndRemoveResourceRefStandaloneServer";
final String configName = serverName + "-config";
final ConfigConfig config = setup.createConfig( configName );
try
{
final int basePort = 34770;
final StandaloneServerConfig server =
setup.createServer( serverName, basePort, nodeAgentName, configName );
try
{
final ResourceRefConfig ref =
server.createResourceRefConfig( MAIL_RESOURCE_NAME );
assert( ref != null );
server.removeResourceRefConfig( ref.getName() );
}
catch( Exception e )
{
setup.removeServer( serverName );
throw e;
}
finally
{
removeMailResourceConfig();
}
}
catch( Exception e )
{
setup.removeConfig( configName );
throw e;
}
|
public void | testCreateRefToMissingTarget()
if ( ! checkNotOffline( "testCreateRemove" ) )
{
return;
}
final String MISSING_NAME = "NonExistent";
final DomainConfig domainConfig = getDomainRoot().getDomainConfig();
final StandaloneServerConfig serverConfig =
domainConfig.getStandaloneServerConfigMap().get( "server" );
try
{
serverConfig.createResourceRefConfig( MISSING_NAME );
assert false;
serverConfig.createDeployedItemRefConfig( MISSING_NAME );
assert false;
}
catch( Exception e )
{
// good
}
|