use of com.sun.appserv.management.config.ConfigConfig in project Payara by payara.
the class ConfigConfigTest method create.
private ConfigConfig create(final String name) throws Throwable {
final ConfigSetup setup = new ConfigSetup(getDomainRoot());
setup.removeConfig(name);
final ConfigConfig config = setup.createConfig(name);
assert (name.equals(config.getName()));
// see that it responds to a request
final Map<String, Object> attrs = Util.getExtra(config).getAllAttributes();
return config;
}
use of com.sun.appserv.management.config.ConfigConfig in project Payara by payara.
the class ConfigSetup method createConfig.
public ConfigConfig createConfig(final String name) {
final Map<String, String> options = new HashMap<String, String>();
final ConfigConfig config = getDomainConfig().getConfigsConfig().createConfigConfig(name, options);
return config;
}
use of com.sun.appserv.management.config.ConfigConfig in project Payara by payara.
the class DiagnosticServiceConfigTest method testCreateRemove.
public void testCreateRemove() {
final ConfigConfig config = getConfigConfig();
// set defaults
String computeChecksum = "" + true;
String captureInstallLog = "" + true;
String captureSystemInfo = "" + true;
String captureHADBInfo = "" + true;
String captureAppDD = "" + true;
String verifyConfig = "" + true;
String minLogLevel = Level.INFO.toString();
String maxLongEntries = "10000";
DiagnosticServiceConfig ds = config.getDiagnosticServiceConfig();
if (ds != null) {
// remember current settings
computeChecksum = ds.getComputeChecksum();
captureInstallLog = ds.getCaptureInstallLog();
captureSystemInfo = ds.getCaptureSystemInfo();
captureHADBInfo = ds.getCaptureHADBInfo();
captureAppDD = ds.getCaptureAppDD();
verifyConfig = ds.getVerifyConfig();
minLogLevel = ds.getMinLogLevel();
maxLongEntries = ds.getMaxLogEntries();
config.removeDiagnosticServiceConfig();
ds = null;
}
ds = config.createDiagnosticServiceConfig();
config.removeDiagnosticServiceConfig();
ds = null;
// re-create it so one stays around
ds = config.createDiagnosticServiceConfig();
ds.setComputeChecksum(computeChecksum);
ds.setCaptureInstallLog(captureInstallLog);
ds.setCaptureSystemInfo(captureSystemInfo);
ds.setCaptureHADBInfo(captureHADBInfo);
ds.setCaptureAppDD(captureAppDD);
ds.setVerifyConfig(verifyConfig);
ds.setMinLogLevel(minLogLevel);
ds.setMaxLogEntries(maxLongEntries);
}
use of com.sun.appserv.management.config.ConfigConfig in project Payara by payara.
the class ReferencesTest method testCreateAndRemoveResourceRefStandaloneServer.
public void testCreateAndRemoveResourceRefStandaloneServer() throws Exception {
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;
}
}
use of com.sun.appserv.management.config.ConfigConfig in project Payara by payara.
the class StandaloneServerConfigTest method _testCreateStandaloneServerConfig.
private void _testCreateStandaloneServerConfig(final String serverNameSuffix, final int basePort) {
final ConfigSetup setup = new ConfigSetup(getDomainRoot());
final Map<String, NodeAgentConfig> nodeAgentConfigs = getDomainConfig().getNodeAgentsConfig().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.
}
}
}
}
}
Aggregations