diff options
Diffstat (limited to 'base/server/cmscore/src/com/netscape/cmscore')
-rw-r--r-- | base/server/cmscore/src/com/netscape/cmscore/selftests/SelfTestSubsystem.java | 75 |
1 files changed, 39 insertions, 36 deletions
diff --git a/base/server/cmscore/src/com/netscape/cmscore/selftests/SelfTestSubsystem.java b/base/server/cmscore/src/com/netscape/cmscore/selftests/SelfTestSubsystem.java index 14fab26e4..4b89aa49e 100644 --- a/base/server/cmscore/src/com/netscape/cmscore/selftests/SelfTestSubsystem.java +++ b/base/server/cmscore/src/com/netscape/cmscore/selftests/SelfTestSubsystem.java @@ -501,16 +501,11 @@ public class SelfTestSubsystem Enumeration<SelfTestOrderedInstance> instances = mOnDemandOrder.elements(); while (instances.hasMoreElements()) { - SelfTestOrderedInstance instance = instances.nextElement(); - String instanceFullName = null; + SelfTestOrderedInstance instance = instances.nextElement(); String instanceName = instance.getSelfTestName(); - if (instanceName != null) { - instanceName = instanceName.trim(); - instanceFullName = getFullName(mPrefix, - instanceName); - } else { + if (instanceName == null) { log(mLogger, CMS.getLogMessage( "CMSCORE_SELFTESTS_PROPERTY_NAME_IS_NULL")); @@ -518,37 +513,11 @@ public class SelfTestSubsystem throw new EMissingSelfTestException(); } - if (mSelfTestInstances.containsKey(instanceName)) { - ISelfTest test = mSelfTestInstances.get(instanceName); - - try { - if (CMS.debugOn()) { - CMS.debug("SelfTestSubsystem::runSelfTestsOnDemand():" - + " running \"" - + test.getSelfTestName() - + "\""); - } - - test.runSelfTest(mLogger); - - } catch (Exception e) { - - CMS.debug(e); - - // Check to see if the self test was critical: - if (isSelfTestCriticalOnDemand(instanceName)) { - log(mLogger, - CMS.getLogMessage( - "CMSCORE_SELFTESTS_RUN_ON_DEMAND_FAILED", - instanceFullName)); + instanceName = instanceName.trim(); - // shutdown the system gracefully - CMS.shutdown(); + String instanceFullName = getFullName(mPrefix, instanceName); - return; - } - } - } else { + if (!mSelfTestInstances.containsKey(instanceName)) { // self test plugin instance property name is not present log(mLogger, CMS.getLogMessage( @@ -557,6 +526,27 @@ public class SelfTestSubsystem throw new EMissingSelfTestException(instanceFullName); } + + try { + runSelfTest(instanceName); + + } catch (Exception e) { + + CMS.debug(e); + + // Check to see if the self test was critical: + if (isSelfTestCriticalOnDemand(instanceName)) { + log(mLogger, + CMS.getLogMessage( + "CMSCORE_SELFTESTS_RUN_ON_DEMAND_FAILED", + instanceFullName)); + + // shutdown the system gracefully + CMS.shutdown(); + + return; + } + } } if (CMS.debugOn()) { @@ -565,6 +555,19 @@ public class SelfTestSubsystem } } + public void runSelfTest(String instanceName) throws Exception { + + CMS.debug("SelfTestSubsystem.runSelfTest(" + instanceName + ")"); + + ISelfTest test = mSelfTestInstances.get(instanceName); + + if (test == null) { + throw new EMissingSelfTestException(instanceName); + } + + test.runSelfTest(mLogger); + } + // // methods associated with the list of startup self tests // |