use of com.sun.appserv.management.config.ClusteredServerConfig in project Payara by payara.
the class ClusteredServerConfigTest method createClusteredServer.
public ClusteredServerConfig createClusteredServer(final String serverName, final String nodeAgentName, final int basePort) {
final DomainConfig domainConfig = getDomainConfig();
if (domainConfig.getServersConfig().getClusteredServerConfigMap().get(serverName) != null) {
domainConfig.getServersConfig().removeClusteredServerConfig(serverName);
} else if (domainConfig.getServersConfig().getStandaloneServerConfigMap().get(serverName) != null) {
domainConfig.getServersConfig().removeStandaloneServerConfig(serverName);
}
final ClusterConfig clusterConfig = ClusterConfigTest.ensureDefaultInstance(domainConfig);
if (domainConfig.getServersConfig().getClusteredServerConfigMap().get(serverName) != null) {
domainConfig.getServersConfig().removeClusteredServerConfig(serverName);
assert domainConfig.getServersConfig().getClusteredServerConfigMap().get(serverName) == null;
}
final ConfigSetup setup = new ConfigSetup(getDomainRoot());
final Map<String, String> options = new HashMap<String, String>();
setup.setupServerPorts(options, basePort);
final ClusteredServerConfig csc = domainConfig.getServersConfig().createClusteredServerConfig(serverName, clusterConfig.getName(), nodeAgentName, options);
sanityCheck(csc);
return csc;
}
use of com.sun.appserv.management.config.ClusteredServerConfig in project Payara by payara.
the class ClusteredServerConfigTest method testCreateRemove.
public void testCreateRemove() {
final DomainConfig domainConfig = getDomainConfig();
final NodeAgentConfig nodeAgentConfig = getDASNodeAgentConfig();
if (nodeAgentConfig == null) {
warning("SKIPPING ClusteredServerConfigTest.testCreateRemove: " + "no DAS Node Agent has been specified; use " + PropertyKeys.DAS_NODE_AGENT_NAME);
} else {
final int NUM = 5;
final String baseName = "ClusteredServerConfigTest";
verifyRefContainers();
final ClusteredServerConfig[] servers = new ClusteredServerConfig[NUM];
for (int i = 0; i < NUM; ++i) {
final int basePort = 11000 + i * 10;
servers[i] = createClusteredServer(baseName + "-" + i, nodeAgentConfig.getName(), basePort);
printVerbose("Created ClusteredServerConfig: " + servers[i].getName());
assert XTypes.CLUSTERED_SERVER_CONFIG.equals(servers[i].getJ2EEType());
verifyRefContainers();
}
for (int i = 0; i < NUM; ++i) {
final String name = servers[i].getName();
domainConfig.getServersConfig().removeClusteredServerConfig(name);
printVerbose("Removed ClusteredServerConfig: " + name);
}
}
}
Aggregations