Methods Summary |
---|
private void | _testCreateStandaloneServerConfig(java.lang.String serverNameSuffix, int basePort)
final ConfigSetup setup = new ConfigSetup( getDomainRoot() );
final Map<String,NodeAgentConfig> nodeAgentConfigs = getDomainConfig().getNodeAgentConfigMap();
if ( nodeAgentConfigs.keySet().size() == 0 )
{
warning( "testCreateStandaloneServerConfig: No node agents available, skipping test." );
}
else
{
// create a server for each node agent
for( final String nodeAgentName : nodeAgentConfigs.keySet() )
{
final String serverName = nodeAgentName + serverNameSuffix;
final String configName = serverName + "-config";
// in case a previous failed run left them around
setup.removeServer( serverName );
setup.removeConfig( configName );
final ConfigConfig config = setup.createConfig( configName );
assert( configName.equals( config.getName() ) );
// sanity check
final Map<String,Object> attrs = Util.getExtra( config ).getAllAttributes();
try
{
final StandaloneServerConfig server =
setup.createServer( serverName, basePort, nodeAgentName, config.getName() );
// it worked, get rid of it
setup.removeServer( server.getName() );
}
catch( Throwable t)
{
assert false : ExceptionUtil.toString( t );
}
finally
{
try
{
setup.removeConfig( config.getName() );
}
catch( Exception ee )
{
// we wanted to get rid of it...oh well.
}
}
}
}
|
public static com.sun.appserv.management.config.StandaloneServerConfig | ensureDefaultInstance(com.sun.appserv.management.DomainRoot domainRoot)We want the default instance to be available on both PE and EE
so we have no choice but to use the DAS instance.
final Map<String,StandaloneServerConfig> servers =
domainRoot.getDomainConfig().getStandaloneServerConfigMap();
StandaloneServerConfig server = servers.get( getDefaultInstanceName() );
assert( server != null );
return server;
|
public static com.sun.enterprise.management.Capabilities | getCapabilities()
return getOfflineCapableCapabilities( false );
|
public static java.lang.String | getDefaultInstanceName()
return "server";
|
public void | testCreateStandaloneServerConfig()
final int basePort = 52788;
_testCreateStandaloneServerConfig( ".StandaloneServerConfigTest", basePort );
|
public void | testCreateStandaloneServerConfigWithDefaults()
final int basePort = 0; // use the defaults
_testCreateStandaloneServerConfig( ".StandaloneServerConfigTestWithDefaults", basePort);
|