Search in sources :

Example 1 with DiagnosticServiceConfig

use of com.sun.appserv.management.config.DiagnosticServiceConfig 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);
}
Also used : ConfigConfig(com.sun.appserv.management.config.ConfigConfig) DiagnosticServiceConfig(com.sun.appserv.management.config.DiagnosticServiceConfig)

Aggregations

ConfigConfig (com.sun.appserv.management.config.ConfigConfig)1 DiagnosticServiceConfig (com.sun.appserv.management.config.DiagnosticServiceConfig)1