summaryrefslogtreecommitdiffstats
path: root/pki/base/common/src/com/netscape/cms/selftests/ASelfTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'pki/base/common/src/com/netscape/cms/selftests/ASelfTest.java')
-rw-r--r--pki/base/common/src/com/netscape/cms/selftests/ASelfTest.java93
1 files changed, 54 insertions, 39 deletions
diff --git a/pki/base/common/src/com/netscape/cms/selftests/ASelfTest.java b/pki/base/common/src/com/netscape/cms/selftests/ASelfTest.java
index bc9a5b75c..df7f02bca 100644
--- a/pki/base/common/src/com/netscape/cms/selftests/ASelfTest.java
+++ b/pki/base/common/src/com/netscape/cms/selftests/ASelfTest.java
@@ -20,6 +20,7 @@
package com.netscape.cms.selftests;
+
///////////////////////
// import statements //
///////////////////////
@@ -36,6 +37,7 @@ import com.netscape.certsrv.selftests.ESelfTestException;
import com.netscape.certsrv.selftests.ISelfTest;
import com.netscape.certsrv.selftests.ISelfTestSubsystem;
+
//////////////////////
// class definition //
//////////////////////
@@ -48,14 +50,17 @@ import com.netscape.certsrv.selftests.ISelfTestSubsystem;
* @author thomask
* @version $Revision$, $Date$
*/
-public abstract class ASelfTest implements ISelfTest {
- // //////////////////////
+public abstract class ASelfTest
+ implements ISelfTest {
+ ////////////////////////
// default parameters //
- // //////////////////////
+ ////////////////////////
+
+
- // ////////////////////////
+ //////////////////////////
// ISelfTest parameters //
- // ////////////////////////
+ //////////////////////////
// parameter information
private static final String SELF_TEST_NAME = "ASelfTest";
@@ -66,29 +71,34 @@ public abstract class ASelfTest implements ISelfTest {
protected IConfigStore mConfig = null;
protected String mPrefix = null;
- // ///////////////////
+ /////////////////////
// default methods //
- // ///////////////////
+ /////////////////////
- // /////////////////////
+
+
+ ///////////////////////
// ISelfTest methods //
- // /////////////////////
+ ///////////////////////
/**
- * Initializes this subsystem with the configuration store associated with
- * this instance name.
+ * Initializes this subsystem with the configuration store
+ * associated with this instance name.
* <P>
- *
+ *
* @param subsystem the associated subsystem
- * @param instanceName the name of this self test instance
+ * @param instanceName the name of this self test instance
* @param parameters configuration store (self test parameters)
* @exception EDuplicateSelfTestException subsystem has duplicate name/value
* @exception EInvalidSelfTestException subsystem has invalid name/value
* @exception EMissingSelfTestException subsystem has missing name/value
*/
- public void initSelfTest(ISelfTestSubsystem subsystem, String instanceName,
- IConfigStore parameters) throws EDuplicateSelfTestException,
- EInvalidSelfTestException, EMissingSelfTestException {
+ public void initSelfTest(ISelfTestSubsystem subsystem,
+ String instanceName,
+ IConfigStore parameters)
+ throws EDuplicateSelfTestException,
+ EInvalidSelfTestException,
+ EMissingSelfTestException {
// store individual self test class values for this instance
mSelfTestSubsystem = (ISelfTestSubsystem) subsystem;
@@ -97,9 +107,10 @@ public abstract class ASelfTest implements ISelfTest {
if (instanceName != null) {
instanceName = instanceName.trim();
} else {
- mSelfTestSubsystem.log(mSelfTestSubsystem.getSelfTestLogger(), CMS
- .getLogMessage("SELFTESTS_PARAMETER_WAS_NULL",
- SELF_TEST_NAME));
+ mSelfTestSubsystem.log(mSelfTestSubsystem.getSelfTestLogger(),
+ CMS.getLogMessage(
+ "SELFTESTS_PARAMETER_WAS_NULL",
+ SELF_TEST_NAME));
throw new EMissingSelfTestException();
}
@@ -112,13 +123,15 @@ public abstract class ASelfTest implements ISelfTest {
mConfig = parameters.getSubStore(pluginPath);
- if ((mConfig != null) && (mConfig.getName() != null)
- && (mConfig.getName() != "")) {
+ if ((mConfig != null) &&
+ (mConfig.getName() != null) &&
+ (mConfig.getName() != "")) {
mPrefix = mConfig.getName().trim();
} else {
- mSelfTestSubsystem.log(mSelfTestSubsystem.getSelfTestLogger(), CMS
- .getLogMessage("SELFTESTS_PARAMETER_WAS_NULL",
- SELF_TEST_NAME));
+ mSelfTestSubsystem.log(mSelfTestSubsystem.getSelfTestLogger(),
+ CMS.getLogMessage(
+ "SELFTESTS_PARAMETER_WAS_NULL",
+ SELF_TEST_NAME));
throw new EMissingSelfTestException();
}
@@ -129,23 +142,24 @@ public abstract class ASelfTest implements ISelfTest {
/**
* Notifies this subsystem if it is in execution mode.
* <P>
- *
+ *
* @exception ESelfTestException failed to start
*/
- public abstract void startupSelfTest() throws ESelfTestException;
+ public abstract void startupSelfTest()
+ throws ESelfTestException;
/**
- * Stops this subsystem. The subsystem may call shutdownSelfTest anytime
- * after initialization.
+ * Stops this subsystem. The subsystem may call shutdownSelfTest
+ * anytime after initialization.
* <P>
*/
public abstract void shutdownSelfTest();
/**
- * Returns the name associated with this self test. This method may return
- * null if the self test has not been intialized.
+ * Returns the name associated with this self test. This method may
+ * return null if the self test has not been intialized.
* <P>
- *
+ *
* @return instanceName of this self test
*/
public String getSelfTestName() {
@@ -153,10 +167,10 @@ public abstract class ASelfTest implements ISelfTest {
}
/**
- * Returns the root configuration storage (self test parameters) associated
- * with this subsystem.
+ * Returns the root configuration storage (self test parameters)
+ * associated with this subsystem.
* <P>
- *
+ *
* @return configuration store (self test parameters) of this subsystem
*/
public IConfigStore getSelfTestConfigStore() {
@@ -164,10 +178,10 @@ public abstract class ASelfTest implements ISelfTest {
}
/**
- * Retrieves description associated with an individual self test. This
- * method may return null.
+ * Retrieves description associated with an individual self test.
+ * This method may return null.
* <P>
- *
+ *
* @param locale locale of the client that requests the description
* @return description of self test
*/
@@ -176,10 +190,11 @@ public abstract class ASelfTest implements ISelfTest {
/**
* Execute an individual self test.
* <P>
- *
+ *
* @param logger specifies logging subsystem
* @exception ESelfTestException self test exception
*/
public abstract void runSelfTest(ILogEventListener logger)
- throws ESelfTestException;
+ throws ESelfTestException;
}
+