use of com.sun.appserv.management.config.ConfigConfig in project Payara by payara.
the class AMXTestBase method getModuleMonitoringLevelsConfig.
protected ModuleMonitoringLevelsConfig getModuleMonitoringLevelsConfig(final String configName) {
final ConfigConfig cc = configName == null ? getConfigConfig() : getConfigConfig(configName);
assert (cc != null);
final ModuleMonitoringLevelsConfig mon = cc.getMonitoringServiceConfig().getModuleMonitoringLevelsConfig();
return (mon);
}
use of com.sun.appserv.management.config.ConfigConfig in project Payara by payara.
the class RunMeFirstTest method initCoverageInfos.
private void initCoverageInfos() {
final Set<AMX> all = getAllAMX();
// set the AMX-DEBUG flags on
final String AMX_DEBUG = "-DAMX-DEBUG.enabled=true";
final String AMX_DEBUG2 = "-DAMX-DEBUG=true";
// set AMX-DEBUG.enabled=true in all ConfigConfig JVM options
final Map<String, ConfigConfig> configs = getDomainConfig().getConfigsConfig().getConfigConfigMap();
for (final ConfigConfig config : configs.values()) {
final JavaConfig jc = config.getJavaConfig();
final String[] opt = jc.getJVMOptions();
final Set<String> jvmOptions = GSetUtil.newStringSet(opt == null ? new String[0] : opt);
if (!(jvmOptions.contains(AMX_DEBUG) || jvmOptions.contains(AMX_DEBUG2))) {
jvmOptions.add(AMX_DEBUG);
jc.setJVMOptions(GSetUtil.toStringArray(jvmOptions));
// don't warn for default-config; it's not used by a running server
if (!config.getName().equals("default-config")) {
warning("Enabled AMX-DEBUG for config " + config.getName() + " (restart required)");
}
}
}
// setup default stuff
final AMXDebugSupportMBean debug = getAMXDebugSupportMBean();
debug.setAll(true);
debug.setDefaultDebug(true);
debug.getOutputIDs();
for (final AMX amx : all) {
final AMXDebugStuff debugStuff = getTestUtil().asAMXDebugStuff(amx);
if (debugStuff == null) {
continue;
}
try {
debugStuff.enableAMXDebug(true);
} catch (Throwable t) {
warning("Couldn't enableAMXDebug() for " + amx.getJ2EEType());
}
try {
debugStuff.enableCoverageInfo(true);
debugStuff.clearCoverageInfo();
} catch (Throwable t) {
warning("Couldn't enableCoverageInfo for " + amx.getJ2EEType());
}
}
}
use of com.sun.appserv.management.config.ConfigConfig in project Payara by payara.
the class ConfigConfigTest method ensureDefaultInstance.
public static ConfigConfig ensureDefaultInstance(final DomainRoot domainRoot) {
ConfigConfig config = null;
final DomainConfig domainConfig = domainRoot.getDomainConfig();
final Map<String, ConfigConfig> existing = domainConfig.getConfigsConfig().getConfigConfigMap();
if (supportsMultipleServers(domainRoot)) {
config = existing.get(getDefaultInstanceName(domainRoot));
if (config == null) {
final ConfigSetup setup = new ConfigSetup(domainRoot);
config = setup.createConfig(getDefaultInstanceName(domainRoot));
}
} else {
config = existing.get(PE_CONFIG_NAME);
assert (config != null) : "No config named " + StringUtil.quote(PE_CONFIG_NAME);
}
return config;
}
use of com.sun.appserv.management.config.ConfigConfig in project Payara by payara.
the class ConfigConfigTest method testCreateRemove.
public void testCreateRemove() throws Throwable {
if (!checkNotOffline("testCreateRemove")) {
return;
}
final String NAME = "ConfigConfigTest.testCreateRemove";
final Map<String, ConfigConfig> before = getDomainConfig().getConfigsConfig().getConfigConfigMap();
final int NUM = 2;
final ConfigConfig[] configs = new ConfigConfig[NUM];
for (int i = 0; i < NUM; ++i) {
configs[i] = create(NAME + i);
}
final ConfigSetup setup = new ConfigSetup(getDomainRoot());
for (final ConfigConfig config : configs) {
setup.removeConfig(config.getName());
// verify that the config is gone
try {
Util.getExtra(config).getAllAttributes();
fail("Config " + config.getName() + " should no longer exist");
} catch (Exception e) {
// good, we expected to be here
}
}
final Map<String, ConfigConfig> after = getDomainConfig().getConfigsConfig().getConfigConfigMap();
assert (before.keySet().equals(after.keySet()));
}
use of com.sun.appserv.management.config.ConfigConfig in project Payara by payara.
the class ConfigRunMeFirstTest method setupConfig.
private void setupConfig() {
final DomainConfig dc = getDomainConfig();
final ConfigConfig cc = getConfigConfig();
final SecurityServiceConfig ss = cc.getSecurityServiceConfig();
final AdminServiceConfig as = cc.getAdminServiceConfig();
AuditModuleConfigTest.ensureDefaultInstance(ss);
AuthRealmConfigTest.ensureDefaultInstance(ss);
ConnectorConnectionPoolConfigTest.ensureDefaultInstance(dc);
JMXConnectorConfigTest.ensureDefaultInstance(as);
ResourceAdapterConfigTest.ensureDefaultInstance(dc);
AdminObjectResourceConfigTest.ensureDefaultInstance(dc);
JDBCConnectionPoolConfigTest.ensureDefaultInstance(dc);
JDBCResourceConfigTest.ensureDefaultInstance(dc);
JNDIResourceConfigTest.ensureDefaultInstance(dc);
ConnectorResourceConfigTest.ensureDefaultInstance(dc);
CustomMBeanConfigTest.ensureDefaultInstance(dc);
JACCProviderConfigTest.ensureDefaultInstance(ss);
MailResourceConfigTest.ensureDefaultInstance(dc);
ThreadPoolConfigTest.ensureDefaultInstance(cc);
PersistenceManagerFactoryResourceConfigTest.ensureDefaultInstance(dc);
CustomResourceConfigTest.ensureDefaultInstance(dc);
ProfilerConfigTest.ensureDefaultInstance(cc.getJavaConfig());
}
Aggregations