diff --git a/integrity-monitor/pom.xml b/integrity-monitor/pom.xml
index 67b035a..4e69cce 100644
--- a/integrity-monitor/pom.xml
+++ b/integrity-monitor/pom.xml
@@ -2,7 +2,7 @@
   ============LICENSE_START=======================================================
   ONAP Policy Engine - Common Modules
   ================================================================================
-  Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+  Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
   ================================================================================
   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
@@ -42,6 +42,11 @@
 			<version>1.2.17</version>
 		</dependency>
 		<dependency>
+			<groupId>org.onap.policy.common</groupId>
+			<artifactId>utils</artifactId>
+			<version>${project.version}</version>
+		</dependency>
+		<dependency>
 			<groupId>junit</groupId>
 			<artifactId>junit</artifactId>
 			<version>4.11</version>
@@ -50,7 +55,7 @@
 		<dependency>
 			<groupId>org.onap.policy.common</groupId>
 			<artifactId>utils-test</artifactId>
-			 <version>${project.version}</version>
+			<version>${project.version}</version>
 			<scope>test</scope>
 		</dependency>
 		<dependency>
diff --git a/integrity-monitor/src/main/java/org/onap/policy/common/im/IntegrityMonitor.java b/integrity-monitor/src/main/java/org/onap/policy/common/im/IntegrityMonitor.java
index 17223ba..d272d1c 100644
--- a/integrity-monitor/src/main/java/org/onap/policy/common/im/IntegrityMonitor.java
+++ b/integrity-monitor/src/main/java/org/onap/policy/common/im/IntegrityMonitor.java
@@ -1,8 +1,8 @@
-/*-
+/*
  * ============LICENSE_START=======================================================
  * Integrity Monitor
  * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -29,6 +29,8 @@
 import java.util.Map;
 import java.util.Map.Entry;
 import java.util.Properties;
+import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
 
 import javax.management.JMX;
@@ -42,12 +44,12 @@
 import javax.persistence.Query;
 import javax.validation.constraints.NotNull;
 
-import org.onap.policy.common.im.jpa.ForwardProgressEntity;
-import org.onap.policy.common.im.jpa.ResourceRegistrationEntity;
-import org.onap.policy.common.im.jpa.StateManagementEntity;
 import org.onap.policy.common.im.jmx.ComponentAdmin;
 import org.onap.policy.common.im.jmx.ComponentAdminMBean;
 import org.onap.policy.common.im.jmx.JmxAgentConnection;
+import org.onap.policy.common.im.jpa.ForwardProgressEntity;
+import org.onap.policy.common.im.jpa.ResourceRegistrationEntity;
+import org.onap.policy.common.im.jpa.StateManagementEntity;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -56,8 +58,7 @@
  * managing its state. State management follows the X.731 ITU standard.
  */
 public class IntegrityMonitor {
-	private static final Logger logger = LoggerFactory
-			.getLogger(IntegrityMonitor.class.getName());
+	private static final Logger logger = LoggerFactory.getLogger(IntegrityMonitor.class.getName());
 
 	// only allow one instance of IntegrityMonitor
 	private static IntegrityMonitor instance = null;
@@ -76,12 +77,22 @@
 	private EntityManager em;
 
 	// Persistence Unit for JPA
-	private static final String PERSISTENCE_UNIT = "operationalPU";
+	public static final String PERSISTENCE_UNIT = "operationalPU";
+
+	private static String persistenceUnit = PERSISTENCE_UNIT;
+
+	private static final long CYCLE_INTERVAL_MILLIS = 1000l;
+
+	private static long cycleIntervalMillis = CYCLE_INTERVAL_MILLIS;
+
+	/**
+	 * Units used for intervals extracted from the properties, which are
+	 * typically given in seconds.
+	 */
+	private static TimeUnit propertyUnits = TimeUnit.SECONDS;
 
 	private StateManagement stateManager = null;
 
-	private static final int CYCLE_INTERVAL_MILLIS = 1000;
-
 	private FPManager fpManager = null;
 
 	// The forward progress counter is incremented as the
@@ -118,17 +129,17 @@
 	private int missedCycles = 0;
 
 	// forward progress monitoring interval
-	private static int monitorInterval = IntegrityMonitorProperties.DEFAULT_MONITOR_INTERVAL;
+	private static long monitorIntervalMs = 1000L * IntegrityMonitorProperties.DEFAULT_MONITOR_INTERVAL;
 	// The number of periods the counter fails to increment before an alarm is
 	// raised.
 	private static int failedCounterThreshold = IntegrityMonitorProperties.DEFAULT_FAILED_COUNTER_THRESHOLD;
 	// test transaction interval
-	private static int testTransInterval = IntegrityMonitorProperties.DEFAULT_TEST_INTERVAL;
+	private static long testTransIntervalMs = 1000L * IntegrityMonitorProperties.DEFAULT_TEST_INTERVAL;
 	// write Fpc to DB interval
-	private static int writeFpcInterval = IntegrityMonitorProperties.DEFAULT_WRITE_FPC_INTERVAL;
+	private static long writeFpcIntervalMs = 1000L * IntegrityMonitorProperties.DEFAULT_WRITE_FPC_INTERVAL;
 	// check the health of dependencies
-	private static int checkDependencyInterval = IntegrityMonitorProperties.DEFAULT_CHECK_DEPENDENCY_INTERVAL;
-	
+	private static long checkDependencyIntervalMs = 1000L
+			* IntegrityMonitorProperties.DEFAULT_CHECK_DEPENDENCY_INTERVAL;
 
 	// A lead subsystem will have dependency groups with resource names in the
 	// properties file.
@@ -136,16 +147,16 @@
 	private static String[] depGroups = null;
 
 	private static boolean isUnitTesting = false;
-	
+
 	// can turn on health checking of dependents via jmx test() call by setting
 	// this property to true
 	private static boolean testViaJmx = false;
 
 	private static String jmxFqdn = null;
 
-	// this is the max interval seconds allowed without any forward progress
+	// this is the max interval allowed without any forward progress
 	// counter updates
-	private static int maxFpcUpdateInterval = IntegrityMonitorProperties.DEFAULT_MAX_FPC_UPDATE_INTERVAL;
+	private static long maxFpcUpdateIntervalMs = 1000L * IntegrityMonitorProperties.DEFAULT_MAX_FPC_UPDATE_INTERVAL;
 
 	// Node types
 	private enum NodeType {
@@ -171,7 +182,7 @@
 	private static final Object getInstanceLock = new Object();
 	private final Object refreshStateAuditLock = new Object();
 	private final Object imFlushLock = new Object();
-	
+
 	private Map<String, String> allSeemsWellMap;
 	private Map<String, String> allNotWellMap;
 
@@ -187,9 +198,30 @@
 	 * @param properties
 	 *            a set of properties passed in from the resource
 	 * @throws Exception
-	 *             if any errors are encountered in the consructor
+	 *             if any errors are encountered in the constructor
 	 */
-	protected IntegrityMonitor(String resourceName, Properties properties)
+	protected IntegrityMonitor(String resourceName, Properties properties) throws Exception {
+
+		this(resourceName, properties, null);
+	}
+
+	/**
+	 * IntegrityMonitor constructor. It is invoked from the getInstance() method
+	 * in this class or from the constructor of a child or sub-class. A class
+	 * can extend the IntegrityMonitor class if there is a need to override any
+	 * of the base methods (ex. subsystemTest()). Only one instance is allowed
+	 * to be created per resource name.
+	 * 
+	 * @param resourceName
+	 *            The resource name of the resource
+	 * @param properties
+	 *            a set of properties passed in from the resource
+	 * @param queue
+	 *            queue to use to control the FPManager thread, or {@code null}
+	 * @throws Exception
+	 *             if any errors are encountered in the constructor
+	 */
+	protected IntegrityMonitor(String resourceName, Properties properties, BlockingQueue<CountDownLatch> queue)
 			throws Exception {
 
 		// singleton check since this constructor can be called from a child or
@@ -197,8 +229,7 @@
 		if (instance != null) {
 			String msg = "IM object exists and only one instance allowed";
 			logger.error("{}", msg);
-			throw new IntegrityMonitorException(
-					"IntegrityMonitor constructor exception: " + msg);
+			throw new IntegrityMonitorException("IntegrityMonitor constructor exception: " + msg);
 		}
 		instance = this;
 
@@ -216,17 +247,13 @@
 		//
 		// Create the entity manager factory
 		//
-		emf = Persistence.createEntityManagerFactory(PERSISTENCE_UNIT,
-				properties);
+		emf = Persistence.createEntityManagerFactory(persistenceUnit, properties);
 		//
 		// Did it get created?
 		//
 		if (emf == null) {
-			logger.error(
-					"Error creating IM entity manager factory with persistence unit: {}",
-					PERSISTENCE_UNIT);
-			throw new IntegrityMonitorException(
-					"Unable to create IM Entity Manager Factory");
+			logger.error("Error creating IM entity manager factory with persistence unit: {}", persistenceUnit);
+			throw new IntegrityMonitorException("Unable to create IM Entity Manager Factory");
 		}
 
 		// add entry to forward progress and resource registration tables in DB
@@ -240,13 +267,11 @@
 		try {
 			// if ForwardProgress entry exists for resourceName, update it. If
 			// not found, create a new entry
-			Query fquery = em
-					.createQuery("Select f from ForwardProgressEntity f where f.resourceName=:rn");
+			Query fquery = em.createQuery("Select f from ForwardProgressEntity f where f.resourceName=:rn");
 			fquery.setParameter("rn", resourceName);
 
 			@SuppressWarnings("rawtypes")
-			List fpList = fquery.setLockMode(LockModeType.NONE)
-					.setFlushMode(FlushModeType.COMMIT).getResultList();
+			List fpList = fquery.setLockMode(LockModeType.NONE).setFlushMode(FlushModeType.COMMIT).getResultList();
 			ForwardProgressEntity fpx = null;
 			if (!fpList.isEmpty()) {
 				// ignores multiple results
@@ -254,10 +279,8 @@
 				// refresh the object from DB in case cached data was returned
 				em.refresh(fpx);
 				if (logger.isDebugEnabled()) {
-					logger.debug(
-							"Resource {} exists and will be updated - old fpc= {}, lastUpdated= {}",
-							resourceName, fpx.getFpcCount(),
-							fpx.getLastUpdated());
+					logger.debug("Resource {} exists and will be updated - old fpc= {}, lastUpdated= {}", resourceName,
+							fpx.getFpcCount(), fpx.getLastUpdated());
 				}
 				fpx.setFpcCount(fpCounter);
 			} else {
@@ -275,13 +298,11 @@
 
 			// if ResourceRegistration entry exists for resourceName, update it.
 			// If not found, create a new entry
-			Query rquery = em
-					.createQuery("Select r from ResourceRegistrationEntity r where r.resourceName=:rn");
+			Query rquery = em.createQuery("Select r from ResourceRegistrationEntity r where r.resourceName=:rn");
 			rquery.setParameter("rn", resourceName);
 
 			@SuppressWarnings("rawtypes")
-			List rrList = rquery.setLockMode(LockModeType.NONE)
-					.setFlushMode(FlushModeType.COMMIT).getResultList();
+			List rrList = rquery.setLockMode(LockModeType.NONE).setFlushMode(FlushModeType.COMMIT).getResultList();
 			ResourceRegistrationEntity rrx = null;
 			if (!rrList.isEmpty()) {
 				// ignores multiple results
@@ -289,10 +310,8 @@
 				// refresh the object from DB in case cached data was returned
 				em.refresh(rrx);
 				if (logger.isDebugEnabled()) {
-					logger.debug(
-							"Resource {} exists and will be updated - old url= {}, createdDate={}",
-							resourceName, rrx.getResourceUrl(),
-							rrx.getCreatedDate());
+					logger.debug("Resource {} exists and will be updated - old url= {}, createdDate={}", resourceName,
+							rrx.getResourceUrl(), rrx.getCreatedDate());
 				}
 				rrx.setLastUpdated(new Date());
 			} else {
@@ -312,9 +331,7 @@
 			}
 
 		} catch (Exception e) {
-			logger.error(
-					"IntegrityMonitor constructor DB table update failed with exception: ",
-					e);
+			logger.error("IntegrityMonitor constructor DB table update failed with exception: ", e);
 			try {
 				if (et.isActive()) {
 					synchronized (imFlushLock) {
@@ -322,8 +339,7 @@
 					}
 				}
 			} catch (Exception e1) {
-				logger.error("IntegrityMonitor constructor threw exception: ",
-						e1);
+				logger.error("IntegrityMonitor constructor threw exception: ", e1);
 			}
 			throw e;
 		}
@@ -345,11 +361,10 @@
 		try {
 			new ComponentAdmin(resourceName, this, stateManager);
 		} catch (Exception e) {
-			logger.error("ComponentAdmin constructor exception: {}",
-					e.toString(), e);
+			logger.error("ComponentAdmin constructor exception: {}", e.toString(), e);
 		}
 
-		fpManager = new FPManager();
+		fpManager = new FPManager(queue);
 
 	}
 
@@ -367,19 +382,39 @@
 	 *             if unable to create jmx url or the constructor returns an
 	 *             exception
 	 */
-	public static IntegrityMonitor getInstance(String resourceName,
-			Properties properties) throws Exception {
+	public static IntegrityMonitor getInstance(String resourceName, Properties properties) throws Exception {
+		return getInstance(resourceName, properties, null);
+	}
+
+	/**
+	 * Get an instance of IntegrityMonitor for a given resource name. It creates
+	 * one if it does not exist. Only one instance is allowed to be created per
+	 * resource name.
+	 * 
+	 * @param resourceName
+	 *            The resource name of the resource
+	 * @param properties
+	 *            a set of properties passed in from the resource
+	 * @param queue
+	 *            queue to use to control the FPManager thread, or {@code null}
+	 * @return The new instance of IntegrityMonitor
+	 * @throws Exception
+	 *             if unable to create jmx url or the constructor returns an
+	 *             exception
+	 */
+	protected static IntegrityMonitor getInstance(String resourceName, Properties properties,
+			BlockingQueue<CountDownLatch> queue) throws Exception {
+
 		synchronized (getInstanceLock) {
 			logger.debug("getInstance() called - resourceName= {}", resourceName);
-			if (resourceName == null || resourceName.isEmpty()
-					|| properties == null) {
+			if (resourceName == null || resourceName.isEmpty() || properties == null) {
 				logger.error("Error: getIntegrityMonitorInstance() called with invalid input");
 				return null;
 			}
 
 			if (instance == null) {
 				logger.debug("Creating new instance of IntegrityMonitor");
-				instance = new IntegrityMonitor(resourceName, properties);
+				instance = new IntegrityMonitor(resourceName, properties, queue);
 			}
 			return instance;
 		}
@@ -398,28 +433,34 @@
 
 	/*
 	 * This is a facility used by JUnit testing to destroy the IntegrityMonitor
-	 * instance before creating a new one. It includes a delay of 2 seconds to
-	 * allow the FPManager to fully exit.
+	 * instance before creating a new one. It waits a bit to allow the FPManager
+	 * to fully exit.
 	 */
 	public static void deleteInstance() throws IntegrityMonitorException {
 		logger.debug("deleteInstance() called");
-		if (isUnitTesting() && instance != null && instance.getFPManager() != null) {
-			// Stop the FPManager thread
-			instance.getFPManager().stopAndExit();
+		synchronized (getInstanceLock) {
+			if (isUnitTesting() && instance != null && instance.getFPManager() != null) {
+				FPManager fpm = instance.getFPManager();
 
-			try {
-				// Make sure it has exited
-				Thread.sleep(2L * CYCLE_INTERVAL_MILLIS);
-			} catch (InterruptedException e) {
-				logger.error("deleteInstance: Interrupted while waiting for FPManaager to fully exit", e);
-				Thread.currentThread().interrupt();
+				// Stop the FPManager thread
+				fpm.stopAndExit();
+
+				try {
+					// Make sure it has exited
+					fpm.join(2000L);
+				} catch (InterruptedException e) {
+					logger.error("deleteInstance: Interrupted while waiting for FPManaager to fully exit", e);
+					Thread.currentThread().interrupt();
+				}
+
+				if (fpm.isAlive()) {
+					logger.error("IntegrityMonitor.deleteInstance() Failed to kill FPManager thread");
+					throw new IntegrityMonitorException(
+							"IntegrityMonitor.deleteInstance() Failed to kill FPManager thread");
+				}
+
+				instance = null;
 			}
-			if (instance.getFPManager().isAlive()) {
-				logger.error("IntegrityMonitor.deleteInstance() Failed to kill FPManager thread");
-				throw new IntegrityMonitorException(
-						"IntegrityMonitor.deleteInstance() Failed to kill FPManager thread");
-			}
-			instance = null;
 		}
 		logger.debug("deleteInstance() exit");
 	}
@@ -432,25 +473,21 @@
 
 		// get the jmx remote port and construct the JMX URL
 		Properties systemProps = System.getProperties();
-		String jmxPort = systemProps
-				.getProperty("com.sun.management.jmxremote.port");
+		String jmxPort = systemProps.getProperty("com.sun.management.jmxremote.port");
 		String jmxErrMsg;
 		if (jmxPort == null) {
 			jmxErrMsg = "System property com.sun.management.jmxremote.port for JMX remote port is not set";
 			logger.error("{}", jmxErrMsg);
-			throw new IntegrityMonitorException("getJmxUrl exception: "
-					+ jmxErrMsg);
+			throw new IntegrityMonitorException("getJmxUrl exception: " + jmxErrMsg);
 		}
 
 		int port = 0;
 		try {
 			port = Integer.parseInt(jmxPort);
 		} catch (NumberFormatException e) {
-			jmxErrMsg = "JMX remote port is not a valid integer value - "
-					+ jmxPort;
+			jmxErrMsg = "JMX remote port is not a valid integer value - " + jmxPort;
 			logger.error("{}", jmxErrMsg);
-			throw new IntegrityMonitorException("getJmxUrl exception: "
-					+ jmxErrMsg);
+			throw new IntegrityMonitorException("getJmxUrl exception: " + jmxErrMsg);
 		}
 
 		try {
@@ -473,8 +510,7 @@
 		}
 
 		// assemble the jmx url
-		String jmxUrl = "service:jmx:rmi:///jndi/rmi://" + jmxFqdn + ":"
-				+ port + "/jmxrmi";
+		String jmxUrl = "service:jmx:rmi:///jndi/rmi://" + jmxFqdn + ":" + port + "/jmxrmi";
 
 		logger.debug("IntegerityMonitor - jmx url={}", jmxUrl);
 
@@ -495,33 +531,24 @@
 			String errorMsg = dependencyCheckErrorMsg;
 			logger.debug("evaluateSanity dependencyCheckErrorMsg = {}", errorMsg);
 			// check op state and throw exception if disabled
-			if ((stateManager.getOpState() != null)
-					&& stateManager.getOpState().equals(
-							StateManagement.DISABLED)) {
-				String msg = "Resource " + resourceName
-						+ " operation state is disabled. " + errorMsg;
+			if ((stateManager.getOpState() != null) && stateManager.getOpState().equals(StateManagement.DISABLED)) {
+				String msg = "Resource " + resourceName + " operation state is disabled. " + errorMsg;
 				logger.debug("{}", msg);
 				throw new IntegrityMonitorException(msg);
 			}
 
 			// check admin state and throw exception if locked
-			if ((stateManager.getAdminState() != null)
-					&& stateManager.getAdminState().equals(
-							StateManagement.LOCKED)) {
-				String msg = "Resource " + resourceName
-						+ " is administratively locked";
+			if ((stateManager.getAdminState() != null) && stateManager.getAdminState().equals(StateManagement.LOCKED)) {
+				String msg = "Resource " + resourceName + " is administratively locked";
 				logger.debug("{}", msg);
-				throw new AdministrativeStateException(
-						"IntegrityMonitor Admin State Exception: " + msg);
+				throw new AdministrativeStateException("IntegrityMonitor Admin State Exception: " + msg);
 			}
 			// check standby state and throw exception if cold standby
 			if ((stateManager.getStandbyStatus() != null)
-					&& stateManager.getStandbyStatus().equals(
-							StateManagement.COLD_STANDBY)) {
+					&& stateManager.getStandbyStatus().equals(StateManagement.COLD_STANDBY)) {
 				String msg = "Resource " + resourceName + " is cold standby";
 				logger.debug("{}", msg);
-				throw new StandbyStatusException(
-						"IntegrityMonitor Standby Status Exception: " + msg);
+				throw new StandbyStatusException("IntegrityMonitor Standby Status Exception: " + msg);
 			}
 
 		}
@@ -545,13 +572,11 @@
 		et.begin();
 
 		try {
-			Query query = em
-					.createQuery("Select p from ForwardProgressEntity p where p.resourceName=:resource");
+			Query query = em.createQuery("Select p from ForwardProgressEntity p where p.resourceName=:resource");
 			query.setParameter("resource", dep);
 
 			@SuppressWarnings("rawtypes")
-			List fpList = query.setLockMode(LockModeType.NONE)
-					.setFlushMode(FlushModeType.COMMIT).getResultList();
+			List fpList = query.setLockMode(LockModeType.NONE).setFlushMode(FlushModeType.COMMIT).getResultList();
 
 			if (!fpList.isEmpty()) {
 				// exists
@@ -560,8 +585,7 @@
 				em.refresh(forwardProgressEntity);
 				logger.debug("Found entry in ForwardProgressEntity table for dependent Resource={}", dep);
 			} else {
-				errorMsg = dep
-						+ ": resource not found in ForwardProgressEntity database table";
+				errorMsg = dep + ": resource not found in ForwardProgressEntity database table";
 				logger.error("{}", errorMsg);
 			}
 			synchronized (imFlushLock) {
@@ -569,8 +593,7 @@
 			}
 		} catch (Exception ex) {
 			// log an error
-			errorMsg = dep
-					+ ": ForwardProgressEntity DB operation failed with exception: ";
+			errorMsg = dep + ": ForwardProgressEntity DB operation failed with exception: ";
 			logger.error("{}", errorMsg, ex);
 			synchronized (imFlushLock) {
 				if (et.isActive()) {
@@ -585,24 +608,20 @@
 			et.begin();
 			try {
 				// query if StateManagement entry exists for dependent resource
-				Query query = em
-						.createQuery("Select p from StateManagementEntity p where p.resourceName=:resource");
+				Query query = em.createQuery("Select p from StateManagementEntity p where p.resourceName=:resource");
 				query.setParameter("resource", dep);
 
 				@SuppressWarnings("rawtypes")
-				List smList = query.setLockMode(LockModeType.NONE)
-						.setFlushMode(FlushModeType.COMMIT).getResultList();
+				List smList = query.setLockMode(LockModeType.NONE).setFlushMode(FlushModeType.COMMIT).getResultList();
 				if (!smList.isEmpty()) {
 					// exist
-					stateManagementEntity = (StateManagementEntity) smList
-							.get(0);
+					stateManagementEntity = (StateManagementEntity) smList.get(0);
 					// refresh the object from DB in case cached data was
 					// returned
 					em.refresh(stateManagementEntity);
 					logger.debug("Found entry in StateManagementEntity table for dependent Resource={}", dep);
 				} else {
-					errorMsg = dep
-							+ ": resource not found in state management entity database table";
+					errorMsg = dep + ": resource not found in state management entity database table";
 					logger.error("{}", errorMsg);
 				}
 
@@ -611,8 +630,7 @@
 				}
 			} catch (Exception e) {
 				// log an error
-				errorMsg = dep
-						+ ": StateManagementEntity DB read failed with exception: ";
+				errorMsg = dep + ": StateManagementEntity DB read failed with exception: ";
 				logger.error("{}", errorMsg, e);
 				synchronized (imFlushLock) {
 					if (et.isActive()) {
@@ -626,39 +644,37 @@
 		if (errorMsg == null) {
 			if (forwardProgressEntity != null && stateManagementEntity != null) {
 				Date date = new Date();
-				long diffMs = date.getTime()
-						- forwardProgressEntity.getLastUpdated().getTime();
+				long diffMs = date.getTime() - forwardProgressEntity.getLastUpdated().getTime();
 				logger.debug("IntegrityMonitor.stateCheck(): diffMs = {}", diffMs);
 
 				// Threshold for a stale entry
-				long staleMs = 1000L * maxFpcUpdateInterval;
+				long staleMs = maxFpcUpdateIntervalMs;
 				logger.debug("IntegrityMonitor.stateCheck(): staleMs = {}", staleMs);
 
 				if (diffMs > staleMs) {
 					// ForwardProgress is stale. Disable it
 					try {
-						if (!stateManagementEntity.getOpState().equals(
-								StateManagement.DISABLED)) {
+						if (!stateManagementEntity.getOpState().equals(StateManagement.DISABLED)) {
 							logger.debug("IntegrityMonitor.stateCheck(): Changing OpStat = disabled for {}", dep);
 							stateManager.disableFailed(dep);
 						}
 					} catch (Exception e) {
-						String msg = "IntegrityMonitor.stateCheck(): Failed to diableFail dependent resource = "
-								+ dep + "; " + e.getMessage();
+						String msg = "IntegrityMonitor.stateCheck(): Failed to diableFail dependent resource = " + dep
+								+ "; " + e.getMessage();
 						logger.error("{}", msg, e);
 					}
 				}
 			} else {
 
 				if (forwardProgressEntity == null) {
-					String msg = "IntegrityMonitor.stateCheck(): Failed to diableFail dependent resource = "
-							+ dep + "; " + " forwardProgressEntity == null.";
+					String msg = "IntegrityMonitor.stateCheck(): Failed to diableFail dependent resource = " + dep
+							+ "; " + " forwardProgressEntity == null.";
 					logger.error("{}", msg);
 				}
 
 				else {
-					String msg = "IntegrityMonitor.stateCheck(): Failed to diableFail dependent resource = "
-							+ dep + "; " + " stateManagementEntity == null.";
+					String msg = "IntegrityMonitor.stateCheck(): Failed to diableFail dependent resource = " + dep
+							+ "; " + " stateManagementEntity == null.";
 					logger.error("{}", msg);
 				}
 			}
@@ -668,30 +684,25 @@
 		if (errorMsg == null) {
 			if (stateManagementEntity != null) {
 				if ((stateManager.getAdminState() != null)
-						&& stateManagementEntity.getAdminState().equals(
-								StateManagement.LOCKED)) {
+						&& stateManagementEntity.getAdminState().equals(StateManagement.LOCKED)) {
 					errorMsg = dep + ": resource is administratively locked";
 					logger.error("{}", errorMsg);
 				} else if ((stateManager.getOpState() != null)
-						&& stateManagementEntity.getOpState().equals(
-								StateManagement.DISABLED)) {
+						&& stateManagementEntity.getOpState().equals(StateManagement.DISABLED)) {
 					errorMsg = dep + ": resource is operationally disabled";
 					logger.error("{}", errorMsg);
 				} else if ((stateManager.getStandbyStatus() != null)
-						&& stateManagementEntity.getStandbyStatus().equals(
-								StateManagement.COLD_STANDBY)) {
+						&& stateManagementEntity.getStandbyStatus().equals(StateManagement.COLD_STANDBY)) {
 					errorMsg = dep + ": resource is cold standby";
 					logger.error("{}", errorMsg);
 				}
 			} else {
-				errorMsg = dep
-						+ ": could not check standy state of resource. stateManagementEntity == null.";
+				errorMsg = dep + ": could not check standy state of resource. stateManagementEntity == null.";
 				logger.error("{}", errorMsg);
 			}
 		}
 
-		String returnMsg = "IntegrityMonitor.stateCheck(): returned error_msg: "
-				+ errorMsg;
+		String returnMsg = "IntegrityMonitor.stateCheck(): returned error_msg: " + errorMsg;
 		logger.debug("{}", returnMsg);
 		return errorMsg;
 	}
@@ -708,13 +719,11 @@
 		EntityTransaction et = em.getTransaction();
 		et.begin();
 		try {
-			Query fquery = em
-					.createQuery("Select f from ForwardProgressEntity f where f.resourceName=:rn");
+			Query fquery = em.createQuery("Select f from ForwardProgressEntity f where f.resourceName=:rn");
 			fquery.setParameter("rn", dep);
 
 			@SuppressWarnings("rawtypes")
-			List fpList = fquery.setLockMode(LockModeType.NONE)
-					.setFlushMode(FlushModeType.COMMIT).getResultList();
+			List fpList = fquery.setLockMode(LockModeType.NONE).setFlushMode(FlushModeType.COMMIT).getResultList();
 			ForwardProgressEntity fpx;
 			if (!fpList.isEmpty()) {
 				// ignores multiple results
@@ -722,38 +731,32 @@
 				// refresh the object from DB in case cached data was returned
 				em.refresh(fpx);
 				if (logger.isDebugEnabled()) {
-					logger.debug(
-							"Dependent resource {} - fpc= {}, lastUpdated={}",
-							dep, fpx.getFpcCount(), fpx.getLastUpdated());
+					logger.debug("Dependent resource {} - fpc= {}, lastUpdated={}", dep, fpx.getFpcCount(),
+							fpx.getLastUpdated());
 				}
 				long currTime = System.currentTimeMillis();
 				// if dependent resource FPC has not been updated, consider it
 				// an error
-				if ((currTime - fpx.getLastUpdated().getTime()) > (1000 * maxFpcUpdateInterval)) {
-					errorMsg = dep
-							+ ": FP count has not been updated in the last "
-							+ maxFpcUpdateInterval + " seconds";
+				if ((currTime - fpx.getLastUpdated().getTime()) > maxFpcUpdateIntervalMs) {
+					errorMsg = dep + ": FP count has not been updated in the last " + maxFpcUpdateIntervalMs + "ms";
 					logger.error("{}", errorMsg);
 					try {
 						// create instance of StateMangement class for dependent
-						StateManagement depStateManager = new StateManagement(
-								emf, dep);
-						if (!depStateManager.getOpState().equals(
-								StateManagement.DISABLED)) {
-							logger.debug("Forward progress not detected for dependent resource {}. Setting dependent's state to disable failed.", dep);
+						StateManagement depStateManager = new StateManagement(emf, dep);
+						if (!depStateManager.getOpState().equals(StateManagement.DISABLED)) {
+							logger.debug(
+									"Forward progress not detected for dependent resource {}. Setting dependent's state to disable failed.",
+									dep);
 							depStateManager.disableFailed();
 						}
 					} catch (Exception e) {
 						// ignore errors
-						logger.error(
-								"Update dependent state failed with exception: ",
-								e);
+						logger.error("Update dependent state failed with exception: ", e);
 					}
 				}
 			} else {
 				// resource entry not found in FPC table
-				errorMsg = dep
-						+ ": resource not found in ForwardProgressEntity table in the DB";
+				errorMsg = dep + ": resource not found in ForwardProgressEntity table in the DB";
 				logger.error("{}", errorMsg);
 			}
 			synchronized (imFlushLock) {
@@ -761,8 +764,7 @@
 			}
 		} catch (Exception e) {
 			// log an error and continue
-			errorMsg = dep
-					+ ": ForwardProgressEntity DB read failed with exception: ";
+			errorMsg = dep + ": ForwardProgressEntity DB read failed with exception: ";
 			logger.error("{}", errorMsg, e);
 			synchronized (imFlushLock) {
 				if (et.isActive()) {
@@ -781,11 +783,9 @@
 		EntityTransaction et = em.getTransaction();
 		et.begin();
 		try {
-			Query fquery = em
-					.createQuery("Select e from ForwardProgressEntity e");
+			Query fquery = em.createQuery("Select e from ForwardProgressEntity e");
 			@SuppressWarnings("rawtypes")
-			List myList = fquery.setLockMode(LockModeType.NONE)
-					.setFlushMode(FlushModeType.COMMIT).getResultList();
+			List myList = fquery.setLockMode(LockModeType.NONE).setFlushMode(FlushModeType.COMMIT).getResultList();
 			synchronized (imFlushLock) {
 				et.commit();
 			}
@@ -793,10 +793,8 @@
 			if (!myList.isEmpty()) {
 				for (int i = 0; i < myList.size(); i++) {
 					if (logger.isDebugEnabled()) {
-						logger.debug(
-								"getAllForwardProgressEntity: myList.get({}).getResourceName(): {}",
-								i, ((ForwardProgressEntity) myList.get(i))
-										.getResourceName());
+						logger.debug("getAllForwardProgressEntity: myList.get({}).getResourceName(): {}", i,
+								((ForwardProgressEntity) myList.get(i)).getResourceName());
 					}
 					fpList.add((ForwardProgressEntity) myList.get(i));
 				}
@@ -831,13 +829,11 @@
 		et.begin();
 		try {
 			// query if ResourceRegistration entry exists for resourceName
-			Query rquery = em
-					.createQuery("Select r from ResourceRegistrationEntity r where r.resourceName=:rn");
+			Query rquery = em.createQuery("Select r from ResourceRegistrationEntity r where r.resourceName=:rn");
 			rquery.setParameter("rn", dep);
 
 			@SuppressWarnings("rawtypes")
-			List rrList = rquery.setLockMode(LockModeType.NONE)
-					.setFlushMode(FlushModeType.COMMIT).getResultList();
+			List rrList = rquery.setLockMode(LockModeType.NONE).setFlushMode(FlushModeType.COMMIT).getResultList();
 			ResourceRegistrationEntity rrx = null;
 
 			if (!rrList.isEmpty()) {
@@ -847,13 +843,10 @@
 				em.refresh(rrx);
 				jmxUrl = rrx.getResourceUrl();
 				if (logger.isDebugEnabled()) {
-					logger.debug(
-							"Dependent Resource={}, url={}, createdDate={}",
-							dep, jmxUrl, rrx.getCreatedDate());
+					logger.debug("Dependent Resource={}, url={}, createdDate={}", dep, jmxUrl, rrx.getCreatedDate());
 				}
 			} else {
-				errorMsg = dep
-						+ ": resource not found in ResourceRegistrationEntity table in the DB";
+				errorMsg = dep + ": resource not found in ResourceRegistrationEntity table in the DB";
 				logger.error("{}", errorMsg);
 			}
 
@@ -861,8 +854,7 @@
 				et.commit();
 			}
 		} catch (Exception e) {
-			errorMsg = dep
-					+ ": ResourceRegistrationEntity DB read failed with exception: ";
+			errorMsg = dep + ": ResourceRegistrationEntity DB read failed with exception: ";
 			logger.error("{}", errorMsg, e);
 			synchronized (imFlushLock) {
 				if (et.isActive()) {
@@ -875,18 +867,15 @@
 			JmxAgentConnection jmxAgentConnection = null;
 			try {
 				jmxAgentConnection = new JmxAgentConnection(jmxUrl);
-				MBeanServerConnection mbeanServer = jmxAgentConnection
-						.getMBeanConnection();
-				ComponentAdminMBean admin = JMX.newMXBeanProxy(mbeanServer,
-						ComponentAdmin.getObjectName(dep),
+				MBeanServerConnection mbeanServer = jmxAgentConnection.getMBeanConnection();
+				ComponentAdminMBean admin = JMX.newMXBeanProxy(mbeanServer, ComponentAdmin.getObjectName(dep),
 						ComponentAdminMBean.class);
 
 				// invoke the test method via the jmx proxy
 				admin.test();
 				logger.debug("Dependent resource {} sanity test passed", dep);
 			} catch (Exception e) {
-				errorMsg = dep
-						+ ": resource sanity test failed with exception: ";
+				errorMsg = dep + ": resource sanity test failed with exception: ";
 				logger.error("{}", errorMsg, e);
 			} finally {
 				// close the JMX connector
@@ -928,19 +917,15 @@
 					if (!errorMsg.isEmpty()) {
 						errorMsg = errorMsg.concat(",");
 					}
-					errorMsg = errorMsg.concat(resourceName + ": "
-							+ e.getMessage());
+					errorMsg = errorMsg.concat(resourceName + ": " + e.getMessage());
 					this.stateManager.disableDependency();
 				} catch (Exception ex) {
 					logger.error("IntegrityMonitor threw exception.", ex);
 					if (!errorMsg.isEmpty()) {
 						errorMsg = errorMsg.concat(",");
 					}
-					errorMsg = errorMsg
-							.concat("\n"
-									+ resourceName
-									+ ": Failed to disable dependency after subsystemTest failure due to: "
-									+ ex.getMessage());
+					errorMsg = errorMsg.concat("\n" + resourceName
+							+ ": Failed to disable dependency after subsystemTest failure due to: " + ex.getMessage());
 				}
 			}
 
@@ -955,8 +940,7 @@
 					}
 					String[] dependencies = group.split(",");
 					if (logger.isDebugEnabled()) {
-						logger.debug("group dependencies = {}",
-								Arrays.toString(dependencies));
+						logger.debug("group dependencies = {}", Arrays.toString(dependencies));
 					}
 					int realDepCount = 0;
 					int failDepCount = 0;
@@ -967,7 +951,7 @@
 							continue;
 						}
 						realDepCount++; // this is a valid dependency whose
-											// state is tracked
+										// state is tracked
 						String failMsg = fpCheck(dep); // if a resource is
 														// down, its FP count
 														// will not be
@@ -986,18 +970,21 @@
 							}
 							errorMsg = errorMsg.concat(failMsg);
 						}
-					}// end for (String dep : dependencies)
+					} // end for (String dep : dependencies)
 
 					// if all dependencies in a group are failed, set this
 					// resource's state to disable dependency
-					if ((realDepCount > 0)
-							&& (failDepCount == realDepCount)) {
+					if ((realDepCount > 0) && (failDepCount == realDepCount)) {
 						dependencyFailure = true;
 						try {
-							logger.debug("All dependents in group {} have failed their health check. Updating this resource's state to disableDependency", group);					
-							if(stateManager.getAvailStatus()== null || !( (stateManager.getAvailStatus()).equals(StateManagement.DEPENDENCY) ||
-									(stateManager.getAvailStatus()).equals(StateManagement.DEPENDENCY_FAILED) ) ){
-								// Note: redundant calls are made by refreshStateAudit
+							logger.debug(
+									"All dependents in group {} have failed their health check. Updating this resource's state to disableDependency",
+									group);
+							if (stateManager.getAvailStatus() == null || !((stateManager.getAvailStatus())
+									.equals(StateManagement.DEPENDENCY)
+									|| (stateManager.getAvailStatus()).equals(StateManagement.DEPENDENCY_FAILED))) {
+								// Note: redundant calls are made by
+								// refreshStateAudit
 								this.stateManager.disableDependency();
 							}
 						} catch (Exception e) {
@@ -1005,15 +992,14 @@
 							if (!errorMsg.isEmpty()) {
 								errorMsg = errorMsg.concat(",");
 							}
-							errorMsg = errorMsg.concat(resourceName
-									+ ": Failed to disable dependency");
+							errorMsg = errorMsg.concat(resourceName + ": Failed to disable dependency");
 							break; // break out on failure and skip checking
 									// other groups
 						}
 					}
 					// check the next group
 
-				}// end for (String group : depGroups)
+				} // end for (String group : depGroups)
 
 				/*
 				 * We have checked all the dependency groups. If all are ok and
@@ -1021,19 +1007,22 @@
 				 */
 				if (!dependencyFailure) {
 					try {
-						logger.debug("All dependency groups have at least one viable member. Updating this resource's state to enableNoDependency");
-						if(stateManager.getAvailStatus() != null && ((stateManager.getAvailStatus()).equals(StateManagement.DEPENDENCY) ||
-								(stateManager.getAvailStatus()).equals(StateManagement.DEPENDENCY_FAILED)) ){
-							// Note: redundant calls are made by refreshStateAudit
-							this.stateManager.enableNoDependency();	
-						} // The refreshStateAudit will catch the case where it is disabled but availStatus != failed
+						logger.debug(
+								"All dependency groups have at least one viable member. Updating this resource's state to enableNoDependency");
+						if (stateManager.getAvailStatus() != null
+								&& ((stateManager.getAvailStatus()).equals(StateManagement.DEPENDENCY)
+										|| (stateManager.getAvailStatus()).equals(StateManagement.DEPENDENCY_FAILED))) {
+							// Note: redundant calls are made by
+							// refreshStateAudit
+							this.stateManager.enableNoDependency();
+						} // The refreshStateAudit will catch the case where it
+							// is disabled but availStatus != failed
 					} catch (Exception e) {
 						logger.error("IntegrityMonitor threw exception.", e);
 						if (!errorMsg.isEmpty()) {
 							errorMsg = errorMsg.concat(",");
 						}
-						errorMsg = errorMsg.concat(resourceName
-								+ ": Failed to enable no dependency");
+						errorMsg = errorMsg.concat(resourceName + ": Failed to enable no dependency");
 					}
 				}
 			} else if (!dependencyFailure) {
@@ -1046,26 +1035,24 @@
 				 */
 				try {
 					logger.debug("There are no dependents. Updating this resource's state to enableNoDependency");
-					if(stateManager.getAvailStatus() != null && ((stateManager.getAvailStatus()).equals(StateManagement.DEPENDENCY) ||
-							(stateManager.getAvailStatus()).equals(StateManagement.DEPENDENCY_FAILED)) ){
+					if (stateManager.getAvailStatus() != null
+							&& ((stateManager.getAvailStatus()).equals(StateManagement.DEPENDENCY)
+									|| (stateManager.getAvailStatus()).equals(StateManagement.DEPENDENCY_FAILED))) {
 						// Note: redundant calls are made by refreshStateAudit
 						this.stateManager.enableNoDependency();
-					}// The refreshStateAudit will catch the case where it is
+					} // The refreshStateAudit will catch the case where it is
 						// disabled but availStatus != failed
 				} catch (Exception e) {
 					logger.error("IntegrityMonitor threw exception.", e);
 					if (!errorMsg.isEmpty()) {
 						errorMsg = errorMsg.concat(",");
 					}
-					errorMsg = errorMsg.concat(resourceName
-							+ ": Failed to enable no dependency");
+					errorMsg = errorMsg.concat(resourceName + ": Failed to enable no dependency");
 				}
 			}
 
 			if (!errorMsg.isEmpty()) {
-				logger.error(
-						"Sanity failure detected in a dependent resource: {}",
-						errorMsg);
+				logger.error("Sanity failure detected in a dependent resource: {}", errorMsg);
 
 			}
 
@@ -1077,13 +1064,13 @@
 	}
 
 	/**
-	 * Execute a test transaction. It is called when the test transaction timer fires.
-	 * It could be overridden to provide additional test functionality. If overridden,
-	 * the overriding method must invoke startTransaction() and endTransaction() and 
-	 * check if the allNotWellMap is empty.
+	 * Execute a test transaction. It is called when the test transaction timer
+	 * fires. It could be overridden to provide additional test functionality.
+	 * If overridden, the overriding method must invoke startTransaction() and
+	 * endTransaction() and check if the allNotWellMap is empty.
 	 */
 	public void testTransaction() {
-		synchronized (testTransactionLock){
+		synchronized (testTransactionLock) {
 			logger.debug("testTransaction: entry");
 			//
 			// startTransaction() not required for testTransaction
@@ -1112,31 +1099,23 @@
 	 *             throws admin state exception if resource is locked
 	 * @throws StandbyStatusException
 	 */
-	public void startTransaction() throws AdministrativeStateException,
-			StandbyStatusException {
+	public void startTransaction() throws AdministrativeStateException, StandbyStatusException {
 
 		synchronized (startTransactionLock) {
 			// check admin state and throw exception if locked
-			if ((stateManager.getAdminState() != null)
-					&& stateManager.getAdminState().equals(
-							StateManagement.LOCKED)) {
-				String msg = "Resource " + resourceName
-						+ " is administratively locked";
+			if ((stateManager.getAdminState() != null) && stateManager.getAdminState().equals(StateManagement.LOCKED)) {
+				String msg = "Resource " + resourceName + " is administratively locked";
 
-				throw new AdministrativeStateException(
-						"IntegrityMonitor Admin State Exception: " + msg);
+				throw new AdministrativeStateException("IntegrityMonitor Admin State Exception: " + msg);
 			}
 			// check standby state and throw exception if locked
 
 			if ((stateManager.getStandbyStatus() != null)
-					&& (stateManager.getStandbyStatus().equals(
-							StateManagement.HOT_STANDBY) || stateManager
-							.getStandbyStatus().equals(
-									StateManagement.COLD_STANDBY))) {
+					&& (stateManager.getStandbyStatus().equals(StateManagement.HOT_STANDBY)
+							|| stateManager.getStandbyStatus().equals(StateManagement.COLD_STANDBY))) {
 				String msg = "Resource " + resourceName + " is standby";
 
-				throw new StandbyStatusException(
-						"IntegrityMonitor Standby Status Exception: " + msg);
+				throw new StandbyStatusException("IntegrityMonitor Standby Status Exception: " + msg);
 			}
 
 			// reset transactionTimer so it will not fire
@@ -1149,30 +1128,32 @@
 	 * the end of each transaction (successful or not).
 	 */
 	public void endTransaction() {
-		synchronized(endTransactionLock){
-			if(getAllNotWellMap() != null){
-				if(!(getAllNotWellMap().isEmpty())){
+		synchronized (endTransactionLock) {
+			if (getAllNotWellMap() != null) {
+				if (!(getAllNotWellMap().isEmpty())) {
 					/*
-					 * An entity has reported that it is not well.  We must not
+					 * An entity has reported that it is not well. We must not
 					 * allow the the forward progress counter to advance.
 					 */
 					String msg = "allNotWellMap:";
-					for(Entry<String, String> entry: allNotWellMap.entrySet()){
+					for (Entry<String, String> entry : allNotWellMap.entrySet()) {
 						msg = msg.concat("\nkey = " + entry.getKey() + " msg = " + entry.getValue());
 					}
 					logger.error("endTransaction: allNotWellMap is NOT EMPTY.  Not advancing forward"
 							+ "progress counter. \n{}\n", msg);
 					return;
-				}else{
-					if(logger.isDebugEnabled()){
-						if(getAllSeemsWellMap() != null){
-							if(!(getAllSeemsWellMap().isEmpty())){
+				} else {
+					if (logger.isDebugEnabled()) {
+						if (getAllSeemsWellMap() != null) {
+							if (!(getAllSeemsWellMap().isEmpty())) {
 								String msg = "allSeemsWellMap:";
-								for(Entry<String, String> entry: allSeemsWellMap.entrySet()){
+								for (Entry<String, String> entry : allSeemsWellMap.entrySet()) {
 									msg = msg.concat("\nkey = " + entry.getKey() + " msg = " + entry.getValue());
 								}
-								logger.debug("endTransaction: allNotWellMap IS EMPTY and allSeemsWellMap is NOT EMPTY.  Advancing forward"
-										+ "progress counter. \n{}\n", msg);
+								logger.debug(
+										"endTransaction: allNotWellMap IS EMPTY and allSeemsWellMap is NOT EMPTY.  Advancing forward"
+												+ "progress counter. \n{}\n",
+										msg);
 							}
 						}
 					}
@@ -1195,13 +1176,11 @@
 
 		try {
 			// query if ForwardProgress entry exists for resourceName
-			Query fquery = em
-					.createQuery("Select f from ForwardProgressEntity f where f.resourceName=:rn");
+			Query fquery = em.createQuery("Select f from ForwardProgressEntity f where f.resourceName=:rn");
 			fquery.setParameter("rn", resourceName);
 
 			@SuppressWarnings("rawtypes")
-			List fpList = fquery.setLockMode(LockModeType.NONE)
-					.setFlushMode(FlushModeType.COMMIT).getResultList();
+			List fpList = fquery.setLockMode(LockModeType.NONE).setFlushMode(FlushModeType.COMMIT).getResultList();
 			ForwardProgressEntity fpx;
 			if (!fpList.isEmpty()) {
 				// ignores multiple results
@@ -1209,10 +1188,8 @@
 				// refresh the object from DB in case cached data was returned
 				em.refresh(fpx);
 				if (logger.isDebugEnabled()) {
-					logger.debug(
-							"Updating FP entry: Resource={}, fpcCount={}, lastUpdated={}, new fpcCount={}",
-							resourceName, fpx.getFpcCount(),
-							fpx.getLastUpdated(), fpCounter);
+					logger.debug("Updating FP entry: Resource={}, fpcCount={}, lastUpdated={}, new fpcCount={}",
+							resourceName, fpx.getFpcCount(), fpx.getLastUpdated(), fpCounter);
 				}
 				fpx.setFpcCount(fpCounter);
 				em.persist(fpx);
@@ -1222,8 +1199,7 @@
 				}
 			} else {
 				// Error - FP entry does not exist
-				String msg = "FP entry not found in database for resource "
-						+ resourceName;
+				String msg = "FP entry not found in database for resource " + resourceName;
 				throw new IntegrityMonitorException(msg);
 			}
 		} catch (Exception e) {
@@ -1236,8 +1212,7 @@
 			} catch (Exception e1) {
 				logger.error("IntegrityMonitor threw exception.", e1);
 			}
-			logger.error("writeFpc DB table commit failed with exception: {}",
-					e);
+			logger.error("writeFpc DB table commit failed with exception: {}", e);
 			throw e;
 		}
 	}
@@ -1252,89 +1227,74 @@
 	 * 
 	 * @throws Exception
 	 */
-	private static void validateProperties(Properties prop)
-			throws IntegrityMonitorPropertiesException {
+	private static void validateProperties(Properties prop) throws IntegrityMonitorPropertiesException {
 
 		if (prop.getProperty(IntegrityMonitorProperties.DB_DRIVER) == null) {
-			String msg = IntegrityMonitorProperties.DB_DRIVER
-					+ " property is null";
+			String msg = IntegrityMonitorProperties.DB_DRIVER + " property is null";
 			logger.error("{}", msg);
-			throw new IntegrityMonitorPropertiesException(
-					"IntegrityMonitor Property Exception: " + msg);
+			throw new IntegrityMonitorPropertiesException("IntegrityMonitor Property Exception: " + msg);
 		}
 
 		if (prop.getProperty(IntegrityMonitorProperties.DB_URL) == null) {
-			String msg = IntegrityMonitorProperties.DB_URL
-					+ " property is null";
+			String msg = IntegrityMonitorProperties.DB_URL + " property is null";
 			logger.error("{}", msg);
-			throw new IntegrityMonitorPropertiesException(
-					"IntegrityMonitor Property Exception: " + msg);
+			throw new IntegrityMonitorPropertiesException("IntegrityMonitor Property Exception: " + msg);
 		}
 
 		if (prop.getProperty(IntegrityMonitorProperties.DB_USER) == null) {
-			String msg = IntegrityMonitorProperties.DB_USER
-					+ " property is null";
+			String msg = IntegrityMonitorProperties.DB_USER + " property is null";
 			logger.error("{}", msg);
-			throw new IntegrityMonitorPropertiesException(
-					"IntegrityMonitor Property Exception: " + msg);
+			throw new IntegrityMonitorPropertiesException("IntegrityMonitor Property Exception: " + msg);
 		}
 
 		if (prop.getProperty(IntegrityMonitorProperties.DB_PWD) == null) {
-			String msg = IntegrityMonitorProperties.DB_PWD
-					+ " property is null";
+			String msg = IntegrityMonitorProperties.DB_PWD + " property is null";
 			logger.error("{}", msg);
-			throw new IntegrityMonitorPropertiesException(
-					"IntegrityMonitor Property Exception: " + msg);
+			throw new IntegrityMonitorPropertiesException("IntegrityMonitor Property Exception: " + msg);
 		}
 
 		if (prop.getProperty(IntegrityMonitorProperties.FP_MONITOR_INTERVAL) != null) {
 			try {
-				monitorInterval = Integer.parseInt(prop.getProperty(
-						IntegrityMonitorProperties.FP_MONITOR_INTERVAL).trim());
+				monitorIntervalMs = toMillis(
+						Integer.parseInt(prop.getProperty(IntegrityMonitorProperties.FP_MONITOR_INTERVAL).trim()));
 			} catch (NumberFormatException e) {
-				logger.warn("Ignored invalid property: {}",
-						IntegrityMonitorProperties.FP_MONITOR_INTERVAL, e);
+				logger.warn("Ignored invalid property: {}", IntegrityMonitorProperties.FP_MONITOR_INTERVAL, e);
 			}
 		}
 
 		if (prop.getProperty(IntegrityMonitorProperties.FAILED_COUNTER_THRESHOLD) != null) {
 			try {
-				failedCounterThreshold = Integer.parseInt(prop.getProperty(
-						IntegrityMonitorProperties.FAILED_COUNTER_THRESHOLD)
-						.trim());
+				failedCounterThreshold = Integer
+						.parseInt(prop.getProperty(IntegrityMonitorProperties.FAILED_COUNTER_THRESHOLD).trim());
 			} catch (NumberFormatException e) {
-				logger.warn("Ignored invalid property: {}",
-						IntegrityMonitorProperties.FAILED_COUNTER_THRESHOLD, e);
+				logger.warn("Ignored invalid property: {}", IntegrityMonitorProperties.FAILED_COUNTER_THRESHOLD, e);
 			}
 		}
 
 		if (prop.getProperty(IntegrityMonitorProperties.TEST_TRANS_INTERVAL) != null) {
 			try {
-				testTransInterval = Integer.parseInt(prop.getProperty(
-						IntegrityMonitorProperties.TEST_TRANS_INTERVAL).trim());
+				testTransIntervalMs = toMillis(
+						Integer.parseInt(prop.getProperty(IntegrityMonitorProperties.TEST_TRANS_INTERVAL).trim()));
 			} catch (NumberFormatException e) {
-				logger.warn("Ignored invalid property: {}",
-						IntegrityMonitorProperties.TEST_TRANS_INTERVAL, e);
+				logger.warn("Ignored invalid property: {}", IntegrityMonitorProperties.TEST_TRANS_INTERVAL, e);
 			}
 		}
 
 		if (prop.getProperty(IntegrityMonitorProperties.WRITE_FPC_INTERVAL) != null) {
 			try {
-				writeFpcInterval = Integer.parseInt(prop.getProperty(
-						IntegrityMonitorProperties.WRITE_FPC_INTERVAL).trim());
+				writeFpcIntervalMs = toMillis(
+						Integer.parseInt(prop.getProperty(IntegrityMonitorProperties.WRITE_FPC_INTERVAL).trim()));
 			} catch (NumberFormatException e) {
-				logger.warn("Ignored invalid property: {}",
-						IntegrityMonitorProperties.WRITE_FPC_INTERVAL, e);
+				logger.warn("Ignored invalid property: {}", IntegrityMonitorProperties.WRITE_FPC_INTERVAL, e);
 			}
 		}
 
 		if (prop.getProperty(IntegrityMonitorProperties.CHECK_DEPENDENCY_INTERVAL) != null) {
 			try {
-				checkDependencyInterval = Integer.parseInt(prop.getProperty(
-						IntegrityMonitorProperties.CHECK_DEPENDENCY_INTERVAL).trim());
+				checkDependencyIntervalMs = toMillis(Integer
+						.parseInt(prop.getProperty(IntegrityMonitorProperties.CHECK_DEPENDENCY_INTERVAL).trim()));
 			} catch (NumberFormatException e) {
-				logger.warn("Ignored invalid property: {}",
-						IntegrityMonitorProperties.CHECK_DEPENDENCY_INTERVAL, e);
+				logger.warn("Ignored invalid property: {}", IntegrityMonitorProperties.CHECK_DEPENDENCY_INTERVAL, e);
 			}
 		}
 
@@ -1344,57 +1304,45 @@
 		// site_1.pdp_2
 		if (prop.getProperty(IntegrityMonitorProperties.DEPENDENCY_GROUPS) != null) {
 			try {
-				depGroups = prop.getProperty(
-						IntegrityMonitorProperties.DEPENDENCY_GROUPS)
-						.split(";");
+				depGroups = prop.getProperty(IntegrityMonitorProperties.DEPENDENCY_GROUPS).split(";");
 				if (logger.isDebugEnabled()) {
-					logger.debug("dependency groups property = {}",
-							Arrays.toString(depGroups));
+					logger.debug("dependency groups property = {}", Arrays.toString(depGroups));
 				}
 			} catch (Exception e) {
-				logger.warn("Ignored invalid property: {}",
-						IntegrityMonitorProperties.DEPENDENCY_GROUPS, e);
+				logger.warn("Ignored invalid property: {}", IntegrityMonitorProperties.DEPENDENCY_GROUPS, e);
 			}
 		}
 
 		siteName = prop.getProperty(IntegrityMonitorProperties.SITE_NAME);
 		if (siteName == null) {
-			String msg = IntegrityMonitorProperties.SITE_NAME
-					+ " property is null";
+			String msg = IntegrityMonitorProperties.SITE_NAME + " property is null";
 			logger.error("{}", msg);
-			throw new IntegrityMonitorPropertiesException(
-					"IntegrityMonitor Property Exception: " + msg);
+			throw new IntegrityMonitorPropertiesException("IntegrityMonitor Property Exception: " + msg);
 		} else {
 			siteName = siteName.trim();
 		}
 
 		nodeType = prop.getProperty(IntegrityMonitorProperties.NODE_TYPE);
 		if (nodeType == null) {
-			String msg = IntegrityMonitorProperties.NODE_TYPE
-					+ " property is null";
+			String msg = IntegrityMonitorProperties.NODE_TYPE + " property is null";
 			logger.error("{}", msg);
-			throw new IntegrityMonitorPropertiesException(
-					"IntegrityMonitor Property Exception: " + msg);
+			throw new IntegrityMonitorPropertiesException("IntegrityMonitor Property Exception: " + msg);
 		} else {
 			nodeType = nodeType.trim();
 			if (!isNodeTypeEnum(nodeType)) {
-				String msg = IntegrityMonitorProperties.NODE_TYPE
-						+ " property " + nodeType + " is invalid";
+				String msg = IntegrityMonitorProperties.NODE_TYPE + " property " + nodeType + " is invalid";
 				logger.error("{}", msg);
-				throw new IntegrityMonitorPropertiesException(
-						"IntegrityMonitor Property Exception: " + msg);
+				throw new IntegrityMonitorPropertiesException("IntegrityMonitor Property Exception: " + msg);
 			}
 		}
 
 		if (prop.getProperty(IntegrityMonitorProperties.TEST_VIA_JMX) != null) {
-			String jmxTest = prop.getProperty(
-					IntegrityMonitorProperties.TEST_VIA_JMX).trim();
+			String jmxTest = prop.getProperty(IntegrityMonitorProperties.TEST_VIA_JMX).trim();
 			testViaJmx = Boolean.parseBoolean(jmxTest);
 		}
 
 		if (prop.getProperty(IntegrityMonitorProperties.JMX_FQDN) != null) {
-			jmxFqdn = prop.getProperty(IntegrityMonitorProperties.JMX_FQDN)
-					.trim();
+			jmxFqdn = prop.getProperty(IntegrityMonitorProperties.JMX_FQDN).trim();
 			if (jmxFqdn.isEmpty()) {
 				jmxFqdn = null;
 			}
@@ -1402,41 +1350,34 @@
 
 		if (prop.getProperty(IntegrityMonitorProperties.MAX_FPC_UPDATE_INTERVAL) != null) {
 			try {
-				maxFpcUpdateInterval = Integer.parseInt(prop.getProperty(
-						IntegrityMonitorProperties.MAX_FPC_UPDATE_INTERVAL)
-						.trim());
+				maxFpcUpdateIntervalMs = toMillis(
+						Integer.parseInt(prop.getProperty(IntegrityMonitorProperties.MAX_FPC_UPDATE_INTERVAL).trim()));
 			} catch (NumberFormatException e) {
-				logger.warn("Ignored invalid property: {}",
-						IntegrityMonitorProperties.MAX_FPC_UPDATE_INTERVAL, e);
+				logger.warn("Ignored invalid property: {}", IntegrityMonitorProperties.MAX_FPC_UPDATE_INTERVAL, e);
 			}
 		}
 
 		if (prop.getProperty(IntegrityMonitorProperties.STATE_AUDIT_INTERVAL_MS) != null) {
 			try {
 				stateAuditIntervalMs = Long
-						.parseLong(prop
-								.getProperty(IntegrityMonitorProperties.STATE_AUDIT_INTERVAL_MS));
+						.parseLong(prop.getProperty(IntegrityMonitorProperties.STATE_AUDIT_INTERVAL_MS));
 			} catch (NumberFormatException e) {
-				logger.warn("Ignored invalid property: {}",
-						IntegrityMonitorProperties.STATE_AUDIT_INTERVAL_MS, e);
+				logger.warn("Ignored invalid property: {}", IntegrityMonitorProperties.STATE_AUDIT_INTERVAL_MS, e);
 			}
 		}
 
 		if (prop.getProperty(IntegrityMonitorProperties.REFRESH_STATE_AUDIT_INTERVAL_MS) != null) {
 			try {
 				refreshStateAuditIntervalMs = Long
-						.parseLong(prop
-								.getProperty(IntegrityMonitorProperties.REFRESH_STATE_AUDIT_INTERVAL_MS));
+						.parseLong(prop.getProperty(IntegrityMonitorProperties.REFRESH_STATE_AUDIT_INTERVAL_MS));
 			} catch (NumberFormatException e) {
-				logger.warn(
-						"Ignored invalid property: {}",
-						IntegrityMonitorProperties.REFRESH_STATE_AUDIT_INTERVAL_MS,
+				logger.warn("Ignored invalid property: {}", IntegrityMonitorProperties.REFRESH_STATE_AUDIT_INTERVAL_MS,
 						e);
 			}
 		}
 
-		logger.debug("IntegrityMonitor.validateProperties(): Property values \n"
-				+ "maxFpcUpdateInterval = {}\n", maxFpcUpdateInterval);
+		logger.debug("IntegrityMonitor.validateProperties(): Property values \n" + "maxFpcUpdateIntervalMs = {}\n",
+				maxFpcUpdateIntervalMs);
 
 		return;
 	}
@@ -1472,15 +1413,14 @@
 		logger.debug("fpMonitorCycle(): entry");
 		synchronized (fpMonitorCycleLock) {
 			// monitoring interval checks
-			if (monitorInterval <= 0) {
+			if (monitorIntervalMs <= 0) {
 				logger.debug("fpMonitorCycle(): disabled");
 				elapsedTime = 0;
 				return; // monitoring is disabled
 			}
 
-			elapsedTime = elapsedTime
-					+ TimeUnit.MILLISECONDS.toSeconds(CYCLE_INTERVAL_MILLIS);
-			if (elapsedTime < monitorInterval) {
+			elapsedTime = elapsedTime + cycleIntervalMillis;
+			if (elapsedTime < monitorIntervalMs) {
 				return; // monitoring interval not reached
 			}
 
@@ -1491,15 +1431,13 @@
 					// no forward progress
 					missedCycles += 1;
 					if (missedCycles >= failedCounterThreshold && !alarmExists) {
-						logger.debug(
-								"Forward progress not detected for resource {}. Setting state to disable failed.",
+						logger.debug("Forward progress not detected for resource {}. Setting state to disable failed.",
 								resourceName);
-						if (!(stateManager.getOpState())
-								.equals(StateManagement.DISABLED)) {
+						if (!(stateManager.getOpState()).equals(StateManagement.DISABLED)) {
 							// Note: The refreshStateAudit will make redundant
 							// calls
 							stateManager.disableFailed();
-						}// The refreshStateAudit will catch the case where
+						} // The refreshStateAudit will catch the case where
 							// opStat = disabled and availState !
 							// failed/dependency.failed
 						alarmExists = true;
@@ -1509,14 +1447,12 @@
 					lastFpCounter = fpCounter;
 					missedCycles = 0;
 					// set op state to enabled
-					logger.debug(
-							"Forward progress detected for resource {}. Setting state to enable not failed.",
+					logger.debug("Forward progress detected for resource {}. Setting state to enable not failed.",
 							resourceName);
-					if (!(stateManager.getOpState())
-							.equals(StateManagement.ENABLED)) {
+					if (!(stateManager.getOpState()).equals(StateManagement.ENABLED)) {
 						// Note: The refreshStateAudit will make redundant calls
 						stateManager.enableNotFailed();
-					}// The refreshStateAudit will catch the case where
+					} // The refreshStateAudit will catch the case where
 						// opState=enabled and availStatus != null
 					alarmExists = false;
 				}
@@ -1539,39 +1475,39 @@
 			logger.debug("IntegrityMonitor.stateAudit(): disabled");
 			return; // stateAudit is disabled
 		}
-		
-		//Only run from nodes that are operational
-		if(stateManager.getOpState().equals(StateManagement.DISABLED)){
+
+		// Only run from nodes that are operational
+		if (stateManager.getOpState().equals(StateManagement.DISABLED)) {
 			logger.debug("IntegrityMonitor.stateAudit(): DISABLED. returning");
 			return;
 		}
-		if(stateManager.getAdminState().equals(StateManagement.LOCKED)){
+		if (stateManager.getAdminState().equals(StateManagement.LOCKED)) {
 			logger.debug("IntegrityMonitor.stateAudit(): LOCKED. returning");
 			return;
 		}
-		if(!stateManager.getStandbyStatus().equals(StateManagement.NULL_VALUE) &&
-				stateManager.getStandbyStatus()!= null){
-			if(!stateManager.getStandbyStatus().equals(StateManagement.PROVIDING_SERVICE)){
+		if (!stateManager.getStandbyStatus().equals(StateManagement.NULL_VALUE)
+				&& stateManager.getStandbyStatus() != null) {
+			if (!stateManager.getStandbyStatus().equals(StateManagement.PROVIDING_SERVICE)) {
 				logger.debug("IntegrityMonitor.stateAudit(): NOT PROVIDING_SERVICE. returning");
 				return;
 			}
 		}
 
-		Date date = new Date();		
-		long timeSinceLastStateAudit = date.getTime() - lastStateAuditTime.getTime(); 
-		if (timeSinceLastStateAudit < stateAuditIntervalMs){
+		Date date = new Date();
+		long timeSinceLastStateAudit = date.getTime() - lastStateAuditTime.getTime();
+		if (timeSinceLastStateAudit < stateAuditIntervalMs) {
 			logger.debug("IntegrityMonitor.stateAudit(): Not time to run. returning");
 			return;
 		}
-		
+
 		executeStateAudit();
 
 		lastStateAuditTime = date;
 
 		logger.debug("IntegrityMonitor.stateAudit(): exit");
 	}// end stateAudit()
-	
-	public void executeStateAudit(){
+
+	public void executeStateAudit() {
 		logger.debug("IntegrityMonitor.executeStateAudit(): entry");
 		Date date = new Date();
 
@@ -1579,77 +1515,87 @@
 		List<ForwardProgressEntity> fpList = getAllForwardProgressEntity();
 
 		// Check if each forwardprogressentity entry is current
-		for(ForwardProgressEntity fpe : fpList){
-			//If the this is my ForwardProgressEntity, continue
-			if(fpe.getResourceName().equals(IntegrityMonitor.resourceName)){
+		for (ForwardProgressEntity fpe : fpList) {
+			// If the this is my ForwardProgressEntity, continue
+			if (fpe.getResourceName().equals(IntegrityMonitor.resourceName)) {
 				continue;
 			}
-			//Make sure you are not getting a cached version
+			// Make sure you are not getting a cached version
 			em.refresh(fpe);
 			long diffMs = date.getTime() - fpe.getLastUpdated().getTime();
-			if(logger.isDebugEnabled()){
-				logger.debug("IntegrityMonitor.executeStateAudit(): resource = {}, diffMs = {}", fpe.getResourceName(), diffMs);
+			if (logger.isDebugEnabled()) {
+				logger.debug("IntegrityMonitor.executeStateAudit(): resource = {}, diffMs = {}", fpe.getResourceName(),
+						diffMs);
 			}
 
-			//Threshold for a stale entry
-			long staleMs = 1000L * maxFpcUpdateInterval;
-			if(logger.isDebugEnabled()){
-				logger.debug("IntegrityMonitor.executeStateAudit(): resource = {}, staleMs = {}", fpe.getResourceName(), staleMs);
+			// Threshold for a stale entry
+			long staleMs = maxFpcUpdateIntervalMs;
+			if (logger.isDebugEnabled()) {
+				logger.debug("IntegrityMonitor.executeStateAudit(): resource = {}, staleMs = {}", fpe.getResourceName(),
+						staleMs);
 			}
 
-			if(diffMs > staleMs){
-				//ForwardProgress is stale.  Disable it
+			if (diffMs > staleMs) {
+				// ForwardProgress is stale. Disable it
 				// Start a transaction
-				logger.debug("IntegrityMonitor.executeStateAudit(): resource = {}, FPC is stale. Disabling it" );
+				logger.debug("IntegrityMonitor.executeStateAudit(): resource = {}, FPC is stale. Disabling it");
 				EntityTransaction et = em.getTransaction();
 				et.begin();
 				StateManagementEntity sme = null;
 				try {
 					// query if StateManagement entry exists for fpe resource
-					Query query = em.createQuery("Select p from StateManagementEntity p where p.resourceName=:resource");
+					Query query = em
+							.createQuery("Select p from StateManagementEntity p where p.resourceName=:resource");
 					query.setParameter("resource", fpe.getResourceName());
 
 					@SuppressWarnings("rawtypes")
-					List smList = query.setLockMode(
-							LockModeType.NONE).setFlushMode(FlushModeType.COMMIT).getResultList();
+					List smList = query.setLockMode(LockModeType.NONE).setFlushMode(FlushModeType.COMMIT)
+							.getResultList();
 					if (!smList.isEmpty()) {
 						// exists
 						sme = (StateManagementEntity) smList.get(0);
-						// refresh the object from DB in case cached data was returned
+						// refresh the object from DB in case cached data was
+						// returned
 						em.refresh(sme);
-						if(logger.isDebugEnabled()){
-							logger.debug("IntegrityMonitor.executeStateAudit(): Found entry in StateManagementEntity table for Resource={}", sme.getResourceName());
+						if (logger.isDebugEnabled()) {
+							logger.debug(
+									"IntegrityMonitor.executeStateAudit(): Found entry in StateManagementEntity table for Resource={}",
+									sme.getResourceName());
 						}
 					} else {
-						String msg = "IntegrityMonitor.executeStateAudit(): " + fpe.getResourceName() + ": resource not found in state management entity database table";
-							logger.error("{}", msg);
+						String msg = "IntegrityMonitor.executeStateAudit(): " + fpe.getResourceName()
+								+ ": resource not found in state management entity database table";
+						logger.error("{}", msg);
 					}
-					synchronized(imFlushLock){
+					synchronized (imFlushLock) {
 						et.commit();
 					}
 				} catch (Exception e) {
 					// log an error
-					logger.error("IntegrityMonitor.executeStateAudit(): {}: StateManagementEntity DB read failed with exception: ", fpe.getResourceName(), e);
-					synchronized(imFlushLock){
-						if(et.isActive()){
+					logger.error(
+							"IntegrityMonitor.executeStateAudit(): {}: StateManagementEntity DB read failed with exception: ",
+							fpe.getResourceName(), e);
+					synchronized (imFlushLock) {
+						if (et.isActive()) {
 							et.rollback();
 						}
 					}
 				}
 
-				if(sme != null && !sme.getOpState().equals(StateManagement.DISABLED)){
-					if(logger.isDebugEnabled()){	
-						logger.debug("IntegrityMonitor.executeStateAudit(): Changing OpStat = disabled for {}", sme.getResourceName());
+				if (sme != null && !sme.getOpState().equals(StateManagement.DISABLED)) {
+					if (logger.isDebugEnabled()) {
+						logger.debug("IntegrityMonitor.executeStateAudit(): Changing OpStat = disabled for {}",
+								sme.getResourceName());
 					}
-						try {
-							stateManager.disableFailed(sme.getResourceName());
-						} catch (Exception e) {
-							String msg = "IntegrityMonitor.executeStateAudit(): Failed to disable " + sme.getResourceName();
-							logger.error("{}", msg, e);
-						}
+					try {
+						stateManager.disableFailed(sme.getResourceName());
+					} catch (Exception e) {
+						String msg = "IntegrityMonitor.executeStateAudit(): Failed to disable " + sme.getResourceName();
+						logger.error("{}", msg, e);
+					}
 				}
-			}// end if(diffMs > staleMs)
-		}// end for(ForwardProgressEntity fpe : fpList)
+			} // end if(diffMs > staleMs)
+		} // end for(ForwardProgressEntity fpe : fpList)
 		logger.debug("IntegrityMonitor.executeStateAudit(): exit");
 	}
 
@@ -1661,15 +1607,14 @@
 		synchronized (checkTestTransactionLock) {
 
 			// test transaction timer checks
-			if (testTransInterval <= 0) {
+			if (testTransIntervalMs <= 0) {
 				logger.debug("checkTestTransaction(): disabled");
 				elapsedTestTransTime = 0;
 				return; // test transaction is disabled
 			}
 
-			elapsedTestTransTime = elapsedTestTransTime
-					+ TimeUnit.MILLISECONDS.toSeconds(CYCLE_INTERVAL_MILLIS);
-			if (elapsedTestTransTime < testTransInterval) {
+			elapsedTestTransTime = elapsedTestTransTime + cycleIntervalMillis;
+			if (elapsedTestTransTime < testTransIntervalMs) {
 				return; // test transaction interval not reached
 			}
 
@@ -1689,15 +1634,14 @@
 		synchronized (checkWriteFpcLock) {
 
 			// test transaction timer checks
-			if (writeFpcInterval <= 0) {
+			if (writeFpcIntervalMs <= 0) {
 				logger.debug("checkWriteFpc(): disabled");
 				elapsedWriteFpcTime = 0;
 				return; // write Fpc is disabled
 			}
 
-			elapsedWriteFpcTime = elapsedWriteFpcTime
-					+ TimeUnit.MILLISECONDS.toSeconds(CYCLE_INTERVAL_MILLIS);
-			if (elapsedWriteFpcTime < writeFpcInterval) {
+			elapsedWriteFpcTime = elapsedWriteFpcTime + cycleIntervalMillis;
+			if (elapsedWriteFpcTime < writeFpcIntervalMs) {
 				return; // write Fpc interval not reached
 			}
 
@@ -1719,16 +1663,15 @@
 	 */
 	private void checkDependentHealth() {
 		logger.debug("checkDependentHealth: entry");
-		if (checkDependencyInterval <=0) {
+		if (checkDependencyIntervalMs <= 0) {
 			logger.debug("checkDependentHealth: disabled");
 			return; // dependency monitoring is disabled
 		}
 
 		long currTime = System.currentTimeMillis();
-		logger.debug(
-				"checkDependentHealth currTime - lastDependencyCheckTime = {}",
+		logger.debug("checkDependentHealth currTime - lastDependencyCheckTime = {}",
 				currTime - lastDependencyCheckTime);
-		if ((currTime - lastDependencyCheckTime) > (1000L * checkDependencyInterval)) {
+		if ((currTime - lastDependencyCheckTime) > checkDependencyIntervalMs) {
 			// execute dependency check and update this resource's state
 
 			dependencyCheck();
@@ -1756,16 +1699,15 @@
 		executeRefreshStateAudit();
 		logger.debug("refreshStateAudit(): exit");
 	}
-	
-	public void executeRefreshStateAudit(){
+
+	public void executeRefreshStateAudit() {
 		logger.debug("executeRefreshStateAudit(): entry");
 		synchronized (refreshStateAuditLock) {
 			logger.debug("refreshStateAudit: entry");
 			Date now = new Date();
 			long nowMs = now.getTime();
 			long lastTimeMs = refreshStateAuditLastRunDate.getTime();
-			logger.debug("refreshStateAudit: ms since last run = {}",
-					nowMs - lastTimeMs);
+			logger.debug("refreshStateAudit: ms since last run = {}", nowMs - lastTimeMs);
 
 			if ((nowMs - lastTimeMs) > refreshStateAuditIntervalMs) {
 				String adminState = stateManager.getAdminState();
@@ -1775,18 +1717,14 @@
 						logger.debug("refreshStateAudit: calling lock()");
 						stateManager.lock();
 					} catch (Exception e) {
-						logger.error(
-								"refreshStateAudit: caught unexpected exception from stateManager.lock(): ",
-								e);
+						logger.error("refreshStateAudit: caught unexpected exception from stateManager.lock(): ", e);
 					}
 				} else {// unlocked
 					try {
 						logger.debug("refreshStateAudit: calling unlock()");
 						stateManager.unlock();
 					} catch (Exception e) {
-						logger.error(
-								"refreshStateAudit: caught unexpected exception from stateManager.unlock(): ",
-								e);
+						logger.error("refreshStateAudit: caught unexpected exception from stateManager.unlock(): ", e);
 					}
 				}
 				refreshStateAuditLastRunDate = new Date();
@@ -1796,24 +1734,20 @@
 		logger.debug("executeRefreshStateAudit(): exit");
 	}
 
-	public static boolean isUnitTesting() {
-		return isUnitTesting;
-	}
-
-	public static void setUnitTesting(boolean isUnitTesting) {
-		IntegrityMonitor.isUnitTesting = isUnitTesting;
-	}
-
 	/**
 	 * The following nested class periodically performs the forward progress
 	 * check, checks dependencies, does a refresh state audit and runs the
 	 * stateAudit.
 	 */
 	class FPManager extends Thread {
-		private volatile boolean exit = false;
+		private final CountDownLatch stopper = new CountDownLatch(1);
+
+		private BlockingQueue<CountDownLatch> queue;
+		private CountDownLatch progressLatch = null;
 
 		// Constructor - start FP manager thread
-		FPManager() {
+		FPManager(BlockingQueue<CountDownLatch> queue) {
+			this.queue = queue;
 			// set now as the last time the refreshStateAudit ran
 			IntegrityMonitor.this.refreshStateAuditLastRunDate = new Date();
 			// start thread
@@ -1823,139 +1757,209 @@
 		@Override
 		public void run() {
 			logger.debug("FPManager thread running");
-			while (!exit) {
-				try {
-					Thread.sleep(CYCLE_INTERVAL_MILLIS);
-				} catch (InterruptedException e) {
-					// The 'sleep' call was interrupted
-					logger.debug("IntegrityMonitor threw exception.", e);
-					Thread.currentThread().interrupt();
-					continue;
+
+			try {
+				getLatch();
+				decrementLatch();
+
+				while (!stopper.await(cycleIntervalMillis, TimeUnit.MILLISECONDS)) {
+					getLatch();
+					IntegrityMonitor.this.runOnce();
+					decrementLatch();
 				}
 
-				try {
-					logger.debug("FPManager calling fpMonitorCycle()");
-					// check forward progress timer
-					IntegrityMonitor.this.fpMonitorCycle();
-
-					logger.debug("FPManager calling checkTestTransaction()");
-					// check test transaction timer
-					IntegrityMonitor.this.checkTestTransaction();
-
-					logger.debug("FPManager calling checkWriteFpc()");
-					// check write Fpc timer
-					IntegrityMonitor.this.checkWriteFpc();
-
-					logger.debug("FPManager calling checkDependentHealth()");
-					// check dependency health
-					IntegrityMonitor.this.checkDependentHealth();
-
-					logger.debug("FPManager calling refreshStateAudit()");
-					// check if it is time to run the refreshStateAudit
-					IntegrityMonitor.this.refreshStateAudit();
-
-					logger.debug("FPManager calling stateAudit()");
-					// check if it is time to run the stateAudit
-					IntegrityMonitor.this.stateAudit();
-
-				} catch (Exception e) {
-					logger.error(
-							"Ignore FPManager thread processing timer(s) exception: ",
-							e);
-				}
+			} catch (InterruptedException e) {
+				logger.debug("IntegrityMonitor threw exception.", e);
+				Thread.currentThread().interrupt();
 			}
 		}
 
 		public void stopAndExit() {
-			exit = true;
-			// Referring to the FPManager instance
-			FPManager.this.interrupt();
+			stopper.countDown();
+			this.interrupt();
 		}
 
+		/**
+		 * Gets the next latch from the queue.
+		 * 
+		 * @throws InterruptedException
+		 * 
+		 */
+		private void getLatch() throws InterruptedException {
+			if (queue != null) {
+				progressLatch = queue.take();
+			}
+		}
+
+		/**
+		 * Decrements the current latch.
+		 */
+		private void decrementLatch() {
+			if (progressLatch != null) {
+				progressLatch.countDown();
+			}
+		}
+
+	}
+
+	private void runOnce() {
+		try {
+			logger.debug("FPManager calling fpMonitorCycle()");
+			// check forward progress timer
+			fpMonitorCycle();
+
+			logger.debug("FPManager calling checkTestTransaction()");
+			// check test transaction timer
+			checkTestTransaction();
+
+			logger.debug("FPManager calling checkWriteFpc()");
+			// check write Fpc timer
+			checkWriteFpc();
+
+			logger.debug("FPManager calling checkDependentHealth()");
+			// check dependency health
+			checkDependentHealth();
+
+			logger.debug("FPManager calling refreshStateAudit()");
+			// check if it is time to run the refreshStateAudit
+			refreshStateAudit();
+
+			logger.debug("FPManager calling stateAudit()");
+			// check if it is time to run the stateAudit
+			stateAudit();
+
+		} catch (Exception e) {
+			logger.error("Ignore FPManager thread processing timer(s) exception: ", e);
+		}
 	}
 
 	public void allSeemsWell(@NotNull String key, @NotNull Boolean asw, @NotNull String msg)
 			throws AllSeemsWellException {
 
 		logger.debug("allSeemsWell entry: key = {}, asw = {}, msg = {}", key, asw, msg);
-		if(key == null || key.isEmpty()){
+		if (key == null || key.isEmpty()) {
 			logger.error("allSeemsWell: 'key' has no visible content");
 			throw new IllegalArgumentException("allSeemsWell: 'key' has no visible content");
 		}
-		if(asw == null){
+		if (asw == null) {
 			logger.error("allSeemsWell: 'asw' is null");
 			throw new IllegalArgumentException("allSeemsWell: 'asw' is null");
 		}
-		if(msg == null || msg.isEmpty()){
+		if (msg == null || msg.isEmpty()) {
 			logger.error("allSeemsWell: 'msg' has no visible content");
 			throw new IllegalArgumentException("allSeemsWell: 'msg' has no visible content");
 		}
-		
-		if(allSeemsWellMap == null){
+
+		if (allSeemsWellMap == null) {
 			allSeemsWellMap = new HashMap<>();
 		}
-		
-		if(allNotWellMap == null){
+
+		if (allNotWellMap == null) {
 			allNotWellMap = new HashMap<>();
 		}
 
-		if(asw){
+		if (asw) {
 			logger.info("allSeemsWell: ALL SEEMS WELL: key = {}, msg = {}", key, msg);
-			try{
+			try {
 				allSeemsWellMap.put(key, msg);
-			}catch(Exception e){
-				String exceptMsg ="allSeemsWell: encountered an exception with allSeemsWellMap.put("
-						+ key + "," + msg + ")";
+			} catch (Exception e) {
+				String exceptMsg = "allSeemsWell: encountered an exception with allSeemsWellMap.put(" + key + "," + msg
+						+ ")";
 				logger.error(exceptMsg);
 				throw new AllSeemsWellException(exceptMsg, e);
 			}
 
-			try{
+			try {
 				allNotWellMap.remove(key);
-			}catch(Exception e){
-				String exceptMsg ="allSeemsWell: encountered an exception with allNotWellMap.delete("
-						+ key + ")";
+			} catch (Exception e) {
+				String exceptMsg = "allSeemsWell: encountered an exception with allNotWellMap.delete(" + key + ")";
 				logger.error(exceptMsg);
 				throw new AllSeemsWellException(exceptMsg, e);
 			}
 
-		}else{
+		} else {
 			logger.error("allSeemsWell: ALL NOT WELL: key = {}, msg = {}", key, msg);
-			try{
+			try {
 				allSeemsWellMap.remove(key);
-			}catch(Exception e){
-				String exceptMsg ="allSeemsWell: encountered an exception with allSeemsWellMap.remove("
-						+ key + ")";
+			} catch (Exception e) {
+				String exceptMsg = "allSeemsWell: encountered an exception with allSeemsWellMap.remove(" + key + ")";
 				logger.error(exceptMsg);
 				throw new AllSeemsWellException(exceptMsg, e);
 			}
 
-			try{
+			try {
 				allNotWellMap.put(key, msg);
-			}catch(Exception e){
-				String exceptMsg ="allSeemsWell: encountered an exception with allNotWellMap.put("
-						+ key + msg + ")";
+			} catch (Exception e) {
+				String exceptMsg = "allSeemsWell: encountered an exception with allNotWellMap.put(" + key + msg + ")";
 				logger.error(exceptMsg);
 				throw new AllSeemsWellException(exceptMsg, e);
 			}
 		}
 
-		if(logger.isDebugEnabled()){
-			for(Entry<String, String> entry: allSeemsWellMap.entrySet()){
-				logger.debug("allSeemsWellMap: key = {}  msg = {}", entry.getKey(), entry.getValue());							
+		if (logger.isDebugEnabled()) {
+			for (Entry<String, String> entry : allSeemsWellMap.entrySet()) {
+				logger.debug("allSeemsWellMap: key = {}  msg = {}", entry.getKey(), entry.getValue());
 			}
-			for(Entry<String, String> entry: allNotWellMap.entrySet()){
-				logger.debug("allNotWellMap: key = {}  msg = {}", entry.getKey(), entry.getValue());							
+			for (Entry<String, String> entry : allNotWellMap.entrySet()) {
+				logger.debug("allNotWellMap: key = {}  msg = {}", entry.getKey(), entry.getValue());
 			}
 			logger.debug("allSeemsWell exit");
 		}
 	}
 
-	public Map<String, String> getAllSeemsWellMap(){
+	/**
+	 * Converts the given value to milliseconds using the current
+	 * {@link #propertyUnits}.
+	 * 
+	 * @param value
+	 *            value to be converted, or -1
+	 * @return the value, in milliseconds, or -1
+	 */
+	private static long toMillis(long value) {
+		return (value < 0 ? -1 : propertyUnits.toMillis(value));
+	}
+
+	public Map<String, String> getAllSeemsWellMap() {
 		return allSeemsWellMap;
 	}
 
-	public Map<String, String> getAllNotWellMap(){
+	public Map<String, String> getAllNotWellMap() {
 		return allNotWellMap;
 	}
+
+	/*
+	 * The remaining methods are used by JUnit tests.
+	 */
+
+	public static boolean isUnitTesting() {
+		return isUnitTesting;
+	}
+
+	public static void setUnitTesting(boolean isUnitTesting) {
+		IntegrityMonitor.isUnitTesting = isUnitTesting;
+	}
+
+	protected static TimeUnit getPropertyUnits() {
+		return propertyUnits;
+	}
+
+	protected static void setPropertyUnits(TimeUnit propertyUnits) {
+		IntegrityMonitor.propertyUnits = propertyUnits;
+	}
+
+	protected static long getCycleIntervalMillis() {
+		return cycleIntervalMillis;
+	}
+
+	protected static void setCycleIntervalMillis(long cycleIntervalMillis) {
+		IntegrityMonitor.cycleIntervalMillis = cycleIntervalMillis;
+	}
+
+	protected static String getPersistenceUnit() {
+		return persistenceUnit;
+	}
+
+	protected static void setPersistenceUnit(String persistenceUnit) {
+		IntegrityMonitor.persistenceUnit = persistenceUnit;
+	}
 }
diff --git a/integrity-monitor/src/main/java/org/onap/policy/common/im/StateManagement.java b/integrity-monitor/src/main/java/org/onap/policy/common/im/StateManagement.java
index 05da2a8..ccc12d4 100644
--- a/integrity-monitor/src/main/java/org/onap/policy/common/im/StateManagement.java
+++ b/integrity-monitor/src/main/java/org/onap/policy/common/im/StateManagement.java
@@ -20,19 +20,19 @@
 
 package org.onap.policy.common.im;
 
-import java.util.*;
+import java.util.Date;
+import java.util.List;
+import java.util.Observable;
 
 import javax.persistence.EntityManager;
 import javax.persistence.EntityManagerFactory;
-import javax.persistence.EntityTransaction;
 import javax.persistence.FlushModeType;
 import javax.persistence.LockModeType;
 import javax.persistence.Query;
 
-
 import org.onap.policy.common.im.jpa.StateManagementEntity;
-import org.onap.policy.common.im.StateElement;
-import org.onap.policy.common.im.StandbyStatusException;
+import org.onap.policy.common.utils.jpa.EntityMgrCloser;
+import org.onap.policy.common.utils.jpa.EntityTransCloser;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 /**
@@ -104,59 +104,44 @@
 	  if(logger.isDebugEnabled()){
 		  logger.debug("StateManagement: constructor, resourceName: {}", resourceName);
 	  }
+	  
 	  EntityManager em = emf.createEntityManager();
-      EntityTransaction et = em.getTransaction();
+	  try(EntityMgrCloser emc = new EntityMgrCloser(em);
+			  MyTransaction et = new MyTransaction(em)) {
 
-      if(!et.isActive()){
-    	  et.begin();
-      }
-      this.resourceName = resourceName; 
-      if(logger.isDebugEnabled()){
-    	  logger.debug("resourceName = {}", this.resourceName);
-      }
-      
+	      this.resourceName = resourceName; 
+	      if(logger.isDebugEnabled()){
+	    	  logger.debug("resourceName = {}", this.resourceName);
+	      }
+	      
 
-      try {
-        //Create a StateManagementEntity object
-    	  if(logger.isDebugEnabled()){
-    		  logger.debug("findStateManagementEntity for {}", this.resourceName); 
-    	  }
-        StateManagementEntity sm = findStateManagementEntity(em, this.resourceName); 
+	      try {
+	        //Create a StateManagementEntity object
+	    	  if(logger.isDebugEnabled()){
+	    		  logger.debug("findStateManagementEntity for {}", this.resourceName); 
+	    	  }
+	        StateManagementEntity sm = findStateManagementEntity(em, this.resourceName); 
 
-        //persist the administrative state
-        if (sm != null) {
-        	if(logger.isDebugEnabled()){
-        		logger.debug("Persist adminstrative state, resourceName = {}", this.resourceName); 
-        	}
-          em.persist(sm);
-          synchronized(FLUSHLOCK){
-        	  if(et.isActive()){
-        		  et.commit(); 
-        	  }
-          }
-        } else {
-        	synchronized(FLUSHLOCK){
-          	  if(et.isActive()){
-        		  et.commit(); 
-        	  }
-        	}
-        }
-        
-  	  //Load the StateTransition hash table
-        st = new StateTransition();
+	        //persist the administrative state
+	        if (sm != null) {
+	        	if(logger.isDebugEnabled()){
+	        		logger.debug("Persist adminstrative state, resourceName = {}", this.resourceName); 
+	        	}
+	          em.persist(sm);
+	        }
+            et.commit();
+	        
+	  	  //Load the StateTransition hash table
+	        st = new StateTransition();
 
-        if(logger.isDebugEnabled()){
-        	logger.debug("StateManagement: constructor end, resourceName: {}", this.resourceName);
-        }
-      } catch(Exception ex) {
-    	  logger.error("StateManagement: constructor caught unexpected exception: ", ex);
-    	  synchronized(FLUSHLOCK){
-    		  if(et.isActive()){
-    			  et.rollback();
-    		  }
-    	  }
-    	  throw new StateManagementException("StateManagement: Exception: " + ex.toString(), ex);
-      } 
+	        if(logger.isDebugEnabled()){
+	        	logger.debug("StateManagement: constructor end, resourceName: {}", this.resourceName);
+	        }
+	      } catch(Exception ex) {
+	    	  logger.error("StateManagement: constructor caught unexpected exception: ", ex);
+	    	  throw new StateManagementException("StateManagement: Exception: " + ex.toString(), ex);
+	      } 
+	  }
   }
   
   /**
@@ -174,14 +159,11 @@
 		  if(logger.isDebugEnabled()){
 			  logger.debug("StateManagement: initializeState() operation started, resourceName = {}", this.resourceName);
 		  }
-		  EntityManager em = emf.createEntityManager();  
-		  EntityTransaction et = em.getTransaction();
+		  EntityManager em = emf.createEntityManager();
 
-		  if(!et.isActive()){
-			  et.begin();
-		  }
-
-		  try {
+		  try(EntityMgrCloser emc = new EntityMgrCloser(em);
+				  MyTransaction et = new MyTransaction(em)) {
+			  
 			  if(logger.isDebugEnabled()){
 				  logger.debug("findStateManagementEntity for {}", this.resourceName); 
 			  }
@@ -193,11 +175,7 @@
 			  sm.setStandbyStatus(StateManagement.NULL_VALUE); 
 
 			  em.persist(sm);
-			  synchronized(FLUSHLOCK){
-	        	  if(et.isActive()){
-	        		  et.commit(); 
-	        	  }
-			  }
+    		  et.commit(); 
 			  setChanged();
 			  notifyObservers(ADMIN_STATE);
 
@@ -206,11 +184,6 @@
 			  }
 		  } catch(Exception ex) {
 			  logger.error("StateManagement.initializeState() caught unexpected exception: ", ex);
-			  synchronized(FLUSHLOCK){
-				  if(et.isActive()){
-					  et.rollback();
-				  }
-			  }
 			  throw new StateManagementException("StateManagement.initializeState() Exception: " + ex);
 		  }
 	  }
@@ -230,13 +203,10 @@
 			  logger.debug("StateManagement: lock() operation started, resourceName = {}", this.resourceName);
 		  }
 		  EntityManager em = emf.createEntityManager();
-		  EntityTransaction et = em.getTransaction();
 
-		  if(!et.isActive()){
-			  et.begin();
-		  }
-
-		  try {
+		  try(EntityMgrCloser emc = new EntityMgrCloser(em);
+				  MyTransaction et = new MyTransaction(em)) {
+			  
 			  if(logger.isDebugEnabled()){
 				  logger.debug("findStateManagementEntity for {}", this.resourceName); 
 			  }
@@ -251,11 +221,7 @@
 			  sm.setStandbyStatus(stateElement.getEndingStandbyStatus());
 
 			  em.persist(sm);
-			  synchronized(FLUSHLOCK){
-	        	  if(et.isActive()){
-	        		  et.commit(); 
-	        	  }
-			  }
+    		  et.commit(); 
 			  setChanged();
 			  notifyObservers(ADMIN_STATE);
 
@@ -264,11 +230,6 @@
 			  }
 		  } catch(Exception ex) {
 			  logger.error("StateManagement.lock() caught unexpected exception: ", ex);
-			  synchronized(FLUSHLOCK){
-				  if(et.isActive()){
-					  et.rollback();
-				  }
-			  }
 			  throw new StateManagementException("StateManagement.lock() Exception: " + ex.toString());
 		  } 
 	  }
@@ -288,13 +249,10 @@
 			  logger.debug("StateManagement: unlock() operation started, resourceName = {}", this.resourceName);
 		  }
 		  EntityManager em = emf.createEntityManager();
-		  EntityTransaction et = em.getTransaction();
 
-		  if(!et.isActive()){
-			  et.begin();  
-		  }
-
-		  try {
+		  try(EntityMgrCloser emc = new EntityMgrCloser(em);
+				  MyTransaction et = new MyTransaction(em)) {
+			  
 			  if(logger.isDebugEnabled()){
 				  logger.debug("findStateManagementEntity for {}", this.resourceName); 
 			  }
@@ -308,11 +266,7 @@
 			  sm.setStandbyStatus(stateElement.getEndingStandbyStatus()); 
 
 			  em.persist(sm);
-			  synchronized(FLUSHLOCK){
-	        	  if(et.isActive()){
-	        		  et.commit(); 
-	        	  } 
-			  }
+    		  et.commit(); 
 			  setChanged();
 			  notifyObservers(ADMIN_STATE);
 
@@ -321,11 +275,6 @@
 			  }
 		  } catch(Exception ex) {
 			  logger.error("StateManagement.unlock() caught unexpected exception: ", ex);
-			  synchronized(FLUSHLOCK){
-				  if(et.isActive()){
-					  et.rollback();
-				  }
-			  }
 			  throw new StateManagementException("StateManagement.unlock() Exception: " + ex);
 		  }
 	  }
@@ -346,13 +295,10 @@
 			  logger.debug("StateManagement: enableNotFailed() operation started, resourceName = {}", this.resourceName);
 		  }
 		  EntityManager em = emf.createEntityManager();
-		  EntityTransaction et = em.getTransaction();
 
-		  if(!et.isActive()){
-			  et.begin();
-		  }
-
-		  try {
+		  try(EntityMgrCloser emc = new EntityMgrCloser(em);
+				  MyTransaction et = new MyTransaction(em)) {
+			  
 			  if(logger.isDebugEnabled()){
 				  logger.debug("findStateManagementEntity for {}", this.resourceName); 
 			  }
@@ -366,11 +312,8 @@
 			  sm.setStandbyStatus(stateElement.getEndingStandbyStatus()); 
 
 			  em.persist(sm);
-			  synchronized(FLUSHLOCK){
-	        	  if(et.isActive()){
-	        		  et.commit(); 
-	        	  }
-			  }
+    		  et.commit(); 
+    		  
 			  setChanged();
 			  notifyObservers(OPERATION_STATE);
 
@@ -379,11 +322,6 @@
 			  }
 		  } catch(Exception ex) {
 			  logger.error("StateManagement.enableNotFailed() caught unexpected exception: ", ex);
-			  synchronized(FLUSHLOCK){
-				  if(et.isActive()){
-					  et.rollback();
-				  }
-			  }
 			  throw new StateManagementException("StateManagement.enableNotFailed() Exception: " + ex);
 		  }
 	  }
@@ -403,12 +341,10 @@
 			  logger.debug("StateManagement: disableFailed() operation started, resourceName = {}", this.resourceName);
 		  }
 		  EntityManager em = emf.createEntityManager();
-		  EntityTransaction et = em.getTransaction();
-		  if(!et.isActive()){
-			  et.begin();
-		  }
 
-		  try {
+		  try(EntityMgrCloser emc = new EntityMgrCloser(em);
+				  MyTransaction et = new MyTransaction(em)) {
+			  
 			  if(logger.isDebugEnabled()){
 				  logger.debug("findStateManagementEntity for {}", this.resourceName); 
 			  }
@@ -422,11 +358,7 @@
 			  sm.setStandbyStatus(stateElement.getEndingStandbyStatus()); 
 
 			  em.persist(sm);
-			  synchronized(FLUSHLOCK){
-	        	  if(et.isActive()){
-	        		  et.commit(); 
-	        	  } 
-			  }
+    		  et.commit(); 
 			  setChanged();
 			  notifyObservers(OPERATION_STATE);
 
@@ -435,11 +367,6 @@
 			  }
 		  } catch(Exception ex) {
 			  logger.error("StateManagement.disableFailed() caught unexpected exception: ", ex);
-			  synchronized(FLUSHLOCK){
-				  if(et.isActive()){
-					  et.rollback();
-				  }
-			  }
 			  throw new StateManagementException("StateManagement.disableFailed() Exception: " + ex);
 		  }
 	  }
@@ -465,12 +392,10 @@
 				   otherResourceName);
 		  }
 		  EntityManager em = emf.createEntityManager();
-		  EntityTransaction et = em.getTransaction();
-		  if(!et.isActive()){
-			  et.begin();
-		  }
 
-		  try {
+		  try(EntityMgrCloser emc = new EntityMgrCloser(em);
+				  MyTransaction et = new MyTransaction(em)) {
+			  
 			  if(logger.isDebugEnabled()){
 				  logger.debug("findStateManagementEntity for " + otherResourceName); 
 			  }
@@ -484,11 +409,7 @@
 			  sm.setStandbyStatus(stateElement.getEndingStandbyStatus()); 
 
 			  em.persist(sm);
-			  synchronized(FLUSHLOCK){
-	        	  if(et.isActive()){
-	        		  et.commit(); 
-	        	  } 
-			  }
+    		  et.commit(); 
 			  setChanged();
 			  notifyObservers(OPERATION_STATE);
 
@@ -498,11 +419,6 @@
 			  }
 		  } catch(Exception ex) {
 			  logger.error("StateManagement.disableFailed(otherResourceName) caught unexpected exception: ", ex);
-			  synchronized(FLUSHLOCK){
-				  if(et.isActive()){
-					  et.rollback();
-				  }
-			  }
 			  throw new StateManagementException("StateManagement.disableFailed(otherResourceName) Exception: " + ex);
 		  }
 	  }
@@ -522,13 +438,10 @@
 			  logger.debug("StateManagement: disableDependency() operation started, resourceName = {}", this.resourceName);
 		  }
 		  EntityManager em = emf.createEntityManager();
-		  EntityTransaction et = em.getTransaction();
 
-		  if(!et.isActive()){
-			  et.begin();
-		  }
-
-		  try {
+		  try(EntityMgrCloser emc = new EntityMgrCloser(em);
+				  MyTransaction et = new MyTransaction(em)) {
+			  
 			  if(logger.isDebugEnabled()){
 				  logger.debug("findStateManagementEntity for {}", this.resourceName); 
 			  }
@@ -542,11 +455,7 @@
 			  sm.setStandbyStatus(stateElement.getEndingStandbyStatus()); 
 
 			  em.persist(sm);
-			  synchronized(FLUSHLOCK){
-	        	  if(et.isActive()){
-	        		  et.commit(); 
-	        	  } 
-			  }
+    		  et.commit(); 
 			  setChanged();
 			  notifyObservers(OPERATION_STATE);
 
@@ -555,11 +464,6 @@
 			  }
 		  } catch(Exception ex) {
 			  logger.error("StateManagement.disableDependency() caught unexpected exception: ", ex);
-			  synchronized(FLUSHLOCK){
-				  if(et.isActive()){
-					  et.rollback();
-				  }
-			  }
 			  throw new StateManagementException("StateManagement.disableDependency() Exception: " + ex);
 		  }
 	  }
@@ -580,13 +484,10 @@
 			  logger.debug("StateManagement: enableNoDependency() operation started, resourceName = {}", this.resourceName);
 		  }
 		  EntityManager em = emf.createEntityManager();
-		  EntityTransaction et = em.getTransaction();
 
-		  if(!et.isActive()){
-			  et.begin();
-		  }
-
-		  try {
+		  try(EntityMgrCloser emc = new EntityMgrCloser(em);
+				  MyTransaction et = new MyTransaction(em)) {
+			  
 			  if(logger.isDebugEnabled()){
 				  logger.debug("findStateManagementEntity for {}", this.resourceName); 
 			  }
@@ -600,11 +501,7 @@
 			  sm.setStandbyStatus(stateElement.getEndingStandbyStatus()); 
 
 			  em.persist(sm);
-			  synchronized(FLUSHLOCK){
-	        	  if(et.isActive()){
-	        		  et.commit(); 
-	        	  } 
-			  }
+    		  et.commit(); 
 			  setChanged();
 			  notifyObservers(OPERATION_STATE);
 
@@ -613,11 +510,6 @@
 			  }
 		  } catch(Exception ex) {
 			  logger.error("StateManagement.enableNoDependency() caught unexpected exception: ", ex);
-			  synchronized(FLUSHLOCK){
-				  if(et.isActive()){
-					  et.rollback();
-				  }
-			  }
 			  throw new StateManagementException("StateManagement.enableNoDependency() Exception: " + ex);
 		  }
 	  }
@@ -637,16 +529,14 @@
 		  if(logger.isDebugEnabled()){
 			  logger.debug("StateManagement: promote() operation started, resourceName = {}", this.resourceName);
 		  }
-		  EntityManager em = emf.createEntityManager();
-		  EntityTransaction et = em.getTransaction();
-
-		  if(!et.isActive()){
-			  et.begin();
-		  }
 		  
 		  StateManagementEntity sm;
+		  
+		  EntityManager em = emf.createEntityManager();
 
-		  try{
+		  try(EntityMgrCloser emc = new EntityMgrCloser(em);
+				  MyTransaction et = new MyTransaction(em)) {
+		  
 			  if(logger.isDebugEnabled()){
 				  logger.debug("findStateManagementEntity for {}", this.resourceName); 
 			  }
@@ -660,20 +550,11 @@
 			  sm.setStandbyStatus(stateElement.getEndingStandbyStatus()); 
 
 			  em.persist(sm);
-			  synchronized(FLUSHLOCK){
-				  if(et.isActive()){
-					  et.commit(); 
-				  }
-			  }
+			  et.commit(); 
 			  setChanged();
 			  notifyObservers(STANDBY_STATUS);
 		  }catch(Exception ex){
 			  logger.error("StateManagement.promote() caught unexpected exception: ", ex);
-			  synchronized(FLUSHLOCK){
-				  if(et.isActive()){
-					  et.rollback();
-				  }
-			  }
 			  throw new StateManagementException("StateManagement.promote() Exception: " + ex);
 		  }
 
@@ -701,13 +582,10 @@
 			  logger.debug("StateManagement: demote() operation started, resourceName = {}", this.resourceName);
 		  }
 		  EntityManager em = emf.createEntityManager();
-		  EntityTransaction et = em.getTransaction();
 
-		  if(!et.isActive()){
-			  et.begin();
-		  }
-
-		  try {
+		  try(EntityMgrCloser emc = new EntityMgrCloser(em);
+				  MyTransaction et = new MyTransaction(em)) {
+			  
 			  if(logger.isDebugEnabled()){
 				  logger.debug("findStateManagementEntity for {}", this.resourceName); 
 			  }
@@ -721,11 +599,7 @@
 			  sm.setStandbyStatus(stateElement.getEndingStandbyStatus()); 
 
 			  em.persist(sm);
-			  synchronized(FLUSHLOCK){
-	        	  if(et.isActive()){
-	        		  et.commit(); 
-	        	  } 
-			  }
+    		  et.commit(); 
 			  setChanged();
 			  notifyObservers(STANDBY_STATUS); 
 
@@ -734,11 +608,6 @@
 			  }
 		  } catch(Exception ex) {
 			  logger.error("StateManagement.demote() caught unexpected exception: ", ex);
-			  synchronized(FLUSHLOCK){
-				  if(et.isActive()){
-					  et.rollback();
-				  }
-			  }
 			  throw new StateManagementException("StateManagement.demote() Exception: " + ex);
 		  }
 	  }
@@ -764,13 +633,10 @@
 			  logger.debug("\nStateManagement: SYNCLOCK demote(otherResourceName) operation for resourceName = {}\n", otherResourceName);
 		  }
 		  EntityManager em = emf.createEntityManager();
-		  EntityTransaction et = em.getTransaction();
 
-		  if(!et.isActive()){
-			  et.begin();
-		  }
-
-		  try {
+		  try(EntityMgrCloser emc = new EntityMgrCloser(em);
+				  MyTransaction et = new MyTransaction(em)) {
+			  
 			  if(logger.isDebugEnabled()){
 				  logger.debug("StateManagement: SYNCLOCK demote(otherResourceName) findStateManagementEntity for {}", otherResourceName); 
 			  }
@@ -784,11 +650,7 @@
 			  sm.setStandbyStatus(stateElement.getEndingStandbyStatus()); 
 
 			  em.persist(sm);
-			  synchronized(FLUSHLOCK){
-	        	  if(et.isActive()){
-	        		  et.commit(); 
-	        	  } 
-			  }
+    		  et.commit(); 
 			  //We don't notify observers because this is assumed to be a remote resource
 
 			  if(logger.isDebugEnabled()){
@@ -796,11 +658,6 @@
 			  }
 		  } catch(Exception ex) {
 			  logger.error("StateManagement.demote(otherResourceName) caught unexpected exception: ", ex);
-			  synchronized(FLUSHLOCK){
-				  if(et.isActive()){
-					  et.rollback();
-				  }
-			  }
 			  throw new StateManagementException("StateManagement.demote(otherResourceName) Exception: " + ex);
 		  }
 	  }
@@ -814,8 +671,9 @@
 	  if(logger.isDebugEnabled()){
 		  logger.debug("StateManagement(6/1/16): getAdminState for resourceName {}", this.resourceName);
 	  }
-	  try {
-		  EntityManager em = emf.createEntityManager();
+
+	  EntityManager em = emf.createEntityManager();
+	  try(EntityMgrCloser emc = new EntityMgrCloser(em)) {
           Query query = em.createQuery("Select p from StateManagementEntity p where p.resourceName=:resource");
        
           query.setParameter("resource", this.resourceName);
@@ -848,8 +706,9 @@
 	  if(logger.isDebugEnabled()){
 		  logger.debug("StateManagement(6/1/16): getOpState for resourceName {}", this.resourceName);
 	  }
-	  try {
-		  EntityManager em = emf.createEntityManager();
+
+	  EntityManager em = emf.createEntityManager();
+	  try(EntityMgrCloser emc = new EntityMgrCloser(em)) {
           Query query = em.createQuery("Select p from StateManagementEntity p where p.resourceName=:resource");
        
           query.setParameter("resource", this.resourceName);
@@ -882,8 +741,9 @@
 	  if(logger.isDebugEnabled()){
 		  logger.debug("StateManagement(6/1/16): getAvailStatus for resourceName {}", this.resourceName);
 	  }
-	  try {
-		  EntityManager em = emf.createEntityManager();
+
+	  EntityManager em = emf.createEntityManager();
+	  try(EntityMgrCloser emc = new EntityMgrCloser(em)) {
           Query query = em.createQuery("Select p from StateManagementEntity p where p.resourceName=:resource");
        
           query.setParameter("resource", this.resourceName);
@@ -916,8 +776,9 @@
 	  if(logger.isDebugEnabled()){
 		  logger.debug("StateManagement(6/1/16): getStandbyStatus for resourceName {}", this.resourceName);
 	  }
-	  try {
-		  EntityManager em = emf.createEntityManager();
+
+	  EntityManager em = emf.createEntityManager();
+	  try(EntityMgrCloser emc = new EntityMgrCloser(em)) {
           Query query = em.createQuery("Select p from StateManagementEntity p where p.resourceName=:resource");
        
           query.setParameter("resource", this.resourceName);
@@ -999,11 +860,9 @@
 		
 		// The transaction is required for the LockModeType
 		EntityManager em = emf.createEntityManager();
-		EntityTransaction et = em.getTransaction();
-		if(!et.isActive()){
-			et.begin();
-		}
-		try {
+
+		try(EntityMgrCloser emc = new EntityMgrCloser(em);
+				  MyTransaction et = new MyTransaction(em)) {
 
 			Query stateManagementListQuery = em
 					.createQuery("SELECT p FROM StateManagementEntity p WHERE p.resourceName=:resource");
@@ -1023,18 +882,10 @@
 			} else {
 				logger.error("getStandbyStatus: resourceName ={} not found in statemanagemententity table", otherResourceName);
 			}
-			synchronized(FLUSHLOCK){
-	        	  if(et.isActive()){
-	        		  et.commit(); 
-	        	  }
-			}
+
+  		    et.commit(); 
 		} catch (Exception e) {
 			logger.error("getStandbyStatus: Caught Exception attempting to get statemanagemententity record, message='{}'", e.getMessage(), e);
-			synchronized(FLUSHLOCK){
-				if(et.isActive()){
-					et.rollback();
-				}
-			}
 		}
 		if (logger.isDebugEnabled()) {
 			logger.debug("getStandbyStatus: Returning standbyStatus={}", tempStandbyStatus);
@@ -1056,12 +907,9 @@
 	   * Start transaction
 	   */
 	  EntityManager em = emf.createEntityManager();
-	  EntityTransaction et = em.getTransaction();
-	  if(!et.isActive()){
-		  et.begin();
-	  }
 
-	  try{
+	  try(EntityMgrCloser emc = new EntityMgrCloser(em);
+				  MyTransaction et = new MyTransaction(em)) {
 		  Query stateManagementEntityListQuery = em
 				  .createQuery("SELECT p FROM StateManagementEntity p");
 		  @SuppressWarnings("unchecked")
@@ -1078,22 +926,43 @@
 			  }
 			  em.remove(stateManagementEntity);
 		  }
-		  synchronized(FLUSHLOCK){
-        	  if(et.isActive()){
-        		  et.commit(); 
-        	  }
-		  }
+
+		  et.commit(); 
 	  }catch(Exception ex){
 		  logger.error("StateManagement.deleteAllStateManagementEntities() caught Exception: ", ex);
-		  synchronized(FLUSHLOCK){
-			  if(et.isActive()){
-				  et.rollback();
-			  }
-		  }
 	  }
 	  if(logger.isDebugEnabled()){
 		  logger.debug("deleteAllStateManagementEntities: Exiting");
 	  }
   }
+  
+  private static class MyTransaction extends EntityTransCloser {
+
+	/**
+	 * @param em
+	 */
+	public MyTransaction(EntityManager em) {
+		super(em.getTransaction());
+	}
+
+	@Override
+	public void commit() {
+		synchronized(FLUSHLOCK){
+			if(getTransation().isActive()){
+				super.commit();
+			}
+		}
+	}
+
+	@Override
+	public void rollback() {
+		synchronized(FLUSHLOCK){
+			if(getTransation().isActive()){
+				super.rollback();
+			}
+		}
+	}
+	  
+  }
 
 }
diff --git a/integrity-monitor/src/main/resources/META-INF/persistence.xml b/integrity-monitor/src/main/resources/META-INF/persistence.xml
index 7fbec09..f5089b1 100644
--- a/integrity-monitor/src/main/resources/META-INF/persistence.xml
+++ b/integrity-monitor/src/main/resources/META-INF/persistence.xml
@@ -30,9 +30,6 @@
 		<shared-cache-mode>NONE</shared-cache-mode>
 		<properties>
 			<property name="javax.persistence.schema-generation.database.action" value="drop-and-create"/>
-			<property name="javax.persistence.schema-generation.scripts.action" value="drop-and-create"/> 
-            <property name="javax.persistence.schema-generation.scripts.create-target" value="./sql/generatedCreateNcomp.ddl"/>
-            <property name="javax.persistence.schema-generation.scripts.drop-target" value="./sql/generatedDropNcomp.ddl"/>
         </properties>
 	</persistence-unit>
 
diff --git a/integrity-monitor/src/test/java/org/onap/policy/common/im/AllSeemsWellTest.java b/integrity-monitor/src/test/java/org/onap/policy/common/im/AllSeemsWellTest.java
new file mode 100644
index 0000000..967ca73
--- /dev/null
+++ b/integrity-monitor/src/test/java/org/onap/policy/common/im/AllSeemsWellTest.java
@@ -0,0 +1,173 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Integrity Monitor
+ * ================================================================================
+ * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.policy.common.im;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.util.Map;
+import java.util.Properties;
+
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class AllSeemsWellTest extends IntegrityMonitorTestBase {
+	private static Logger logger = LoggerFactory.getLogger(AllSeemsWellTest.class);
+
+	private static final long STATE_CYCLE_MS = 3 * CYCLE_INTERVAL_MS;
+
+	private static Properties myProp;
+	private static String resourceName;
+
+	@BeforeClass
+	public static void setUpClass() throws Exception {
+		IntegrityMonitorTestBase.setUpBeforeClass(DEFAULT_DB_URL_PREFIX + AllSeemsWellTest.class.getSimpleName());
+
+		resourceName = IntegrityMonitorTestBase.siteName + "." + IntegrityMonitorTestBase.nodeType;
+	}
+
+	@AfterClass
+	public static void tearDownClass() throws Exception {
+		IntegrityMonitorTestBase.tearDownAfterClass();
+	}
+
+	@Before
+	public void setUp() {
+		super.setUpTest();
+
+		myProp = makeProperties();
+
+	}
+
+	@After
+	public void tearDown() {
+		super.tearDownTest();
+	}
+
+	// Ignore
+	@Test
+	public void testAllSeemsWell() throws Exception {
+		logger.debug("\nIntegrityMonitorTest: Entering testAllSeemsWell\n\n");
+
+		// parameters are passed via a properties file
+		myProp.put(IntegrityMonitorProperties.DEPENDENCY_GROUPS, "");
+		myProp.put(IntegrityMonitorProperties.TEST_VIA_JMX, "false");
+		myProp.put(IntegrityMonitorProperties.REFRESH_STATE_AUDIT_INTERVAL_MS, "-1");
+		myProp.put(IntegrityMonitorProperties.STATE_AUDIT_INTERVAL_MS, "-1");
+		myProp.put(IntegrityMonitorProperties.FAILED_COUNTER_THRESHOLD, "1");
+		myProp.put(IntegrityMonitorProperties.FP_MONITOR_INTERVAL, "5");
+		myProp.put(IntegrityMonitorProperties.TEST_TRANS_INTERVAL, "1");
+		myProp.put(IntegrityMonitorProperties.WRITE_FPC_INTERVAL, "1");
+
+		IntegrityMonitor.updateProperties(myProp);
+		/*
+		 * The monitorInterval is 5 and the failedCounterThreshold is 1 A
+		 * forward progress will be stale after 5 seconds.
+		 */
+
+		IntegrityMonitor im = IntegrityMonitor.getInstance(resourceName, myProp);
+
+		StateManagement sm = im.getStateManager();
+
+		// Give it time to set the states in the DB
+		Thread.sleep(STATE_CYCLE_MS);
+
+		// Check the state
+		logger.debug(
+				"\n\ntestAllSeemsWell starting im state \nAdminState = {}\nOpState() = {}\nAvailStatus = {}\nStandbyStatus = {}\n",
+				sm.getAdminState(), sm.getOpState(), sm.getAvailStatus(), sm.getStandbyStatus());
+
+		assertEquals(StateManagement.ENABLED, sm.getOpState());
+
+		// Indicate a failure
+		im.allSeemsWell(this.getClass().getName(), IntegrityMonitorProperties.ALLNOTWELL,
+				"'AllSeemsWellTest - ALLNOTWELL'");
+
+		// Wait for the state to change due to ALLNOTWELL
+		Thread.sleep(STATE_CYCLE_MS);
+		// Check the state
+		logger.debug(
+				"\n\ntestAllSeemsWell after ALLNOTWELL: im state \nAdminState = {}\nOpState() = {}\nAvailStatus = {}\nStandbyStatus = {}\n",
+				sm.getAdminState(), sm.getOpState(), sm.getAvailStatus(), sm.getStandbyStatus());
+
+		// assertEquals(StateManagement.DISABLED, sm.getOpState());
+
+		Map<String, String> allNotWellMap = im.getAllNotWellMap();
+		for (String key : allNotWellMap.keySet()) {
+			logger.debug("AllSeemsWellTest: allNotWellMap: key = {}  msg = {}", key, allNotWellMap.get(key));
+		}
+		// assertEquals(1, allNotWellMap.size());
+
+		Map<String, String> allSeemsWellMap = im.getAllSeemsWellMap();
+		// assertTrue(allSeemsWellMap.isEmpty());
+
+		// Return to normal
+		im.allSeemsWell(this.getClass().getName(), IntegrityMonitorProperties.ALLSEEMSWELL,
+				"'AllSeemsWellTest - ALLSEEMSWELL'");
+
+		// Wait for the state to change due to ALLNOTWELL
+		Thread.sleep(STATE_CYCLE_MS);
+		// Check the state
+		logger.debug(
+				"\n\ntestAllSeemsWell after ALLSEEMSWELL: im state \nAdminState = {}\nOpState() = {}\nAvailStatus = {}\nStandbyStatus = {}\n",
+				sm.getAdminState(), sm.getOpState(), sm.getAvailStatus(), sm.getStandbyStatus());
+
+		// assertEquals(StateManagement.ENABLED, sm.getOpState());
+
+		allNotWellMap = im.getAllNotWellMap();
+		assertTrue(allNotWellMap.isEmpty());
+
+		allSeemsWellMap = im.getAllSeemsWellMap();
+		assertEquals(1, allSeemsWellMap.size());
+		for (String key : allSeemsWellMap.keySet()) {
+			logger.debug("AllSeemsWellTest: allSeemsWellMap: key = {}  msg = {}", key, allSeemsWellMap.get(key));
+		}
+
+		// Check for null parameters
+		assertException(im, imx -> {
+			imx.allSeemsWell(null, IntegrityMonitorProperties.ALLSEEMSWELL, "'AllSeemsWellTest - ALLSEEMSWELL'");
+		});
+
+		assertException(im, imx -> {
+			im.allSeemsWell("", IntegrityMonitorProperties.ALLSEEMSWELL, "'AllSeemsWellTest - ALLSEEMSWELL'");
+		});
+
+		assertException(im, imx -> {
+			im.allSeemsWell(this.getClass().getName(), null, "'AllSeemsWellTest - ALLSEEMSWELL'");
+		});
+
+		assertException(im, imx -> {
+			im.allSeemsWell(this.getClass().getName(), IntegrityMonitorProperties.ALLSEEMSWELL, null);
+		});
+
+		assertException(im, imx -> {
+			im.allSeemsWell(this.getClass().getName(), IntegrityMonitorProperties.ALLSEEMSWELL, "");
+		});
+
+		logger.debug("\n\ntestAllSeemsWell: Exit\n\n");
+	}
+
+}
diff --git a/integrity-monitor/src/test/java/org/onap/policy/common/im/test/ExceptionsTest.java b/integrity-monitor/src/test/java/org/onap/policy/common/im/ExceptionsTest.java
similarity index 98%
rename from integrity-monitor/src/test/java/org/onap/policy/common/im/test/ExceptionsTest.java
rename to integrity-monitor/src/test/java/org/onap/policy/common/im/ExceptionsTest.java
index a5c5c91..5066f9d 100644
--- a/integrity-monitor/src/test/java/org/onap/policy/common/im/test/ExceptionsTest.java
+++ b/integrity-monitor/src/test/java/org/onap/policy/common/im/ExceptionsTest.java
@@ -18,7 +18,7 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.im.test;
+package org.onap.policy.common.im;
 
 import static org.junit.Assert.assertEquals;
 
diff --git a/integrity-monitor/src/test/java/org/onap/policy/common/im/IntegrityMonitorTest.java b/integrity-monitor/src/test/java/org/onap/policy/common/im/IntegrityMonitorTest.java
new file mode 100644
index 0000000..3704b07
--- /dev/null
+++ b/integrity-monitor/src/test/java/org/onap/policy/common/im/IntegrityMonitorTest.java
@@ -0,0 +1,907 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Integrity Monitor
+ * ================================================================================
+ * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.policy.common.im;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Properties;
+import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.LinkedBlockingQueue;
+
+import javax.persistence.EntityTransaction;
+import javax.persistence.Query;
+import javax.persistence.TemporalType;
+
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.onap.policy.common.im.jpa.ForwardProgressEntity;
+import org.onap.policy.common.im.jpa.ResourceRegistrationEntity;
+import org.onap.policy.common.im.jpa.StateManagementEntity;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/*
+ * All JUnits are designed to run in the local development environment
+ * where they have write privileges and can execute time-sensitive
+ * tasks.
+ */
+public class IntegrityMonitorTest extends IntegrityMonitorTestBase {
+	private static Logger logger = LoggerFactory.getLogger(IntegrityMonitorTest.class);
+
+	private static Properties myProp;
+	private static EntityTransaction et;
+	private static String resourceName;
+
+	private BlockingQueue<CountDownLatch> queue;
+
+	@BeforeClass
+	public static void setUpClass() throws Exception {
+		IntegrityMonitorTestBase.setUpBeforeClass(DEFAULT_DB_URL_PREFIX + IntegrityMonitorTest.class.getSimpleName());
+
+		resourceName = IntegrityMonitorTestBase.siteName + "." + IntegrityMonitorTestBase.nodeType;
+	}
+
+	@AfterClass
+	public static void tearDownClass() throws Exception {
+		IntegrityMonitorTestBase.tearDownAfterClass();
+	}
+
+	@Before
+	public void setUp() throws Exception {
+		super.setUpTest();
+
+		myProp = makeProperties();
+		et = null;
+	}
+
+	@After
+	public void tearDown() throws Exception {
+		if (et != null && et.isActive()) {
+			try {
+				et.rollback();
+
+			} catch (RuntimeException e) {
+				logger.error("cannot rollback transaction", e);
+			}
+		}
+
+		super.tearDownTest();
+	}
+
+	/*
+	 * The following test verifies the following test cases: New Install New
+	 * Install - Bad Dependency data Recovery from bad dependency data Lock Lock
+	 * restart Unlock Unlock restart
+	 */
+	@Test
+	public void testSanityJmx() throws Exception {
+		logger.debug("\nIntegrityMonitorTest: Entering testSanityJmx\n\n");
+
+		String dependent = "group1_logparser";
+
+		// parameters are passed via a properties file
+		myProp.put(IntegrityMonitorProperties.DEPENDENCY_GROUPS, dependent);
+		myProp.put(IntegrityMonitorProperties.TEST_VIA_JMX, "true");
+		// Disable the integrity monitor so it will not interfere
+		myProp.put(IntegrityMonitorProperties.FP_MONITOR_INTERVAL, "-1");
+		// Disable the refresh state audit
+		myProp.put(IntegrityMonitorProperties.REFRESH_STATE_AUDIT_INTERVAL_MS, "-1");
+		// Disable the state audit
+		myProp.put(IntegrityMonitorProperties.STATE_AUDIT_INTERVAL_MS, "-1");
+		// Disable the test transaction
+		myProp.put(IntegrityMonitorProperties.TEST_TRANS_INTERVAL, "-1");
+		// Disable the write FPC
+		myProp.put(IntegrityMonitorProperties.WRITE_FPC_INTERVAL, "-1");
+		// Speed up the check
+		myProp.put(IntegrityMonitorProperties.CHECK_DEPENDENCY_INTERVAL, "1");
+		// Fail dependencies after three seconds
+		myProp.put(IntegrityMonitorProperties.MAX_FPC_UPDATE_INTERVAL, "3");
+
+		IntegrityMonitor im = makeMonitor(resourceName, myProp);
+		logger.debug(
+				"\n\ntestSanityJmx starting im state \nAdminState = {}\nOpState() = {}\nAvailStatus = {}\nStandbyStatus = {}\n",
+				im.getStateManager().getAdminState(), im.getStateManager().getOpState(),
+				im.getStateManager().getAvailStatus(), im.getStateManager().getStandbyStatus());
+		// add an entry to Resource registration table in the DB for the
+		// dependent resource
+
+		et = em.getTransaction();
+		et.begin();
+		Query rquery = em.createQuery("Select r from ResourceRegistrationEntity r where r.resourceName=:rn");
+		rquery.setParameter("rn", dependent);
+
+		@SuppressWarnings("rawtypes")
+		List rrList = rquery.getResultList();
+		ResourceRegistrationEntity rrx = null;
+		if (rrList.isEmpty()) {
+			// register resource by adding entry to table in DB
+			logger.debug("Adding resource {}  to ResourceRegistration table", dependent);
+			rrx = new ResourceRegistrationEntity();
+			// set columns in entry
+			rrx.setResourceName(dependent);
+			rrx.setResourceUrl("service:jmx:somewhere:9999");
+			rrx.setNodeType("logparser");
+			rrx.setSite("siteA");
+		}
+		em.persist(rrx);
+		// flush to the DB
+		em.flush();
+
+		// commit transaction
+		et.commit();
+
+		// wait for the FPManager to check dependency health
+		waitStep();
+
+		assertException(im, imx -> {
+			imx.evaluateSanity();
+		});
+
+		// undo dependency groups and jmx test properties settings
+		myProp.put(IntegrityMonitorProperties.DEPENDENCY_GROUPS, "");
+		myProp.put(IntegrityMonitorProperties.TEST_VIA_JMX, "false");
+		IntegrityMonitor.updateProperties(myProp);
+
+		logger.debug("\ntestSantityJmx ending properties: {}", myProp);
+
+		// We know at this point that the IM is disable-dependency. We want to
+		// be
+		// sure it will recover from this condition since the properties were
+		// updated.
+
+		logger.debug(
+				"\n\ntestSanityJmx ending im state\nAdminState = {}\nOpState() = {}\nAvailStatus = {}\nStandbyStatus = {}\n",
+				im.getStateManager().getAdminState(), im.getStateManager().getOpState(),
+				im.getStateManager().getAvailStatus(), im.getStateManager().getStandbyStatus());
+
+		logger.debug("\ntestSanityJmx restarting the IntegrityMonitor");
+		// Create a new instance. It should recover from the disabled-dependency
+		// condition
+		im = makeMonitor(resourceName, myProp);
+
+		logger.debug(
+				"\n\ntestSanityJmx state after creating new im\n"
+						+ "AdminState = {}\nOpState() = {}\nAvailStatus = {}\nStandbyStatus = {}\n",
+				im.getStateManager().getAdminState(), im.getStateManager().getOpState(),
+				im.getStateManager().getAvailStatus(), im.getStateManager().getStandbyStatus());
+
+		// Verify the state
+		assertEquals(StateManagement.UNLOCKED, im.getStateManager().getAdminState());
+		assertEquals(StateManagement.ENABLED, im.getStateManager().getOpState());
+		assertEquals(StateManagement.NULL_VALUE, im.getStateManager().getAvailStatus());
+		assertEquals(StateManagement.NULL_VALUE, im.getStateManager().getStandbyStatus());
+
+		// Test state manager via the IntegrityMonitor
+		StateManagement sm = im.getStateManager();
+
+		// Verify lock state
+		sm.lock();
+		logger.debug("\n\nsm.lock()\nAdminState = {}\nOpState() = {}\nAvailStatus = {}\nStandbyStatus = {}\n",
+				sm.getAdminState(), sm.getOpState(), sm.getAvailStatus(), sm.getStandbyStatus());
+		assertEquals(StateManagement.LOCKED, sm.getAdminState());
+
+		// Verify lock persists across a restart
+		logger.debug("\ntestSanityJmx restarting the IntegrityMonitor");
+		// Create a new instance. It should come up with the admin state locked
+		im = makeMonitor(resourceName, myProp);
+		sm = im.getStateManager();
+		logger.debug(
+				"\n\ntestSanityJmx restart with AdminState=locked"
+						+ "\nAdminState = {}\nOpState() = {}\nAvailStatus = {}\nStandbyStatus = {}\n",
+				sm.getAdminState(), sm.getOpState(), sm.getAvailStatus(), sm.getStandbyStatus());
+		assertEquals(StateManagement.LOCKED, sm.getAdminState());
+
+		// Verify unlock
+		sm.unlock();
+		logger.debug(
+				"\n\ntestSanityJmx sm.unlock\nAdminState = {}\nOpState() = {}\nAvailStatus = {}\nStandbyStatus = {}\n",
+				sm.getAdminState(), sm.getOpState(), sm.getAvailStatus(), sm.getStandbyStatus());
+		assertEquals(StateManagement.UNLOCKED, sm.getAdminState());
+
+		// Verify unlock restart
+		logger.debug("\ntestSanityJmx restarting the IntegrityMonitor");
+		// Create a new instance. It should come up with the admin state locked
+		im = makeMonitor(resourceName, myProp);
+		sm = im.getStateManager();
+		logger.debug(
+				"\n\ntestSanityJmx restart with AdminState=unlocked\n"
+						+ "AdminState = {}\nOpState() = {}\nAvailStatus = {}\nStandbyStatus = {}\n",
+				sm.getAdminState(), sm.getOpState(), sm.getAvailStatus(), sm.getStandbyStatus());
+
+		assertEquals(StateManagement.UNLOCKED, sm.getAdminState());
+
+		logger.debug("\n\ntestSanityJmx: Exit\n\n");
+	}
+
+	@Test
+	public void testIM() throws Exception {
+		logger.debug("\nIntegrityMonitorTest: Entering testIM\n\n");
+
+		// Disable the integrity monitor so it will not interfere
+		myProp.put(IntegrityMonitorProperties.FP_MONITOR_INTERVAL, "-1");
+		// Disable dependency checking
+		myProp.put(IntegrityMonitorProperties.CHECK_DEPENDENCY_INTERVAL, "-1");
+		// Disable the refresh state audit
+		myProp.put(IntegrityMonitorProperties.REFRESH_STATE_AUDIT_INTERVAL_MS, "-1");
+		// Disable the state audit
+		myProp.put(IntegrityMonitorProperties.STATE_AUDIT_INTERVAL_MS, "-1");
+		// Disable the test transaction
+		myProp.put(IntegrityMonitorProperties.TEST_TRANS_INTERVAL, "-1");
+		// Disable writing the FPC
+		myProp.put(IntegrityMonitorProperties.WRITE_FPC_INTERVAL, "-1");
+
+		IntegrityMonitor im = makeMonitor(resourceName, myProp);
+
+		logger.debug("\n\nim initial state: \nAdminState = {}\nOpState() = {}\nAvailStatus = {}\nStandbyStatus = {}\n",
+				im.getStateManager().getAdminState(), im.getStateManager().getOpState(),
+				im.getStateManager().getAvailStatus(), im.getStateManager().getStandbyStatus());
+
+		waitStep();
+
+		// test evaluate sanity
+		assertNoException(im, imx -> {
+			imx.evaluateSanity();
+		});
+
+		// Test startTransaction - should work since it is unlocked
+		assertNoException(im, imx -> {
+			imx.startTransaction();
+		});
+
+		// Test state manager via the IntegrityMonitor
+		StateManagement sm = im.getStateManager();
+
+		sm.lock();
+
+		logger.debug("\n\nsm.lock()\nAdminState = {}\nOpState() = {}\nAvailStatus = {}\nStandbyStatus = {}\n",
+				sm.getAdminState(), sm.getOpState(), sm.getAvailStatus(), sm.getStandbyStatus());
+
+		assertEquals(StateManagement.LOCKED, sm.getAdminState());
+
+		// test startTransaction. It should fail since it is locked
+		assertException(im, imx -> {
+			imx.startTransaction();
+		});
+
+		sm.unlock();
+		logger.debug("\n\nsm.unlock()\nAdminState = {}\nOpState() = {}\nAvailStatus = {}\nStandbyStatus = {}\n",
+				sm.getAdminState(), sm.getOpState(), sm.getAvailStatus(), sm.getStandbyStatus());
+		assertEquals(StateManagement.UNLOCKED, sm.getAdminState());
+
+		// test startTransaction. It should succeed
+		assertNoException(im, imx -> {
+			imx.startTransaction();
+		});
+
+		sm.disableDependency();
+		logger.debug(
+				"\n\nsm.disableDependency()\nAdminState = {}\nOpState() = {}\nAvailStatus = {}\nStandbyStatus = {}\n",
+				sm.getAdminState(), sm.getOpState(), sm.getAvailStatus(), sm.getStandbyStatus());
+
+		assertEquals(StateManagement.DISABLED, sm.getOpState());
+		assertEquals(StateManagement.DEPENDENCY, sm.getAvailStatus());
+
+		// test startTransaction. It should succeed since standby status is null
+		// and unlocked
+		assertNoException(im, imx -> {
+			imx.startTransaction();
+		});
+
+		sm.enableNoDependency();
+
+		logger.debug(
+				"\n\nsm.enableNoDependency()\nAdminState = {}\nOpState() = {}\nAvailStatus = {}\nStandbyStatus = {}\n",
+				sm.getAdminState(), sm.getOpState(), sm.getAvailStatus(), sm.getStandbyStatus());
+		assertEquals(StateManagement.ENABLED, sm.getOpState());
+		// test startTransaction. It should succeed since standby status is null
+		// and unlocked
+		assertNoException(im, imx -> {
+			imx.startTransaction();
+		});
+
+		sm.disableFailed();
+		logger.debug("\n\nsm.disableFailed()\nAdminState = {}\nOpState() = {}\nAvailStatus = {}\nStandbyStatus = {}\n",
+				sm.getAdminState(), sm.getOpState(), sm.getAvailStatus(), sm.getStandbyStatus());
+
+		assertEquals(StateManagement.DISABLED, sm.getOpState());
+		assertEquals(StateManagement.FAILED, sm.getAvailStatus());
+		// test startTransaction. It should succeed since standby status is null
+		// and unlocked
+		assertNoException(im, imx -> {
+			imx.startTransaction();
+		});
+
+		sm.enableNotFailed();
+
+		logger.debug(
+				"\n\nsm.enabledNotFailed()\nAdminState = {}\nOpState() = {}\nAvailStatus = {}\nStandbyStatus = {}\n",
+				sm.getAdminState(), sm.getOpState(), sm.getAvailStatus(), sm.getStandbyStatus());
+
+		assertEquals(StateManagement.ENABLED, sm.getOpState());
+		// test startTransaction. It should succeed since standby status is null
+		// and unlocked
+		assertNoException(im, imx -> {
+			imx.startTransaction();
+		});
+
+		sm.demote();
+
+		logger.debug("\n\nsm.demote()\nAdminState = {}\nOpState() = {}\nAvailStatus = {}\nStandbyStatus = {}\n",
+				sm.getAdminState(), sm.getOpState(), sm.getAvailStatus(), sm.getStandbyStatus());
+
+		assertEquals(StateManagement.HOT_STANDBY, sm.getStandbyStatus());
+
+		// test startTransaction. It should fail since it is standby
+		assertException(im, imx -> {
+			imx.startTransaction();
+		});
+
+		sm.promote();
+
+		logger.debug("\n\nsm.promote()\nAdminState = {}\nOpState() = {}\nAvailStatus = {}\nStandbyStatus = {}\n",
+				sm.getAdminState(), sm.getOpState(), sm.getAvailStatus(), sm.getStandbyStatus());
+
+		assertEquals(StateManagement.PROVIDING_SERVICE, sm.getStandbyStatus());
+
+		// test startTransaction. It should succeed since it is providing
+		// service
+		assertNoException(im, imx -> {
+			imx.startTransaction();
+		});
+
+		// Test the multi-valued availability status
+		sm.disableDependency();
+		sm.disableFailed();
+
+		logger.debug(
+				"\n\nsm.disableDependency(), sm.disableFailed\nAdminState = {}\nOpState() = {}\nAvailStatus = {}\nStandbyStatus = {}\n",
+				sm.getAdminState(), sm.getOpState(), sm.getAvailStatus(), sm.getStandbyStatus());
+
+		assertEquals(StateManagement.DEPENDENCY_FAILED, sm.getAvailStatus());
+
+		// Test startTransaction. Should fail since standby status is cold
+		// standby
+		assertException(im, imx -> {
+			imx.startTransaction();
+		});
+
+		sm.enableNoDependency();
+
+		logger.debug(
+				"\n\nsm.enableNoDependency()\nAdminState = {}\nOpState() = {}\nAvailStatus = {}\nStandbyStatus = {}\n",
+				sm.getAdminState(), sm.getOpState(), sm.getAvailStatus(), sm.getStandbyStatus());
+		assertEquals(StateManagement.FAILED, sm.getAvailStatus());
+		// Test startTransaction. Should fail since standby status is cold
+		// standby
+		assertException(im, imx -> {
+			imx.startTransaction();
+		});
+
+		sm.disableDependency();
+		sm.enableNotFailed();
+
+		logger.debug(
+				"\n\nsm.disableDependency(),sm.enableNotFailed()\nAdminState = {}\nOpState() = {}\nAvailStatus = {}\nStandbyStatus = {}\n",
+				sm.getAdminState(), sm.getOpState(), sm.getAvailStatus(), sm.getStandbyStatus());
+
+		assertEquals(StateManagement.DEPENDENCY, sm.getAvailStatus());
+		// Test startTransaction. Should fail since standby status is cold
+		// standby
+		assertException(im, imx -> {
+			imx.startTransaction();
+		});
+
+		sm.enableNoDependency();
+		logger.debug(
+				"\n\nsm.enableNoDependency()\nAdminState = {}\nOpState() = {}\nAvailStatus = {}\nStandbyStatus = {}\n",
+				sm.getAdminState(), sm.getOpState(), sm.getAvailStatus(), sm.getStandbyStatus());
+		assertEquals(StateManagement.ENABLED, sm.getOpState());
+		// test startTransaction. It should fail since standby status is hot
+		// standby
+		assertException(im, imx -> {
+			imx.startTransaction();
+		});
+
+		logger.debug("\n\ntestIM: Exit\n\n");
+	}
+
+	@Test
+	public void testSanityState() throws Exception {
+		logger.debug("\nIntegrityMonitorTest: Entering testSanityState\n\n");
+
+		// parameters are passed via a properties file
+		myProp.put(IntegrityMonitorProperties.DEPENDENCY_GROUPS, "group1_dep1,group1_dep2; group2_dep1");
+		// Disable the integrity monitor so it will not interfere
+		myProp.put(IntegrityMonitorProperties.FP_MONITOR_INTERVAL, "-1");
+		// Disable the refresh state audit
+		myProp.put(IntegrityMonitorProperties.REFRESH_STATE_AUDIT_INTERVAL_MS, "-1");
+		// Disable dependency checking so it does not interfere
+		myProp.put(IntegrityMonitorProperties.CHECK_DEPENDENCY_INTERVAL, "-1");
+		// Disable the state audit
+		myProp.put(IntegrityMonitorProperties.STATE_AUDIT_INTERVAL_MS, "-1");
+		// Disable the test transaction
+		myProp.put(IntegrityMonitorProperties.TEST_TRANS_INTERVAL, "-1");
+		// Disable writing the FPC
+		myProp.put(IntegrityMonitorProperties.WRITE_FPC_INTERVAL, "-1");
+		// Max interval for use in deciding if a FPC entry is stale in seconds
+		myProp.put(IntegrityMonitorProperties.MAX_FPC_UPDATE_INTERVAL, "120");
+
+		IntegrityMonitor im = makeMonitor(resourceName, myProp);
+
+		waitStep();
+
+		// Add a group1 dependent resources to put an entry in the forward
+		// progress table
+		ForwardProgressEntity fpe = new ForwardProgressEntity();
+		ForwardProgressEntity fpe2 = new ForwardProgressEntity();
+		fpe.setFpcCount(0);
+		fpe.setResourceName("group1_dep1");
+		fpe2.setFpcCount(0);
+		fpe2.setResourceName("group1_dep2");
+		et = em.getTransaction();
+		et.begin();
+		em.persist(fpe);
+		em.persist(fpe2);
+		em.flush();
+		et.commit();
+
+		// Add a group2 dependent resource to the StateManagementEntity DB table
+		// and set its admin state to locked
+		// Expect sanity test to fail.
+		StateManagement stateManager = new StateManagement(emf, "group2_dep1");
+		stateManager.lock();
+
+		new StateManagement(emf, "group1_dep1");
+		new StateManagement(emf, "group1_dep2");
+
+		// Call the dependency check directly instead of waiting for FPManager
+		// to do it.
+		logger.debug("\n\nIntegrityMonitor.testSanityState: calling im.dependencyCheck()\n\n");
+		im.dependencyCheck();
+		assertException(im, imx -> {
+			imx.evaluateSanity();
+		});
+
+		logger.debug("\n\ntestSanityState: Exit\n\n");
+	}
+
+	@Test
+	public void testRefreshStateAudit() throws Exception {
+		logger.debug("\nIntegrityMonitorTest: testRefreshStateAudit Enter\n\n");
+
+		// parameters are passed via a properties file
+		myProp.put(IntegrityMonitorProperties.DEPENDENCY_GROUPS, "");
+		myProp.put(IntegrityMonitorProperties.TEST_VIA_JMX, "false");
+		// Disable the integrity monitor so it will not interfere
+		myProp.put(IntegrityMonitorProperties.FP_MONITOR_INTERVAL, "-1");
+		// Disable the refresh state audit
+		myProp.put(IntegrityMonitorProperties.REFRESH_STATE_AUDIT_INTERVAL_MS, "-1");
+		// Disable dependency checking so it does not interfere
+		myProp.put(IntegrityMonitorProperties.CHECK_DEPENDENCY_INTERVAL, "-1");
+		// Disable the state audit
+		myProp.put(IntegrityMonitorProperties.STATE_AUDIT_INTERVAL_MS, "-1");
+		// Disable the test transaction
+		myProp.put(IntegrityMonitorProperties.TEST_TRANS_INTERVAL, "-1");
+		// Disable writing the FPC
+		myProp.put(IntegrityMonitorProperties.WRITE_FPC_INTERVAL, "-1");
+
+		IntegrityMonitor im = makeMonitor(resourceName, myProp);
+
+		waitStep();
+
+		// the state here is unlocked, enabled, null, null
+		StateManagementEntity sme = null;
+
+		Query query = em.createQuery("Select p from StateManagementEntity p where p.resourceName=:resource");
+
+		query.setParameter("resource", resourceName);
+
+		// Just test that we are retrieving the right object
+		@SuppressWarnings("rawtypes")
+		List resourceList = query.getResultList();
+		if (!resourceList.isEmpty()) {
+			// exist
+			sme = (StateManagementEntity) resourceList.get(0);
+			em.refresh(sme);
+
+			logger.debug(
+					"??? -- Retrieve StateManagementEntity from database --\nsme.getResourceName() = {}\n"
+							+ "sme.getAdminState() = {}\nsme.getOpState() = {}\nsme.getAvailStatus() = {}\nsme.getStandbyStatus() = {}",
+					sme.getResourceName(), sme.getAdminState(), sme.getOpState(), sme.getAvailStatus(),
+					sme.getStandbyStatus());
+
+			assertEquals(StateManagement.UNLOCKED, sme.getAdminState());
+			assertEquals(StateManagement.ENABLED, sme.getOpState());
+			assertEquals(StateManagement.NULL_VALUE, sme.getAvailStatus());
+			assertEquals(StateManagement.NULL_VALUE, sme.getStandbyStatus());
+			logger.debug("--");
+		} else {
+			logger.debug("Record not found, resourceName: " + resourceName);
+			fail("missing record");
+		}
+
+		et = em.getTransaction();
+		et.begin();
+
+		sme.setStandbyStatus(StateManagement.COLD_STANDBY);
+		em.persist(sme);
+		em.flush();
+		et.commit();
+
+		// Run the refreshStateAudit
+		im.executeRefreshStateAudit();
+
+		// The refreshStateAudit should run and change the state to
+		// unlocked,enabled,null,hotstandby
+		StateManagementEntity sme1 = null;
+
+		Query query1 = em.createQuery("Select p from StateManagementEntity p where p.resourceName=:resource");
+
+		query1.setParameter("resource", resourceName);
+
+		@SuppressWarnings("rawtypes")
+		List resourceList1 = query1.getResultList();
+		if (!resourceList1.isEmpty()) {
+			// exist
+			sme1 = (StateManagementEntity) resourceList1.get(0);
+			em.refresh(sme1);
+			logger.debug(
+					"??? -- Retrieve StateManagementEntity from database --\nsme1.getResourceName() = {}\n"
+							+ "sme1.getAdminState() = {}\nsme1.getOpState() = {}\nsme1.getAvailStatus() = {}\nsme1.getStandbyStatus() = {}",
+					sme1.getResourceName(), sme1.getAdminState(), sme1.getOpState(), sme1.getAvailStatus(),
+					sme1.getStandbyStatus());
+
+			assertEquals(StateManagement.UNLOCKED, sme1.getAdminState());
+			assertEquals(StateManagement.ENABLED, sme1.getOpState());
+			assertEquals(StateManagement.NULL_VALUE, sme1.getAvailStatus());
+			assertEquals(StateManagement.HOT_STANDBY, sme1.getStandbyStatus());
+			logger.debug("--");
+		} else {
+			logger.debug("Record not found, resourceName: " + resourceName);
+			fail("record not found");
+		}
+
+		logger.debug("\nIntegrityMonitorTest: testRefreshStateAudit Exit\n\n");
+	}
+
+	@Test
+	public void testStateCheck() throws Exception {
+		logger.debug("\nIntegrityMonitorTest: Entering testStateCheck\n\n");
+
+		// parameters are passed via a properties file
+		myProp.put(IntegrityMonitorProperties.DEPENDENCY_GROUPS, "group1_dep1");
+		myProp.put(IntegrityMonitorProperties.TEST_VIA_JMX, "false");
+		myProp.put(IntegrityMonitorProperties.FAILED_COUNTER_THRESHOLD, "1");
+		/*
+		 * The monitorInterval is set to 10 and the failedCounterThreshold is 1
+		 * because stateCheck() uses the faileCounterThreshold * monitorInterval
+		 * to determine if an entry is stale, it will be stale after 10 seconds.
+		 */
+		myProp.put(IntegrityMonitorProperties.FP_MONITOR_INTERVAL, "5");
+		/*
+		 * We accelerate the test transaction and write FPC intervals because we
+		 * don't want there to be any chance of a FPC failure because of the
+		 * short monitor interval
+		 */
+		myProp.put(IntegrityMonitorProperties.TEST_TRANS_INTERVAL, "1");
+		myProp.put(IntegrityMonitorProperties.WRITE_FPC_INTERVAL, "2");
+		// Disable the refresh state audit
+		myProp.put(IntegrityMonitorProperties.REFRESH_STATE_AUDIT_INTERVAL_MS, "-1");
+		// The maximum time in seconds to determine that a FPC entry is stale
+		myProp.put(IntegrityMonitorProperties.MAX_FPC_UPDATE_INTERVAL, "5");
+		myProp.put(IntegrityMonitorProperties.CHECK_DEPENDENCY_INTERVAL, "5");
+
+		IntegrityMonitor im = makeMonitor(resourceName, myProp);
+
+		// Note: do ***NOT*** do waitStep() here
+
+		// Add a group1 dependent resources to put an entry in the forward
+		// progress table
+		// This sets lastUpdated to the current time
+		ForwardProgressEntity fpe = new ForwardProgressEntity();
+		fpe.setFpcCount(0);
+		fpe.setResourceName("group1_dep1");
+		et = em.getTransaction();
+		et.begin();
+		em.persist(fpe);
+		em.flush();
+		et.commit();
+
+		new StateManagement(emf, "group1_dep1");
+
+		assertNoException(im, imx -> {
+			imx.evaluateSanity();
+		});
+
+		// wait for FPManager to perform dependency health check. Once that's
+		// done,
+		// it should now be stale and the sanity check should fail
+		waitStep();
+
+		assertException(im, imx -> {
+			imx.evaluateSanity();
+		});
+
+		logger.debug("\n\ntestStateCheck: Exit\n\n");
+	}
+
+	@Test
+	public void testGetAllForwardProgressEntity() throws Exception {
+		logger.debug("\nIntegrityMonitorTest: Entering testGetAllForwardProgressEntity\n\n");
+		// parameters are passed via a properties file
+		myProp.put(IntegrityMonitorProperties.DEPENDENCY_GROUPS, "");
+		myProp.put(IntegrityMonitorProperties.TEST_VIA_JMX, "false");
+		// Disable the integrity monitor so it will not interfere
+		myProp.put(IntegrityMonitorProperties.FP_MONITOR_INTERVAL, "-1");
+		// Disable the refresh state audit
+		myProp.put(IntegrityMonitorProperties.REFRESH_STATE_AUDIT_INTERVAL_MS, "-1");
+		// Disable dependency checking so it does not interfere
+		myProp.put(IntegrityMonitorProperties.CHECK_DEPENDENCY_INTERVAL, "-1");
+		// Disable the state audit
+		myProp.put(IntegrityMonitorProperties.STATE_AUDIT_INTERVAL_MS, "-1");
+		// Disable the test transaction
+		myProp.put(IntegrityMonitorProperties.TEST_TRANS_INTERVAL, "-1");
+		// Disable writing the FPC
+		myProp.put(IntegrityMonitorProperties.WRITE_FPC_INTERVAL, "-1");
+
+		IntegrityMonitor im = makeMonitor(resourceName, myProp);
+		waitStep();
+
+		logger.debug("\nIntegrityMonitorTest: Creating ForwardProgressEntity entries\n\n");
+		// Add resource entries in the forward progress table
+		ForwardProgressEntity fpe = new ForwardProgressEntity();
+		ForwardProgressEntity fpe2 = new ForwardProgressEntity();
+		ForwardProgressEntity fpe3 = new ForwardProgressEntity();
+		fpe.setFpcCount(0);
+		fpe.setResourceName("siteA_pap2");
+		fpe2.setFpcCount(0);
+		fpe2.setResourceName("siteB_pap1");
+		fpe3.setFpcCount(0);
+		fpe3.setResourceName("siteB_pap2");
+		et = em.getTransaction();
+		et.begin();
+		em.persist(fpe);
+		em.persist(fpe2);
+		em.persist(fpe3);
+		em.flush();
+		et.commit();
+
+		logger.debug(
+				"\nIntegrityMonitorTest:testGetAllForwardProgressEntity Calling im.getAllForwardProgressEntity()\n\n");
+		List<ForwardProgressEntity> fpeList = im.getAllForwardProgressEntity();
+
+		assertEquals(4, fpeList.size());
+
+		logger.debug("\nIntegrityMonitorTest: Exit testGetAllForwardProgressEntity\n\n");
+	}
+
+	@Test
+	public void testStateAudit() throws Exception {
+		logger.debug("\nIntegrityMonitorTest: Entering testStateAudit\n\n");
+
+		// parameters are passed via a properties file
+
+		// No Dependency Groups
+		myProp.put(IntegrityMonitorProperties.DEPENDENCY_GROUPS, "");
+		// Don't use JMX
+		myProp.put(IntegrityMonitorProperties.TEST_VIA_JMX, "false");
+		// Disable the internal sanity monitoring.
+		myProp.put(IntegrityMonitorProperties.FP_MONITOR_INTERVAL, "-1");
+		// Disable the dependency monitoring.
+		myProp.put(IntegrityMonitorProperties.CHECK_DEPENDENCY_INTERVAL, "-1");
+		// Disable the refresh state audit
+		myProp.put(IntegrityMonitorProperties.REFRESH_STATE_AUDIT_INTERVAL_MS, "-1");
+		// Disable the test transaction
+		myProp.put(IntegrityMonitorProperties.TEST_TRANS_INTERVAL, "-1");
+		// Disable the write FPC
+		myProp.put(IntegrityMonitorProperties.WRITE_FPC_INTERVAL, "-1");
+		// Disable the State Audit we will call it directly
+		myProp.put(IntegrityMonitorProperties.STATE_AUDIT_INTERVAL_MS, "-1");
+		// Max interval for use in deciding if a FPC entry is stale in seconds
+		myProp.put(IntegrityMonitorProperties.MAX_FPC_UPDATE_INTERVAL, "120");
+
+		IntegrityMonitor im = makeMonitor(resourceName, myProp);
+		waitStep();
+
+		logger.debug("\nIntegrityMonitorTest: Creating ForwardProgressEntity entries\n\n");
+		// Add resources to put an entry in the forward progress table
+		Date staleDate = new Date(0);
+		ForwardProgressEntity fpe1 = new ForwardProgressEntity();
+		ForwardProgressEntity fpe2 = new ForwardProgressEntity();
+		ForwardProgressEntity fpe3 = new ForwardProgressEntity();
+		fpe1.setFpcCount(0);
+		fpe1.setResourceName("siteA_pap2");
+		fpe2.setFpcCount(0);
+		fpe2.setResourceName("siteB_pap1");
+		fpe3.setFpcCount(0);
+		fpe3.setResourceName("siteB_pap2");
+		logger.debug("\nIntegrityMonitorTest: Creating StateManagementEntity entries\n\n");
+		StateManagementEntity sme1 = new StateManagementEntity();
+		StateManagementEntity sme2 = new StateManagementEntity();
+		StateManagementEntity sme3 = new StateManagementEntity();
+		sme1.setResourceName("siteA_pap2");
+		sme1.setAdminState(StateManagement.UNLOCKED);
+		sme1.setOpState(StateManagement.ENABLED);
+		sme1.setAvailStatus(StateManagement.NULL_VALUE);
+		sme1.setStandbyStatus(StateManagement.NULL_VALUE);
+		sme2.setResourceName("siteB_pap1");
+		sme2.setAdminState(StateManagement.UNLOCKED);
+		sme2.setOpState(StateManagement.ENABLED);
+		sme2.setAvailStatus(StateManagement.NULL_VALUE);
+		sme2.setStandbyStatus(StateManagement.NULL_VALUE);
+		sme3.setResourceName("siteB_pap2");
+		sme3.setAdminState(StateManagement.UNLOCKED);
+		sme3.setOpState(StateManagement.ENABLED);
+		sme3.setAvailStatus(StateManagement.NULL_VALUE);
+		sme3.setStandbyStatus(StateManagement.NULL_VALUE);
+		et = em.getTransaction();
+		et.begin();
+		em.persist(fpe1);
+		em.persist(fpe2);
+		em.persist(fpe3);
+		em.persist(sme1);
+		em.persist(sme2);
+		em.persist(sme3);
+		em.flush();
+		et.commit();
+
+		Query updateQuery = em.createQuery(
+				"UPDATE ForwardProgressEntity f " + "SET f.lastUpdated = :newDate " + "WHERE f.resourceName=:resource");
+		updateQuery.setParameter("newDate", staleDate, TemporalType.TIMESTAMP);
+		updateQuery.setParameter("resource", fpe1.getResourceName());
+
+		et = em.getTransaction();
+		et.begin();
+		updateQuery.executeUpdate();
+		et.commit();
+
+		logger.debug("\nIntegrityMonitorTest:testStateAudit Calling im.getAllForwardProgressEntity()\n\n");
+		List<ForwardProgressEntity> fpeList = im.getAllForwardProgressEntity();
+
+		logger.debug("\n\n");
+		logger.debug("IntegrityMonitorTest:testStateAudit:ForwardProgressEntity entries");
+		for (ForwardProgressEntity myFpe : fpeList) {
+			logger.debug("\n    ResourceName: {}" + "\n        LastUpdated: {}", myFpe.getResourceName(),
+					myFpe.getLastUpdated());
+		}
+		logger.debug("\n\n");
+
+		logger.debug("\nIntegrityMonitorTest:testStateAudit getting list of StateManagementEntity entries\n\n");
+		Query query = em.createQuery("SELECT s FROM StateManagementEntity s");
+		List<?> smeList = query.getResultList();
+
+		logger.debug("\n\n");
+		logger.debug("IntegrityMonitorTest:testStateAudit:StateManagementEntity entries");
+		for (Object mySme : smeList) {
+			StateManagementEntity tmpSme = (StateManagementEntity) mySme;
+			em.refresh(tmpSme);
+			logger.debug(
+					"\n    ResourceName: {}" + "\n        AdminState: {}" + "\n        OpState: {}"
+							+ "\n        AvailStatus: {}" + "\n        StandbyStatus: {}",
+					tmpSme.getResourceName(), tmpSme.getAdminState(), tmpSme.getOpState(), tmpSme.getAvailStatus(),
+					tmpSme.getStandbyStatus());
+		}
+		logger.debug("\n\n");
+
+		em.refresh(sme1);
+		assertEquals(StateManagement.ENABLED, sme1.getOpState());
+
+		logger.debug("IntegrityMonitorTest:testStateAudit: calling stateAudit()");
+		im.executeStateAudit();
+		logger.debug("IntegrityMonitorTest:testStateAudit: call to stateAudit() complete");
+
+		logger.debug("\nIntegrityMonitorTest:testStateAudit getting list of StateManagementEntity entries\n\n");
+		smeList = query.getResultList();
+
+		logger.debug("\n\n");
+		logger.debug("IntegrityMonitorTest:testStateAudit:StateManagementEntity entries");
+		for (Object mySme : smeList) {
+			StateManagementEntity tmpSme = (StateManagementEntity) mySme;
+			em.refresh(tmpSme);
+			logger.debug(
+					"\n    ResourceName: {}" + "\n        AdminState: {}" + "\n        OpState: {}"
+							+ "\n        AvailStatus: {}" + "\n        StandbyStatus: {}",
+					tmpSme.getResourceName(), tmpSme.getAdminState(), tmpSme.getOpState(), tmpSme.getAvailStatus(),
+					tmpSme.getStandbyStatus());
+		}
+		logger.debug("\n\n");
+
+		em.refresh(sme1);
+		assertEquals(StateManagement.DISABLED, sme1.getOpState());
+
+		// Now let's add sme2 to the mix
+		updateQuery = em.createQuery(
+				"UPDATE ForwardProgressEntity f " + "SET f.lastUpdated = :newDate " + "WHERE f.resourceName=:resource");
+		updateQuery.setParameter("newDate", staleDate, TemporalType.TIMESTAMP);
+		updateQuery.setParameter("resource", fpe2.getResourceName());
+
+		et = em.getTransaction();
+		et.begin();
+		updateQuery.executeUpdate();
+		et.commit();
+
+		// Give it a chance to write the DB and run the audit
+		logger.debug("IntegrityMonitorTest:testStateAudit: (restart4) Running State Audit");
+		waitStep();
+		im.executeStateAudit();
+		waitStep();
+		logger.debug("IntegrityMonitorTest:testStateAudit: (restart4) State Audit complete");
+
+		// Now check its state
+		logger.debug(
+				"\nIntegrityMonitorTest:testStateAudit (restart4) getting list of StateManagementEntity entries\n\n");
+		smeList = query.getResultList();
+
+		logger.debug("\n\n");
+		logger.debug("IntegrityMonitorTest:testStateAudit:StateManagementEntity (restart4) entries");
+		for (Object mySme : smeList) {
+			StateManagementEntity tmpSme = (StateManagementEntity) mySme;
+			em.refresh(tmpSme);
+
+			logger.debug(
+					"\n    (restart4) ResourceName: {}" + "\n        AdminState: {}" + "\n        OpState: {}"
+							+ "\n        AvailStatus: {}" + "\n        StandbyStatus: {}",
+					tmpSme.getResourceName(), tmpSme.getAdminState(), tmpSme.getOpState(), tmpSme.getAvailStatus(),
+					tmpSme.getStandbyStatus());
+		}
+		logger.debug("\n\n");
+
+		em.refresh(sme1);
+		assertEquals(StateManagement.DISABLED, sme1.getOpState());
+
+		em.refresh(sme2);
+		assertEquals(StateManagement.DISABLED, sme2.getOpState());
+
+		logger.debug("\nIntegrityMonitorTest: Exit testStateAudit\n\n");
+		System.out.println("\n\ntestStateAudit: Exit\n\n");
+	}
+
+	private IntegrityMonitor makeMonitor(String resourceName, Properties myProp) throws Exception {
+		IntegrityMonitor.deleteInstance();
+
+		queue = new LinkedBlockingQueue<>();
+
+		IntegrityMonitor im = IntegrityMonitor.getInstance(resourceName, myProp, queue);
+
+		// wait for the monitor thread to start
+		waitStep();
+
+		return im;
+	}
+
+	/**
+	 * Waits for the FPManager to complete another cycle.
+	 * 
+	 * @throws InterruptedException
+	 */
+	private void waitStep() throws InterruptedException {
+		CountDownLatch latch = new CountDownLatch(1);
+		queue.offer(latch);
+		waitLatch(latch);
+	}
+}
diff --git a/integrity-monitor/src/test/java/org/onap/policy/common/im/IntegrityMonitorTestBase.java b/integrity-monitor/src/test/java/org/onap/policy/common/im/IntegrityMonitorTestBase.java
new file mode 100644
index 0000000..84d0b51
--- /dev/null
+++ b/integrity-monitor/src/test/java/org/onap/policy/common/im/IntegrityMonitorTestBase.java
@@ -0,0 +1,306 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Integrity Audit
+ * ================================================================================
+ * Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.policy.common.im;
+
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.util.Properties;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+
+import javax.persistence.EntityManager;
+import javax.persistence.EntityManagerFactory;
+import javax.persistence.Persistence;
+
+import org.onap.policy.common.utils.jpa.EntityTransCloser;
+import org.onap.policy.common.utils.test.log.logback.ExtractAppender;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * All JUnits are designed to run in the local development environment where
+ * they have write privileges and can execute time-sensitive tasks.
+ * <p/>
+ * Many of the test verification steps are performed by scanning for items
+ * written to the log file. Rather than actually scan the log file, an
+ * {@link ExtractAppender} is used to monitor events that are logged and extract
+ * relevant items. In order to attach the appender to the debug log, it assumes
+ * that the debug log is a <i>logback</i> Logger configured per EELF.
+ * <p/>
+ * These tests use a temporary, in-memory DB, which is dropped once the tests
+ * complete.
+ */
+public class IntegrityMonitorTestBase {
+	private static Logger logger = LoggerFactory.getLogger(IntegrityMonitorTestBase.class);
+
+	/**
+	 * Directory containing the slf4j log files.
+	 */
+	private static final String SLF4J_LOG_DIR = "logs";
+
+	private static final String JMX_PORT_PROP = "com.sun.management.jmxremote.port";
+
+	/**
+	 * Max time, in milliseconds, to wait for a latch to be triggered.
+	 */
+	protected static final long WAIT_MS = 5000l;
+
+	/**
+	 * Milliseconds that monitor should sleep between cycles.
+	 */
+	protected static final long CYCLE_INTERVAL_MS = 2l;
+
+	public static final String DEFAULT_DB_URL_PREFIX = "jdbc:h2:mem:";
+
+	protected static final String dbDriver = "org.h2.Driver";
+	protected static final String dbUser = "testu";
+	protected static final String dbPwd = "testp";
+	protected static final String siteName = "SiteA";
+	protected static final String nodeType = "pap";
+
+	// will be defined by the test *Classes*
+	protected static String dbUrl;
+
+	/**
+	 * Persistence unit.
+	 */
+	protected static final String PERSISTENCE_UNIT = "schemaPU";
+
+	/**
+	 * Properties to be used in all tests.
+	 */
+	protected static Properties properties;
+
+	/**
+	 * Entity manager factory pointing to the in-memory DB for A_SEQ_PU.
+	 */
+	protected static EntityManagerFactory emf;
+
+	/**
+	 * Entity manager factory pointing to the in-memory DB associated with emf.
+	 */
+	protected static EntityManager em;
+
+	/**
+	 * Saved JMX port from system properties, to be restored once all tests
+	 * complete.
+	 */
+	private static Object savedJmxPort;
+
+	/**
+	 * Saved IM persistence unit, to be restored once all tests complete.
+	 */
+	private static String savedPU;
+
+	/**
+	 * Saved monitor cycle interval, to be restored once all tests complete.
+	 */
+	private static long savedCycleIntervalMillis;
+
+	/**
+	 * Saved property time units, to be restored once all tests complete.
+	 */
+	private static TimeUnit savedPropertyUnits;
+
+	/**
+	 * Saves current configuration information and then sets new values.
+	 * 
+	 * @param dbDriver
+	 *            the name of the DB Driver class
+	 * @param dbUrl
+	 *            the URL to the DB
+	 * @throws IOException
+	 * @throws Exception
+	 */
+	protected static void setUpBeforeClass(String dbUrl) throws IOException {
+		logger.info("setup");
+
+		Properties systemProps = System.getProperties();
+
+		// truncate the logs
+		new FileOutputStream(SLF4J_LOG_DIR + "/audit.log").close();
+		new FileOutputStream(SLF4J_LOG_DIR + "/debug.log").close();
+		new FileOutputStream(SLF4J_LOG_DIR + "/error.log").close();
+		new FileOutputStream(SLF4J_LOG_DIR + "/metrics.log").close();
+
+		IntegrityMonitorTestBase.dbUrl = dbUrl;
+
+		// save data that we have to restore at the end of the test
+		savedJmxPort = systemProps.get(JMX_PORT_PROP);
+		savedPU = IntegrityMonitor.getPersistenceUnit();
+		savedCycleIntervalMillis = IntegrityMonitor.getCycleIntervalMillis();
+		savedPropertyUnits = IntegrityMonitor.getPropertyUnits();
+
+		systemProps.put(JMX_PORT_PROP, "9797");
+
+		IntegrityMonitor.setPersistenceUnit(PERSISTENCE_UNIT);
+		IntegrityMonitor.setCycleIntervalMillis(CYCLE_INTERVAL_MS);
+		IntegrityMonitor.setPropertyUnits(TimeUnit.MILLISECONDS);
+
+		IntegrityMonitor.setUnitTesting(true);
+
+		properties = new Properties();
+		properties.put(IntegrityMonitorProperties.DB_DRIVER, dbDriver);
+		properties.put(IntegrityMonitorProperties.DB_URL, dbUrl);
+		properties.put(IntegrityMonitorProperties.DB_USER, dbUser);
+		properties.put(IntegrityMonitorProperties.DB_PWD, dbPwd);
+		properties.put(IntegrityMonitorProperties.SITE_NAME, siteName);
+		properties.put(IntegrityMonitorProperties.NODE_TYPE, nodeType);
+		properties.put(IntegrityMonitorProperties.REFRESH_STATE_AUDIT_INTERVAL_MS,
+				String.valueOf(100L * CYCLE_INTERVAL_MS));
+
+		emf = Persistence.createEntityManagerFactory(PERSISTENCE_UNIT, makeProperties());
+
+		// keep this open so the in-memory DB stays around until all tests are
+		// done
+		em = emf.createEntityManager();
+
+		stopMonitor();
+	}
+
+	/**
+	 * Restores the configuration to what it was before the test.
+	 */
+	protected static void tearDownAfterClass() {
+		Properties systemProps = System.getProperties();
+		if (savedJmxPort == null) {
+			systemProps.remove(JMX_PORT_PROP);
+
+		} else {
+			systemProps.put(JMX_PORT_PROP, savedJmxPort);
+		}
+
+		IntegrityMonitor.setPersistenceUnit(savedPU);
+		IntegrityMonitor.setCycleIntervalMillis(savedCycleIntervalMillis);
+		IntegrityMonitor.setPropertyUnits(savedPropertyUnits);
+
+		IntegrityMonitor.setUnitTesting(false);
+
+		// this should result in the in-memory DB being deleted
+		em.close();
+		emf.close();
+	}
+
+	/**
+	 * Sets up for a test, which includes deleting all records from the
+	 * IntegrityAuditEntity table.
+	 */
+	protected void setUpTest() {
+
+		// Clean up the DB
+		try (EntityTransCloser et = new EntityTransCloser(em.getTransaction())) {
+
+			em.createQuery("Delete from StateManagementEntity").executeUpdate();
+			em.createQuery("Delete from ForwardProgressEntity").executeUpdate();
+			em.createQuery("Delete from ResourceRegistrationEntity").executeUpdate();
+
+			// commit transaction
+			et.commit();
+		}
+	}
+
+	/**
+	 * Cleans up after a test, removing any ExtractAppenders from the logger and
+	 * stopping any AuditThreads.
+	 */
+	protected void tearDownTest() {
+		stopMonitor();
+	}
+
+	/**
+	 * Stops the IntegrityMonitor instance.
+	 */
+	private static void stopMonitor() {
+		try {
+			IntegrityMonitor.deleteInstance();
+
+		} catch (IntegrityMonitorException e) {
+			// no need to log, as exception was already logged
+		}
+	}
+
+	/**
+	 * Makes a new Property set that's a clone of {@link #properties}.
+	 * 
+	 * @return a new Property set containing all of a copy of all of the
+	 *         {@link #properties}
+	 */
+	protected static Properties makeProperties() {
+		Properties props = new Properties();
+		props.putAll(properties);
+		return props;
+	}
+
+	/**
+	 * Waits for a latch to reach zero.
+	 * 
+	 * @param latch
+	 * @throws InterruptedException
+	 * @throws AssertionError
+	 *             if the latch did not reach zero in the allotted time
+	 */
+	protected void waitLatch(CountDownLatch latch) throws InterruptedException {
+		assertTrue(latch.await(WAIT_MS, TimeUnit.SECONDS));
+	}
+
+	/**
+	 * Applies a function on an object, expecting it to succeed. Catches any
+	 * exceptions thrown by the function.
+	 * 
+	 * @param arg
+	 * @param func
+	 * @throws AssertionError
+	 */
+	protected <T> void assertNoException(T arg, VoidFunction<T> func) {
+		try {
+			func.apply(arg);
+
+		} catch (Exception e) {
+			System.out.println("startTransaction exception: " + e);
+			fail("action failed");
+		}
+	}
+
+	/**
+	 * Applies a function on an object, expecting it to fail. Catches any
+	 * exceptions thrown by the function.
+	 * 
+	 * @param arg
+	 * @param func
+	 * @throws AssertionError
+	 */
+	protected <T> void assertException(T arg, VoidFunction<T> func) {
+		try {
+			func.apply(arg);
+			fail("missing exception");
+		} catch (Exception e) {
+			System.out.println("action found expected exception: " + e);
+		}
+	}
+
+	@FunctionalInterface
+	protected static interface VoidFunction<T> {
+		public void apply(T arg) throws Exception;
+	}
+}
diff --git a/integrity-monitor/src/test/java/org/onap/policy/common/im/StateManagementEntityTest.java b/integrity-monitor/src/test/java/org/onap/policy/common/im/StateManagementEntityTest.java
new file mode 100644
index 0000000..44faa58
--- /dev/null
+++ b/integrity-monitor/src/test/java/org/onap/policy/common/im/StateManagementEntityTest.java
@@ -0,0 +1,130 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * Integrity Monitor
+ * ================================================================================
+ * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.policy.common.im;
+
+import static org.junit.Assert.assertEquals;
+
+import java.util.List;
+
+import javax.persistence.Query;
+
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.onap.policy.common.im.jpa.StateManagementEntity;
+import org.onap.policy.common.utils.jpa.EntityTransCloser;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class StateManagementEntityTest extends IntegrityMonitorTestBase {
+	private static Logger logger = LoggerFactory.getLogger(StateManagementEntityTest.class);
+	  
+	@BeforeClass
+	public static void setUpClass() throws Exception {
+		IntegrityMonitorTestBase.setUpBeforeClass(DEFAULT_DB_URL_PREFIX + StateManagementEntityTest.class.getSimpleName());
+
+	}
+
+	@AfterClass
+	public static void tearDownClass() throws Exception {
+		IntegrityMonitorTestBase.tearDownAfterClass();
+	}
+
+	@Before
+	public void setUp() {
+		super.setUpTest();
+	}
+
+	@After
+	public void tearDown() {
+		super.tearDownTest();
+	}
+
+	@Test
+	public void testJPA() throws Exception {
+		logger.debug("\n??? logger.infor StateManagementEntityTest: Entering\n\n");
+		
+		//Define the resourceName for the StateManagement constructor
+		String resourceName = "test_resource1";
+		
+		//
+		logger.debug("Create StateManagementEntity, resourceName: {}", resourceName);
+		logger.debug("??? instantiate StateManagementEntity object");
+		StateManagementEntity sme = new StateManagementEntity(); 
+		
+		logger.debug("??? setResourceName : {}", resourceName);
+		sme.setResourceName(resourceName);
+		logger.debug("??? getResourceName : {}", sme.getResourceName());
+
+		sme.setAdminState(StateManagement.UNLOCKED);
+		assertEquals(StateManagement.UNLOCKED, sme.getAdminState());
+		
+		sme.setOpState(StateManagement.ENABLED);
+		assertEquals(StateManagement.ENABLED, sme.getOpState());
+		
+		sme.setAvailStatus(StateManagement.NULL_VALUE);
+		assertEquals(StateManagement.NULL_VALUE, sme.getAvailStatus());
+		
+		sme.setStandbyStatus(StateManagement.COLD_STANDBY);
+		assertEquals(StateManagement.COLD_STANDBY, sme.getStandbyStatus());
+
+		try(EntityTransCloser et = new EntityTransCloser(em.getTransaction())) {
+			logger.debug("??? before persist");
+			em.persist(sme); 
+			logger.debug("??? after  persist");
+			
+			em.flush(); 
+			logger.debug("??? after flush");
+
+			et.commit(); 
+			logger.debug("??? after commit");
+		}
+		
+		try {
+	        Query query = em.createQuery("Select p from StateManagementEntity p where p.resourceName=:resource");
+	       
+	        query.setParameter("resource", resourceName);
+	       
+	        //Just test that we are retrieving the right object
+	        @SuppressWarnings("rawtypes")
+	        List resourceList = query.getResultList();
+	        if (!resourceList.isEmpty()) {
+	           // exist 
+	           StateManagementEntity sme2 = (StateManagementEntity) resourceList.get(0);	       	   		
+	       	   
+	       	   assertEquals(sme.getResourceName(), sme2.getResourceName()); 
+	       	   assertEquals(sme.getAdminState(), sme2.getAdminState()); 
+	       	   assertEquals(sme.getOpState(), sme2.getOpState()); 
+	       	   assertEquals(sme.getAvailStatus(), sme2.getAvailStatus()); 
+	       	   assertEquals(sme.getStandbyStatus(), sme2.getStandbyStatus()); 
+			   logger.debug("--");
+	        } else {
+	           logger.debug("Record not found, resourceName: {}", resourceName);
+	        }
+		  } catch(Exception ex) {
+			logger.error("Exception on select query: " + ex.toString());
+	    }
+		
+		logger.debug("\n\nJpaTest: Exit\n\n");
+	}
+}
diff --git a/integrity-monitor/src/test/java/org/onap/policy/common/im/StateManagementTest.java b/integrity-monitor/src/test/java/org/onap/policy/common/im/StateManagementTest.java
new file mode 100644
index 0000000..2971921
--- /dev/null
+++ b/integrity-monitor/src/test/java/org/onap/policy/common/im/StateManagementTest.java
@@ -0,0 +1,239 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * Integrity Monitor
+ * ================================================================================
+ * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.policy.common.im;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/*
+ * All JUnits are designed to run in the local development environment
+ * where they have write privileges and can execute time-sensitive
+ * tasks.
+ */
+public class StateManagementTest extends IntegrityMonitorTestBase {
+	private static Logger logger = LoggerFactory.getLogger(StateManagementTest.class);
+	//
+
+	@BeforeClass
+	public static void setUpClass() throws Exception {
+		IntegrityMonitorTestBase.setUpBeforeClass(DEFAULT_DB_URL_PREFIX + StateManagementTest.class.getSimpleName());
+
+	}
+
+	@AfterClass
+	public static void tearDownClass() throws Exception {
+		IntegrityMonitorTestBase.tearDownAfterClass();
+	}
+
+	@Before
+	public void setUp() {
+		super.setUpTest();
+	}
+
+	@After
+	public void tearDown() {
+		super.tearDownTest();
+	}
+
+	@Test
+	public void test() throws Exception {
+		logger.info("\n\nlogger.infor StateManagementTest: Entering\n\n");
+		String resourceName = "test_resource1";
+
+		// These parameters are in a properties file
+		try {
+			StateManagement sm = new StateManagement(emf, resourceName);
+
+			logger.info("\n??? initial state");
+			assertEquals("unlocked,enabled,null,null", makeString(sm));
+
+			logger.info("\n??? test lock()");
+			sm.lock();
+			assertEquals("locked,enabled,null,null", makeString(sm));
+
+			logger.info("\n??? test unlock()");
+			sm.unlock();
+			assertEquals("unlocked,enabled,null,null", makeString(sm));
+
+			logger.info("\n??? test enableNotFailed()");
+			sm.enableNotFailed();
+			assertEquals("unlocked,enabled,null,null", makeString(sm));
+
+			logger.info("\n??? test disableFailed()");
+			sm.disableFailed();
+			assertEquals("unlocked,disabled,failed,null", makeString(sm));
+
+			// P4 If promote() is called while either the opState is disabled or
+			// the adminState is locked,
+			// the standbystatus shall transition to coldstandby and a
+			// StandbyStatusException shall be thrown
+			logger.info("\n??? promote() test case P4");
+			assertException(sm, smx -> {
+				sm.disableFailed();
+				sm.lock();
+
+				sm.promote();
+			});
+			assertEquals("locked,disabled,failed,coldstandby", makeString(sm));
+
+			// P3 If promote() is called while standbyStatus is coldstandby, the
+			// state shall not transition
+			// and a StandbyStatusException shall be thrown
+			logger.info("\n??? promote() test case P3");
+			assertException(sm, smx -> {
+				sm.promote();
+			});
+			assertEquals("locked,disabled,failed,coldstandby", makeString(sm));
+
+			// P2 If promote() is called while the standbyStatus is null and the
+			// opState is enabled and adminState is unlocked,
+			// the state shall transition to providingservice
+			logger.info("\n??? promote() test case P2");
+			resourceName = "test_resource2";
+			StateManagement sm2 = new StateManagement(emf, resourceName);
+			sm2.enableNotFailed();
+			sm2.unlock();
+			assertEquals("unlocked,enabled,null,null", makeString(sm2));
+			sm2.promote();
+			assertEquals("unlocked,enabled,null,providingservice", makeString(sm2));
+
+			// P5 If promote() is called while standbyStatus is
+			// providingservice, no action is taken
+			logger.info("\n??? promote() test case P5");
+			sm2.promote();
+			assertEquals("unlocked,enabled,null,providingservice", makeString(sm2));
+
+			// D1 If demote() is called while standbyStatus is providingservice,
+			// the state shall transition to hotstandby
+			logger.info("\n??? demote() test case D1");
+			sm2.demote();
+			assertEquals("unlocked,enabled,null,hotstandby", makeString(sm2));
+
+			// D4 If demote() is called while standbyStatus is hotstandby, no
+			// action is taken
+			logger.info("\n??? demote() test case D4");
+			sm2.demote();
+			assertEquals("unlocked,enabled,null,hotstandby", makeString(sm2));
+
+			// D3 If demote() is called while standbyStatus is null and
+			// adminState is locked or opState is disabled,
+			// the state shall transition to coldstandby
+			logger.info("\n??? demote() test case D3");
+			resourceName = "test_resource3";
+			StateManagement sm3 = new StateManagement(emf, resourceName);
+			sm3.lock();
+			sm3.disableFailed();
+			sm3.demote();
+			assertEquals("locked,disabled,failed,coldstandby", makeString(sm3));
+
+			// D5 If demote() is called while standbyStatus is coldstandby, no
+			// action is taken
+			logger.info("\n??? demote() test case D5");
+			sm3.demote();
+			assertEquals("locked,disabled,failed,coldstandby", makeString(sm3));
+
+			// D2 If demote() is called while standbyStatus is null and
+			// adminState is unlocked and opState is enabled,
+			// the state shall transition to hotstandby
+			logger.info("\n??? demote() test case D2");
+			resourceName = "test_resource4";
+			StateManagement sm4 = new StateManagement(emf, resourceName);
+			sm4.unlock();
+			sm4.enableNotFailed();
+			assertEquals("unlocked,enabled,null,null", makeString(sm4));
+			sm4.demote();
+			assertEquals("unlocked,enabled,null,hotstandby", makeString(sm4));
+
+			// P1 If promote() is called while standbyStatus is hotstandby, the
+			// state shall transition to providingservice.
+			logger.info("\n??? promote() test case P1");
+			sm4.promote();
+			assertEquals("unlocked,enabled,null,providingservice", makeString(sm4));
+
+			// State change notification
+			logger.info("\n??? State change notification test case 1 - lock()");
+			StateChangeNotifier stateChangeNotifier = new StateChangeNotifier();
+			sm.addObserver(stateChangeNotifier);
+			sm.lock();
+			assertEquals("locked,disabled,failed,coldstandby", makeString(stateChangeNotifier.getStateManagement()));
+
+			logger.info("\n??? State change notification test case 2 - unlock()");
+			sm.unlock();
+			assertEquals("unlocked,disabled,failed,coldstandby", makeString(stateChangeNotifier.getStateManagement()));
+
+			logger.info("\n??? State change notification test case 3 - enabled()");
+			sm.enableNotFailed();
+			assertEquals("unlocked,enabled,null,hotstandby", makeString(stateChangeNotifier.getStateManagement()));
+
+			logger.info("\n??? State change notification test case 4 - disableFailed()");
+			sm.disableFailed();
+			assertEquals("unlocked,disabled,failed,coldstandby", makeString(stateChangeNotifier.getStateManagement()));
+
+			logger.info("\n??? State change notification test case 5 - demote()");
+			sm.demote();
+			assertEquals("unlocked,disabled,failed,coldstandby", makeString(stateChangeNotifier.getStateManagement()));
+
+			logger.info("\n??? State change notification test case 6 - promote()");
+			assertException(sm, smx -> {
+				sm.promote();
+			});
+			assertEquals("unlocked,disabled,failed,coldstandby", makeString(sm));
+
+		} catch (Exception ex) {
+			logger.error("Exception: {}", ex.toString());
+			throw ex;
+		}
+
+		logger.info("\n\nStateManagementTest: Exit\n\n");
+	}
+
+	/**
+	 * Converts a state element to a comma-separated string.
+	 * 
+	 * @param se
+	 *            element to be converted
+	 * @return a string representing the element
+	 */
+	private String makeString(StateManagement sm) {
+		if (sm == null) {
+			return null;
+		}
+
+		StringBuilder b = new StringBuilder();
+
+		b.append(sm.getAdminState());
+		b.append(',');
+		b.append(sm.getOpState());
+		b.append(',');
+		b.append(sm.getAvailStatus());
+		b.append(',');
+		b.append(sm.getStandbyStatus());
+
+		return b.toString();
+	}
+}
diff --git a/integrity-monitor/src/test/java/org/onap/policy/common/im/test/StateTransitionTest.java b/integrity-monitor/src/test/java/org/onap/policy/common/im/StateTransitionTest.java
similarity index 67%
rename from integrity-monitor/src/test/java/org/onap/policy/common/im/test/StateTransitionTest.java
rename to integrity-monitor/src/test/java/org/onap/policy/common/im/StateTransitionTest.java
index 6d4dc7c..177a448 100644
--- a/integrity-monitor/src/test/java/org/onap/policy/common/im/test/StateTransitionTest.java
+++ b/integrity-monitor/src/test/java/org/onap/policy/common/im/StateTransitionTest.java
@@ -1,8 +1,8 @@
-/*-
+/*
  * ============LICENSE_START=======================================================
  * Integrity Monitor
  * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -18,18 +18,15 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.im.test;
+package org.onap.policy.common.im;
 
-import java.util.Properties;
-import javax.persistence.EntityManagerFactory;
+import static org.junit.Assert.assertEquals;
+
 import org.junit.After;
 import org.junit.AfterClass;
 import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.Test;
-
-import org.onap.policy.common.im.StateTransition;
-import org.onap.policy.common.im.StateElement;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 /*
@@ -39,17 +36,6 @@
  */
 public class StateTransitionTest {
 	private static Logger logger = LoggerFactory.getLogger(StateTransitionTest.class);
-	
-	private static final String DEFAULT_DB_DRIVER = "org.h2.Driver";
-	private static final String DEFAULT_DB_URL    = "jdbc:h2:file:./sql/smTest";
-	private static final String DEFAULT_DB_USER   = "sa";
-	private static final String DEFAULT_DB_PWD    = "";
-
-	private static final String DB_DRIVER         = "javax.persistence.jdbc.driver";
-	private static final String DB_URL            = "javax.persistence.jdbc.url";
-	private static final String DB_USER           = "javax.persistence.jdbc.user";
-	private static final String DB_PWD            = "javax.persistence.jdbc.password";
-	// 
 	  
 	@BeforeClass
 	public static void setUpClass() throws Exception {
@@ -68,19 +54,10 @@
 	public void tearDown() throws Exception {
 	}
 
-	//@Ignore
 	@Test
-	public void testJPA() throws Exception {
+	public void test() throws Exception {
 		logger.info("\n\nlogger.infor StateTransitionTest: Entering\n\n");
-		//These parameters are in a properties file
-		EntityManagerFactory emf = null; 
 		try {
-		    Properties myProp = new Properties();
-		    myProp.put(DB_DRIVER, DEFAULT_DB_DRIVER);
-		    myProp.put(DB_URL,    DEFAULT_DB_URL);
-		    myProp.put(DB_USER,   DEFAULT_DB_USER);
-		    myProp.put(DB_PWD,    DEFAULT_DB_PWD);
-		
 		    logger.info("??? create a new StateTransition"); 
 		    StateTransition st = new StateTransition();
  
@@ -88,2085 +65,2096 @@
 		    try {
 		    	// bad test case 
 		    	se = st.getEndingState("unlocked", "enabled", "null",  "coldstandby", "lock");
-		    	//
+				assertEquals("coldstandby,locked,enabled,null,", makeString(se));
+		        
 		        logger.info("??? StateTransition testcase 1");
 		        se = st.getEndingState("unlocked", "enabled", "null",  "null", "lock");
-		        if (se != null) displayEndingState(se);
+				assertEquals("null,locked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 2");
 		        se = st.getEndingState("unlocked", "enabled", "null",  "null", "unlock");
-		        if (se != null) displayEndingState(se);
+				assertEquals("null,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 3");
 		        se = st.getEndingState("unlocked", "enabled", "null",  "null", "disableFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("null,unlocked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 4");
 		        se = st.getEndingState("unlocked", "enabled", "null",  "null", "enableNotFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("null,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 5");
 		        se = st.getEndingState("unlocked", "enabled", "null",  "null", "disableDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("null,unlocked,disabled,dependency,", makeString(se));
                 
 		        logger.info("??? StateTransition testcase 6");
 		        se = st.getEndingState("unlocked", "enabled", "null",  "null", "enableNoDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("null,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 7");
 		        se = st.getEndingState("unlocked", "enabled", "null",  "null", "promote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("providingservice,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 8");
 		        se = st.getEndingState("unlocked", "enabled", "null",  "null", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("hotstandby,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 9");
 		        se = st.getEndingState("unlocked", "enabled", "null",  "coldstandby", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("hotstandby,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 10");
 		        se = st.getEndingState("unlocked", "enabled", "null",  "coldstandby", "unlock");
-		        if (se != null) displayEndingState(se);
+				assertEquals("hotstandby,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 11");
 		        se = st.getEndingState("unlocked", "enabled", "null",  "coldstandby", "disableFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 12");
 		        se = st.getEndingState("unlocked", "enabled", "null",  "coldstandby", "enableNotFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("hotstandby,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 13");
 		        se = st.getEndingState("unlocked", "enabled", "null",  "coldstandby", "disableDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 14");
 		        se = st.getEndingState("unlocked", "enabled", "null",  "coldstandby", "enableNoDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("hotstandby,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 15");
 		        se = st.getEndingState("unlocked", "enabled", "null",  "coldstandby", "promote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("providingservice,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 16");
 		        se = st.getEndingState("unlocked", "enabled", "null",  "coldstandby", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("hotstandby,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 17");
 		        se = st.getEndingState("unlocked", "enabled", "null",  "hotstandby", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("hotstandby,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 18");
 		        se = st.getEndingState("unlocked", "enabled", "null",  "hotstandby", "unlock");
-		        if (se != null) displayEndingState(se);
+				assertEquals("hotstandby,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 19");
 		        se = st.getEndingState("unlocked", "enabled", "null",  "hotstandby", "disableFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 20");
 		        se = st.getEndingState("unlocked", "enabled", "null",  "hotstandby", "enableNotFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("hotstandby,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 21");
 		        se = st.getEndingState("unlocked", "enabled", "null",  "hotstandby", "disableDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 22");
 		        se = st.getEndingState("unlocked", "enabled", "null",  "hotstandby", "enableNoDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("hotstandby,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 23");
 		        se = st.getEndingState("unlocked", "enabled", "null",  "hotstandby", "promote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("providingservice,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 24");
 		        se = st.getEndingState("unlocked", "enabled", "null",  "hotstandby", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("hotstandby,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 25");
 		        se = st.getEndingState("unlocked", "enabled", "null",  "providingservice", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("hotstandby,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 26");
 		        se = st.getEndingState("unlocked", "enabled", "null",  "providingservice", "unlock");
-		        if (se != null) displayEndingState(se);
+				assertEquals("providingservice,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 27");
 		        se = st.getEndingState("unlocked", "enabled", "null",  "providingservice", "disableFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 28");
 		        se = st.getEndingState("unlocked", "enabled", "null",  "providingservice", "enableNotFailed");
-		        if (se != null) displayEndingState(se);
-
+				assertEquals("providingservice,unlocked,enabled,null,", makeString(se));
+		    	
 		        logger.info("??? StateTransition testcase 29");
 		        se = st.getEndingState("unlocked", "enabled", "null",  "providingservice", "disableDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 30");
 		        se = st.getEndingState("unlocked", "enabled", "null",  "providingservice", "enableNoDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("providingservice,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 31");
 		        se = st.getEndingState("unlocked", "enabled", "null",  "providingservice", "promote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("providingservice,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 32");
 		        se = st.getEndingState("unlocked", "enabled", "null",  "providingservice", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("hotstandby,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 33");
 		        se = st.getEndingState("unlocked", "enabled", "failed",  "null", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("hotstandby,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 34");
 		        se = st.getEndingState("unlocked", "enabled", "failed",  "null", "unlock");
-		        if (se != null) displayEndingState(se);
+				assertEquals("null,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 35");
 		        se = st.getEndingState("unlocked", "enabled", "failed",  "null", "disableFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("null,unlocked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 36");
 		        se = st.getEndingState("unlocked", "enabled", "failed",  "null", "enableNotFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("null,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 37");
 		        se = st.getEndingState("unlocked", "enabled", "failed",  "null", "disableDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("null,unlocked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 38");
 		        se = st.getEndingState("unlocked", "enabled", "failed",  "null", "enableNoDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("null,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 39");
 		        se = st.getEndingState("unlocked", "enabled", "failed",  "null", "promote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("providingservice,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 40");
 		        se = st.getEndingState("unlocked", "enabled", "failed",  "null", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("hotstandby,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 41");
 		        se = st.getEndingState("unlocked", "enabled", "failed",  "coldstandby", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("hotstandby,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 42");
 		        se = st.getEndingState("unlocked", "enabled", "failed",  "coldstandby", "unlock");
-		        if (se != null) displayEndingState(se);
+				assertEquals("hotstandby,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 43");
 		        se = st.getEndingState("unlocked", "enabled", "failed",  "coldstandby", "disableFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 44");
 		        se = st.getEndingState("unlocked", "enabled", "failed",  "coldstandby", "enableNotFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("hotstandby,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 45");
 		        se = st.getEndingState("unlocked", "enabled", "failed",  "coldstandby", "disableDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 46");
 		        se = st.getEndingState("unlocked", "enabled", "failed",  "coldstandby", "enableNoDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("hotstandby,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 47");
 		        se = st.getEndingState("unlocked", "enabled", "failed",  "coldstandby", "promote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("providingservice,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 48");
 		        se = st.getEndingState("unlocked", "enabled", "failed",  "coldstandby", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("hotstandby,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 49");
 		        se = st.getEndingState("unlocked", "enabled", "failed",  "hotstandby", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("hotstandby,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 50");
 		        se = st.getEndingState("unlocked", "enabled", "failed",  "hotstandby", "unlock");
-		        if (se != null) displayEndingState(se);
+				assertEquals("hotstandby,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 51");
 		        se = st.getEndingState("unlocked", "enabled", "failed",  "hotstandby", "disableFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 52");
 		        se = st.getEndingState("unlocked", "enabled", "failed",  "hotstandby", "enableNotFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("hotstandby,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 53");
 		        se = st.getEndingState("unlocked", "enabled", "failed",  "hotstandby", "disableDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 54");
 		        se = st.getEndingState("unlocked", "enabled", "failed",  "hotstandby", "enableNoDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("hotstandby,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 55");
 		        se = st.getEndingState("unlocked", "enabled", "failed",  "hotstandby", "promote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("providingservice,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 56");
 		        se = st.getEndingState("unlocked", "enabled", "failed",  "hotstandby", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("hotstandby,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 57");
 		        se = st.getEndingState("unlocked", "enabled", "failed",  "providingservice", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("hotstandby,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 58");
 		        se = st.getEndingState("unlocked", "enabled", "failed",  "providingservice", "unlock");
-		        if (se != null) displayEndingState(se);
+				assertEquals("providingservice,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 59");
 		        se = st.getEndingState("unlocked", "enabled", "failed",  "providingservice", "disableFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 60");
 		        se = st.getEndingState("unlocked", "enabled", "failed",  "providingservice", "enableNotFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("providingservice,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 61");
 		        se = st.getEndingState("unlocked", "enabled", "failed",  "providingservice", "disableDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 62");
 		        se = st.getEndingState("unlocked", "enabled", "failed",  "providingservice", "enableNoDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("providingservice,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 63");
 		        se = st.getEndingState("unlocked", "enabled", "failed",  "providingservice", "promote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("providingservice,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 64");
 		        se = st.getEndingState("unlocked", "enabled", "failed",  "providingservice", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("hotstandby,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 65");
 		        se = st.getEndingState("unlocked", "enabled", "dependency",  "null", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("hotstandby,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 66");
 		        se = st.getEndingState("unlocked", "enabled", "dependency",  "null", "unlock");
-		        if (se != null) displayEndingState(se);
+				assertEquals("null,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 67");
 		        se = st.getEndingState("unlocked", "enabled", "dependency",  "null", "disableFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("null,unlocked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 68");
 		        se = st.getEndingState("unlocked", "enabled", "dependency",  "null", "enableNotFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("null,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 69");
 		        se = st.getEndingState("unlocked", "enabled", "dependency",  "null", "disableDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("null,unlocked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 70");
 		        se = st.getEndingState("unlocked", "enabled", "dependency",  "null", "enableNoDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("null,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 71");
 		        se = st.getEndingState("unlocked", "enabled", "dependency",  "null", "promote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("providingservice,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 72");
 		        se = st.getEndingState("unlocked", "enabled", "dependency",  "null", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("hotstandby,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 73");
 		        se = st.getEndingState("unlocked", "enabled", "dependency",  "coldstandby", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("hotstandby,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 74");
 		        se = st.getEndingState("unlocked", "enabled", "dependency",  "coldstandby", "unlock");
-		        if (se != null) displayEndingState(se);
+				assertEquals("hotstandby,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 75");
 		        se = st.getEndingState("unlocked", "enabled", "dependency",  "coldstandby", "disableFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 76");
 		        se = st.getEndingState("unlocked", "enabled", "dependency",  "coldstandby", "enableNotFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("hotstandby,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 77");
 		        se = st.getEndingState("unlocked", "enabled", "dependency",  "coldstandby", "disableDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 78");
 		        se = st.getEndingState("unlocked", "enabled", "dependency",  "coldstandby", "enableNoDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("hotstandby,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 79");
 		        se = st.getEndingState("unlocked", "enabled", "dependency",  "coldstandby", "promote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("providingservice,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 80");
 		        se = st.getEndingState("unlocked", "enabled", "dependency",  "coldstandby", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("hotstandby,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 81");
 		        se = st.getEndingState("unlocked", "enabled", "dependency",  "hotstandby", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("hotstandby,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 82");
 		        se = st.getEndingState("unlocked", "enabled", "dependency",  "hotstandby", "unlock");
-		        if (se != null) displayEndingState(se);
+				assertEquals("hotstandby,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 83");
 		        se = st.getEndingState("unlocked", "enabled", "dependency",  "hotstandby", "disableFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 84");
 		        se = st.getEndingState("unlocked", "enabled", "dependency",  "hotstandby", "enableNotFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("hotstandby,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 85");
 		        se = st.getEndingState("unlocked", "enabled", "dependency",  "hotstandby", "disableDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("hotstandby,unlocked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 86");
 		        se = st.getEndingState("unlocked", "enabled", "dependency",  "hotstandby", "enableNoDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("hotstandby,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 87");
 		        se = st.getEndingState("unlocked", "enabled", "dependency",  "hotstandby", "promote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("providingservice,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 88");
 		        se = st.getEndingState("unlocked", "enabled", "dependency",  "hotstandby", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("hotstandby,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 89");
 		        se = st.getEndingState("unlocked", "enabled", "dependency",  "providingservice", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("hotstandby,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 90");
 		        se = st.getEndingState("unlocked", "enabled", "dependency",  "providingservice", "unlock");
-		        if (se != null) displayEndingState(se);
+				assertEquals("providingservice,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 91");
 		        se = st.getEndingState("unlocked", "enabled", "dependency",  "providingservice", "disableFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 92");
 		        se = st.getEndingState("unlocked", "enabled", "dependency",  "providingservice", "enableNotFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("providingservice,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 93");
 		        se = st.getEndingState("unlocked", "enabled", "dependency",  "providingservice", "disableDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 94");
 		        se = st.getEndingState("unlocked", "enabled", "dependency",  "providingservice", "enableNoDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("providingservice,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 95");
 		        se = st.getEndingState("unlocked", "enabled", "dependency",  "providingservice", "promote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("providingservice,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 96");
 		        se = st.getEndingState("unlocked", "enabled", "dependency",  "providingservice", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("hotstandby,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 97");
 		        se = st.getEndingState("unlocked", "enabled", "dependency,failed",  "null", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("hotstandby,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 98");
 		        se = st.getEndingState("unlocked", "enabled", "dependency,failed",  "null", "unlock");
-		        if (se != null) displayEndingState(se);
+				assertEquals("null,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 99");
 		        se = st.getEndingState("unlocked", "enabled", "dependency,failed",  "null", "disableFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("null,unlocked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 100");
 		        se = st.getEndingState("unlocked", "enabled", "dependency,failed",  "null", "enableNotFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("null,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 101");
 		        se = st.getEndingState("unlocked", "enabled", "dependency,failed",  "null", "disableDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("null,unlocked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 102");
 		        se = st.getEndingState("unlocked", "enabled", "dependency,failed",  "null", "enableNoDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("null,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 103");
 		        se = st.getEndingState("unlocked", "enabled", "dependency,failed",  "null", "promote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("providingservice,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 104");
 		        se = st.getEndingState("unlocked", "enabled", "dependency,failed",  "null", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("hotstandby,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 105");
 		        se = st.getEndingState("unlocked", "enabled", "dependency,failed",  "coldstandby", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("hotstandby,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 106");
 		        se = st.getEndingState("unlocked", "enabled", "dependency,failed",  "coldstandby", "unlock");
-		        if (se != null) displayEndingState(se);
+				assertEquals("hotstandby,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 107");
 		        se = st.getEndingState("unlocked", "enabled", "dependency,failed",  "coldstandby", "disableFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 108");
 		        se = st.getEndingState("unlocked", "enabled", "dependency,failed",  "coldstandby", "enableNotFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("hotstandby,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 109");
 		        se = st.getEndingState("unlocked", "enabled", "dependency,failed",  "coldstandby", "disableDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 110");
 		        se = st.getEndingState("unlocked", "enabled", "dependency,failed",  "coldstandby", "enableNoDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("hotstandby,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 111");
 		        se = st.getEndingState("unlocked", "enabled", "dependency,failed",  "coldstandby", "promote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("providingservice,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 112");
 		        se = st.getEndingState("unlocked", "enabled", "dependency,failed",  "coldstandby", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("hotstandby,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 113");
 		        se = st.getEndingState("unlocked", "enabled", "dependency,failed",  "hotstandby", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("hotstandby,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 114");
 		        se = st.getEndingState("unlocked", "enabled", "dependency,failed",  "hotstandby", "unlock");
-		        if (se != null) displayEndingState(se);
+				assertEquals("hotstandby,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 115");
 		        se = st.getEndingState("unlocked", "enabled", "dependency,failed",  "hotstandby", "disableFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 116");
 		        se = st.getEndingState("unlocked", "enabled", "dependency,failed",  "hotstandby", "enableNotFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("hotstandby,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 117");
 		        se = st.getEndingState("unlocked", "enabled", "dependency,failed",  "hotstandby", "disableDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 118");
 		        se = st.getEndingState("unlocked", "enabled", "dependency,failed",  "hotstandby", "enableNoDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("hotstandby,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 119");
 		        se = st.getEndingState("unlocked", "enabled", "dependency,failed",  "hotstandby", "promote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("providingservice,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 120");
 		        se = st.getEndingState("unlocked", "enabled", "dependency,failed",  "hotstandby", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("hotstandby,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 121");
 		        se = st.getEndingState("unlocked", "enabled", "dependency,failed",  "providingservice", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("hotstandby,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 122");
 		        se = st.getEndingState("unlocked", "enabled", "dependency,failed",  "providingservice", "unlock");
-		        if (se != null) displayEndingState(se);
+				assertEquals("providingservice,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 123");
 		        se = st.getEndingState("unlocked", "enabled", "dependency,failed",  "providingservice", "disableFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 124");
 		        se = st.getEndingState("unlocked", "enabled", "dependency,failed",  "providingservice", "enableNotFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("providingservice,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 125");
 		        se = st.getEndingState("unlocked", "enabled", "dependency,failed",  "providingservice", "disableDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 126");
 		        se = st.getEndingState("unlocked", "enabled", "dependency,failed",  "providingservice", "enableNoDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("providingservice,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 127");
 		        se = st.getEndingState("unlocked", "enabled", "dependency,failed",  "providingservice", "promote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("providingservice,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 128");
 		        se = st.getEndingState("unlocked", "enabled", "dependency,failed",  "providingservice", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("hotstandby,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 129");
 		        se = st.getEndingState("unlocked", "disabled", "null",  "null", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 130");
 		        se = st.getEndingState("unlocked", "disabled", "null",  "null", "unlock");
-		        if (se != null) displayEndingState(se);
+				assertEquals("null,unlocked,disabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 131");
 		        se = st.getEndingState("unlocked", "disabled", "null",  "null", "disableFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("null,unlocked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 132");
 		        se = st.getEndingState("unlocked", "disabled", "null",  "null", "enableNotFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("null,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 133");
 		        se = st.getEndingState("unlocked", "disabled", "null",  "null", "disableDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("null,unlocked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 134");
 		        se = st.getEndingState("unlocked", "disabled", "null",  "null", "enableNoDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("null,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 135");
 		        se = st.getEndingState("unlocked", "disabled", "null",  "null", "promote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,null,StandbyStatusException", makeString(se));
 
 		        logger.info("??? StateTransition testcase 136");
 		        se = st.getEndingState("unlocked", "disabled", "null",  "null", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 137");
 		        se = st.getEndingState("unlocked", "disabled", "null",  "coldstandby", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 138");
 		        se = st.getEndingState("unlocked", "disabled", "null",  "coldstandby", "unlock");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 139");
 		        se = st.getEndingState("unlocked", "disabled", "null",  "coldstandby", "disableFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 140");
 		        se = st.getEndingState("unlocked", "disabled", "null",  "coldstandby", "enableNotFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("hotstandby,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 141");
 		        se = st.getEndingState("unlocked", "disabled", "null",  "coldstandby", "disableDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 142");
 		        se = st.getEndingState("unlocked", "disabled", "null",  "coldstandby", "enableNoDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("hotstandby,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 143");
 		        se = st.getEndingState("unlocked", "disabled", "null",  "coldstandby", "promote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,null,StandbyStatusException", makeString(se));
 
 		        logger.info("??? StateTransition testcase 144");
 		        se = st.getEndingState("unlocked", "disabled", "null",  "coldstandby", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 145");
 		        se = st.getEndingState("unlocked", "disabled", "null",  "hotstandby", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 146");
 		        se = st.getEndingState("unlocked", "disabled", "null",  "hotstandby", "unlock");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 147");
 		        se = st.getEndingState("unlocked", "disabled", "null",  "hotstandby", "disableFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 148");
 		        se = st.getEndingState("unlocked", "disabled", "null",  "hotstandby", "enableNotFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("hotstandby,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 149");
 		        se = st.getEndingState("unlocked", "disabled", "null",  "hotstandby", "disableDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 150");
 		        se = st.getEndingState("unlocked", "disabled", "null",  "hotstandby", "enableNoDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("hotstandby,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 151");
 		        se = st.getEndingState("unlocked", "disabled", "null",  "hotstandby", "promote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,null,StandbyStatusException", makeString(se));
 
 		        logger.info("??? StateTransition testcase 152");
 		        se = st.getEndingState("unlocked", "disabled", "null",  "hotstandby", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 153");
 		        se = st.getEndingState("unlocked", "disabled", "null",  "providingservice", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 154");
 		        se = st.getEndingState("unlocked", "disabled", "null",  "providingservice", "unlock");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 155");
 		        se = st.getEndingState("unlocked", "disabled", "null",  "providingservice", "disableFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 156");
 		        se = st.getEndingState("unlocked", "disabled", "null",  "providingservice", "enableNotFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("hotstandby,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 157");
 		        se = st.getEndingState("unlocked", "disabled", "null",  "providingservice", "disableDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 158");
 		        se = st.getEndingState("unlocked", "disabled", "null",  "providingservice", "enableNoDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("hotstandby,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 159");
 		        se = st.getEndingState("unlocked", "disabled", "null",  "providingservice", "promote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,null,StandbyStatusException", makeString(se));
 
 		        logger.info("??? StateTransition testcase 160");
 		        se = st.getEndingState("unlocked", "disabled", "null",  "providingservice", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 161");
 		        se = st.getEndingState("unlocked", "disabled", "failed",  "null", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 162");
 		        se = st.getEndingState("unlocked", "disabled", "failed",  "null", "unlock");
-		        if (se != null) displayEndingState(se);
+				assertEquals("null,unlocked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 163");
 		        se = st.getEndingState("unlocked", "disabled", "failed",  "null", "disableFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("null,unlocked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 164");
 		        se = st.getEndingState("unlocked", "disabled", "failed",  "null", "enableNotFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("null,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 165");
 		        se = st.getEndingState("unlocked", "disabled", "failed",  "null", "disableDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("null,unlocked,disabled,dependency,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 166");
 		        se = st.getEndingState("unlocked", "disabled", "failed",  "null", "enableNoDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("null,unlocked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 167");
 		        se = st.getEndingState("unlocked", "disabled", "failed",  "null", "promote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,failed,StandbyStatusException", makeString(se));
 
 		        logger.info("??? StateTransition testcase 168");
 		        se = st.getEndingState("unlocked", "disabled", "failed",  "null", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 169");
 		        se = st.getEndingState("unlocked", "disabled", "failed",  "coldstandby", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 170");
 		        se = st.getEndingState("unlocked", "disabled", "failed",  "coldstandby", "unlock");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 171");
 		        se = st.getEndingState("unlocked", "disabled", "failed",  "coldstandby", "disableFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 172");
 		        se = st.getEndingState("unlocked", "disabled", "failed",  "coldstandby", "enableNotFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("hotstandby,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 173");
 		        se = st.getEndingState("unlocked", "disabled", "failed",  "coldstandby", "disableDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,dependency,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 174");
 		        se = st.getEndingState("unlocked", "disabled", "failed",  "coldstandby", "enableNoDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 175");
 		        se = st.getEndingState("unlocked", "disabled", "failed",  "coldstandby", "promote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,failed,StandbyStatusException", makeString(se));
 
 		        logger.info("??? StateTransition testcase 176");
 		        se = st.getEndingState("unlocked", "disabled", "failed",  "coldstandby", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 177");
 		        se = st.getEndingState("unlocked", "disabled", "failed",  "hotstandby", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 178");
 		        se = st.getEndingState("unlocked", "disabled", "failed",  "hotstandby", "unlock");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 179");
 		        se = st.getEndingState("unlocked", "disabled", "failed",  "hotstandby", "disableFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 180");
 		        se = st.getEndingState("unlocked", "disabled", "failed",  "hotstandby", "enableNotFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("hotstandby,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 181");
 		        se = st.getEndingState("unlocked", "disabled", "failed",  "hotstandby", "disableDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,dependency,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 182");
 		        se = st.getEndingState("unlocked", "disabled", "failed",  "hotstandby", "enableNoDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 183");
 		        se = st.getEndingState("unlocked", "disabled", "failed",  "hotstandby", "promote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,failed,StandbyStatusException", makeString(se));
 
 		        logger.info("??? StateTransition testcase 184");
 		        se = st.getEndingState("unlocked", "disabled", "failed",  "hotstandby", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 185");
 		        se = st.getEndingState("unlocked", "disabled", "failed",  "providingservice", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 186");
 		        se = st.getEndingState("unlocked", "disabled", "failed",  "providingservice", "unlock");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 187");
 		        se = st.getEndingState("unlocked", "disabled", "failed",  "providingservice", "disableFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 188");
 		        se = st.getEndingState("unlocked", "disabled", "failed",  "providingservice", "enableNotFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("hotstandby,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 189");
 		        se = st.getEndingState("unlocked", "disabled", "failed",  "providingservice", "disableDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,dependency,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 190");
 		        se = st.getEndingState("unlocked", "disabled", "failed",  "providingservice", "enableNoDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 191");
 		        se = st.getEndingState("unlocked", "disabled", "failed",  "providingservice", "promote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,failed,StandbyStatusException", makeString(se));
 
 		        logger.info("??? StateTransition testcase 192");
 		        se = st.getEndingState("unlocked", "disabled", "failed",  "providingservice", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 193");
 		        se = st.getEndingState("unlocked", "disabled", "dependency",  "null", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 194");
 		        se = st.getEndingState("unlocked", "disabled", "dependency",  "null", "unlock");
-		        if (se != null) displayEndingState(se);
+				assertEquals("null,unlocked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 195");
 		        se = st.getEndingState("unlocked", "disabled", "dependency",  "null", "disableFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("null,unlocked,disabled,dependency,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 196");
 		        se = st.getEndingState("unlocked", "disabled", "dependency",  "null", "enableNotFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("null,unlocked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 197");
 		        se = st.getEndingState("unlocked", "disabled", "dependency",  "null", "disableDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("null,unlocked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 198");
 		        se = st.getEndingState("unlocked", "disabled", "dependency",  "null", "enableNoDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("null,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 199");
 		        se = st.getEndingState("unlocked", "disabled", "dependency",  "null", "promote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,dependency,StandbyStatusException", makeString(se));
 
 		        logger.info("??? StateTransition testcase 200");
 		        se = st.getEndingState("unlocked", "disabled", "dependency",  "null", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 201");
 		        se = st.getEndingState("unlocked", "disabled", "dependency",  "coldstandby", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 202");
 		        se = st.getEndingState("unlocked", "disabled", "dependency",  "coldstandby", "unlock");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 203");
 		        se = st.getEndingState("unlocked", "disabled", "dependency",  "coldstandby", "disableFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,dependency,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 204");
 		        se = st.getEndingState("unlocked", "disabled", "dependency",  "coldstandby", "enableNotFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 205");
 		        se = st.getEndingState("unlocked", "disabled", "dependency",  "coldstandby", "disableDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 206");
 		        se = st.getEndingState("unlocked", "disabled", "dependency",  "coldstandby", "enableNoDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("hotstandby,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 207");
 		        se = st.getEndingState("unlocked", "disabled", "dependency",  "coldstandby", "promote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,dependency,StandbyStatusException", makeString(se));
 
 		        logger.info("??? StateTransition testcase 208");
 		        se = st.getEndingState("unlocked", "disabled", "dependency",  "coldstandby", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 209");
 		        se = st.getEndingState("unlocked", "disabled", "dependency",  "hotstandby", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 210");
 		        se = st.getEndingState("unlocked", "disabled", "dependency",  "hotstandby", "unlock");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 211");
 		        se = st.getEndingState("unlocked", "disabled", "dependency",  "hotstandby", "disableFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,dependency,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 212");
 		        se = st.getEndingState("unlocked", "disabled", "dependency",  "hotstandby", "enableNotFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 213");
 		        se = st.getEndingState("unlocked", "disabled", "dependency",  "hotstandby", "disableDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 214");
 		        se = st.getEndingState("unlocked", "disabled", "dependency",  "hotstandby", "enableNoDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("hotstandby,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 215");
 		        se = st.getEndingState("unlocked", "disabled", "dependency",  "hotstandby", "promote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,dependency,StandbyStatusException", makeString(se));
 
 		        logger.info("??? StateTransition testcase 216");
 		        se = st.getEndingState("unlocked", "disabled", "dependency",  "hotstandby", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 217");
 		        se = st.getEndingState("unlocked", "disabled", "dependency",  "providingservice", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 218");
 		        se = st.getEndingState("unlocked", "disabled", "dependency",  "providingservice", "unlock");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 219");
 		        se = st.getEndingState("unlocked", "disabled", "dependency",  "providingservice", "disableFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,dependency,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 220");
 		        se = st.getEndingState("unlocked", "disabled", "dependency",  "providingservice", "enableNotFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 221");
 		        se = st.getEndingState("unlocked", "disabled", "dependency",  "providingservice", "disableDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 222");
 		        se = st.getEndingState("unlocked", "disabled", "dependency",  "providingservice", "enableNoDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("hotstandby,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 223");
 		        se = st.getEndingState("unlocked", "disabled", "dependency",  "providingservice", "promote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,dependency,StandbyStatusException", makeString(se));
 
 		        logger.info("??? StateTransition testcase 224");
 		        se = st.getEndingState("unlocked", "disabled", "dependency",  "providingservice", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 225");
 		        se = st.getEndingState("unlocked", "disabled", "dependency,failed",  "null", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,dependency,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 226");
 		        se = st.getEndingState("unlocked", "disabled", "dependency,failed",  "null", "unlock");
-		        if (se != null) displayEndingState(se);
+				assertEquals("null,unlocked,disabled,dependency,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 227");
 		        se = st.getEndingState("unlocked", "disabled", "dependency,failed",  "null", "disableFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("null,unlocked,disabled,dependency,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 228");
 		        se = st.getEndingState("unlocked", "disabled", "dependency,failed",  "null", "enableNotFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("null,unlocked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 229");
 		        se = st.getEndingState("unlocked", "disabled", "dependency,failed",  "null", "disableDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("null,unlocked,disabled,dependency,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 230");
 		        se = st.getEndingState("unlocked", "disabled", "dependency,failed",  "null", "enableNoDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("null,unlocked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 231");
 		        se = st.getEndingState("unlocked", "disabled", "dependency,failed",  "null", "promote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,dependency,failed,StandbyStatusException", makeString(se));
 
 		        logger.info("??? StateTransition testcase 232");
 		        se = st.getEndingState("unlocked", "disabled", "dependency,failed",  "null", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,dependency,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 233");
 		        se = st.getEndingState("unlocked", "disabled", "dependency,failed",  "coldstandby", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,dependency,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 234");
 		        se = st.getEndingState("unlocked", "disabled", "dependency,failed",  "coldstandby", "unlock");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,dependency,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 235");
 		        se = st.getEndingState("unlocked", "disabled", "dependency,failed",  "coldstandby", "disableFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,dependency,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 236");
 		        se = st.getEndingState("unlocked", "disabled", "dependency,failed",  "coldstandby", "enableNotFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 237");
 		        se = st.getEndingState("unlocked", "disabled", "dependency,failed",  "coldstandby", "disableDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,dependency,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 238");
 		        se = st.getEndingState("unlocked", "disabled", "dependency,failed",  "coldstandby", "enableNoDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 239");
 		        se = st.getEndingState("unlocked", "disabled", "dependency,failed",  "coldstandby", "promote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,dependency,failed,StandbyStatusException", makeString(se));
 
 		        logger.info("??? StateTransition testcase 240");
 		        se = st.getEndingState("unlocked", "disabled", "dependency,failed",  "coldstandby", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,dependency,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 241");
 		        se = st.getEndingState("unlocked", "disabled", "dependency,failed",  "hotstandby", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,dependency,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 242");
 		        se = st.getEndingState("unlocked", "disabled", "dependency,failed",  "hotstandby", "unlock");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,dependency,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 243");
 		        se = st.getEndingState("unlocked", "disabled", "dependency,failed",  "hotstandby", "disableFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,dependency,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 244");
 		        se = st.getEndingState("unlocked", "disabled", "dependency,failed",  "hotstandby", "enableNotFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 245");
 		        se = st.getEndingState("unlocked", "disabled", "dependency,failed",  "hotstandby", "disableDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,dependency,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 246");
 		        se = st.getEndingState("unlocked", "disabled", "dependency,failed",  "hotstandby", "enableNoDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 247");
 		        se = st.getEndingState("unlocked", "disabled", "dependency,failed",  "hotstandby", "promote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,dependency,failed,StandbyStatusException", makeString(se));
 
 		        logger.info("??? StateTransition testcase 248");
 		        se = st.getEndingState("unlocked", "disabled", "dependency,failed",  "hotstandby", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,dependency,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 249");
 		        se = st.getEndingState("unlocked", "disabled", "dependency,failed",  "providingservice", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,dependency,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 250");
 		        se = st.getEndingState("unlocked", "disabled", "dependency,failed",  "providingservice", "unlock");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,dependency,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 251");
 		        se = st.getEndingState("unlocked", "disabled", "dependency,failed",  "providingservice", "disableFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,dependency,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 252");
 		        se = st.getEndingState("unlocked", "disabled", "dependency,failed",  "providingservice", "enableNotFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 253");
 		        se = st.getEndingState("unlocked", "disabled", "dependency,failed",  "providingservice", "disableDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,dependency,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 254");
 		        se = st.getEndingState("unlocked", "disabled", "dependency,failed",  "providingservice", "enableNoDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 255");
 		        se = st.getEndingState("unlocked", "disabled", "dependency,failed",  "providingservice", "promote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,dependency,failed,StandbyStatusException", makeString(se));
 
 		        logger.info("??? StateTransition testcase 256");
 		        se = st.getEndingState("unlocked", "disabled", "dependency,failed",  "providingservice", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,dependency,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 257");
 		        se = st.getEndingState("locked", "enabled", "null",  "null", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 258");
 		        se = st.getEndingState("locked", "enabled", "null",  "null", "unlock");
-		        if (se != null) displayEndingState(se);
+				assertEquals("null,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 259");
 		        se = st.getEndingState("locked", "enabled", "null",  "null", "disableFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("null,locked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 260");
 		        se = st.getEndingState("locked", "enabled", "null",  "null", "enableNotFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("null,locked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 261");
 		        se = st.getEndingState("locked", "enabled", "null",  "null", "disableDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("null,locked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 262");
 		        se = st.getEndingState("locked", "enabled", "null",  "null", "enableNoDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("null,locked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 263");
 		        se = st.getEndingState("locked", "enabled", "null",  "null", "promote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,StandbyStatusException", makeString(se));
 
 		        logger.info("??? StateTransition testcase 264");
 		        se = st.getEndingState("locked", "enabled", "null",  "null", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 265");
 		        se = st.getEndingState("locked", "enabled", "null",  "coldstandby", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 266");
 		        se = st.getEndingState("locked", "enabled", "null",  "coldstandby", "unlock");
-		        if (se != null) displayEndingState(se);
+				assertEquals("hotstandby,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 267");
 		        se = st.getEndingState("locked", "enabled", "null",  "coldstandby", "disableFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 268");
 		        se = st.getEndingState("locked", "enabled", "null",  "coldstandby", "enableNotFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 269");
 		        se = st.getEndingState("locked", "enabled", "null",  "coldstandby", "disableDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 270");
 		        se = st.getEndingState("locked", "enabled", "null",  "coldstandby", "enableNoDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 271");
 		        se = st.getEndingState("locked", "enabled", "null",  "coldstandby", "promote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,StandbyStatusException", makeString(se));
 
 		        logger.info("??? StateTransition testcase 272");
 		        se = st.getEndingState("locked", "enabled", "null",  "coldstandby", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 273");
 		        se = st.getEndingState("locked", "enabled", "null",  "hotstandby", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 274");
 		        se = st.getEndingState("locked", "enabled", "null",  "hotstandby", "unlock");
-		        if (se != null) displayEndingState(se);
+				assertEquals("hotstandby,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 275");
 		        se = st.getEndingState("locked", "enabled", "null",  "hotstandby", "disableFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 276");
 		        se = st.getEndingState("locked", "enabled", "null",  "hotstandby", "enableNotFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 277");
 		        se = st.getEndingState("locked", "enabled", "null",  "hotstandby", "disableDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 278");
 		        se = st.getEndingState("locked", "enabled", "null",  "hotstandby", "enableNoDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 279");
 		        se = st.getEndingState("locked", "enabled", "null",  "hotstandby", "promote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,StandbyStateException", makeString(se));
 
 		        logger.info("??? StateTransition testcase 280");
 		        se = st.getEndingState("locked", "enabled", "null",  "hotstandby", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 281");
 		        se = st.getEndingState("locked", "enabled", "null",  "providingservice", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 282");
 		        se = st.getEndingState("locked", "enabled", "null",  "providingservice", "unlock");
-		        if (se != null) displayEndingState(se);
+				assertEquals("hotstandby,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 283");
 		        se = st.getEndingState("locked", "enabled", "null",  "providingservice", "disableFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 284");
 		        se = st.getEndingState("locked", "enabled", "null",  "providingservice", "enableNotFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 285");
 		        se = st.getEndingState("locked", "enabled", "null",  "providingservice", "disableDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 286");
 		        se = st.getEndingState("locked", "enabled", "null",  "providingservice", "enableNoDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 287");
 		        se = st.getEndingState("locked", "enabled", "null",  "providingservice", "promote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,StandbyStateException", makeString(se));
 
 		        logger.info("??? StateTransition testcase 288");
 		        se = st.getEndingState("locked", "enabled", "null",  "providingservice", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 289");
 		        se = st.getEndingState("locked", "enabled", "failed",  "null", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 290");
 		        se = st.getEndingState("locked", "enabled", "failed",  "null", "unlock");
-		        if (se != null) displayEndingState(se);
+				assertEquals("null,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 291");
 		        se = st.getEndingState("locked", "enabled", "failed",  "null", "disableFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("null,locked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 292");
 		        se = st.getEndingState("locked", "enabled", "failed",  "null", "enableNotFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("null,locked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 293");
 		        se = st.getEndingState("locked", "enabled", "failed",  "null", "disableDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("null,locked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 294");
 		        se = st.getEndingState("locked", "enabled", "failed",  "null", "enableNoDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("null,locked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 295");
 		        se = st.getEndingState("locked", "enabled", "failed",  "null", "promote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,StandbyStatusException", makeString(se));
 
 		        logger.info("??? StateTransition testcase 296");
 		        se = st.getEndingState("locked", "enabled", "failed",  "null", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 297");
 		        se = st.getEndingState("locked", "enabled", "failed",  "coldstandby", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 298");
 		        se = st.getEndingState("locked", "enabled", "failed",  "coldstandby", "unlock");
-		        if (se != null) displayEndingState(se);
+				assertEquals("hotstandby,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 299");
 		        se = st.getEndingState("locked", "enabled", "failed",  "coldstandby", "disableFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 300");
 		        se = st.getEndingState("locked", "enabled", "failed",  "coldstandby", "enableNotFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 301");
 		        se = st.getEndingState("locked", "enabled", "failed",  "coldstandby", "disableDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 302");
 		        se = st.getEndingState("locked", "enabled", "failed",  "coldstandby", "enableNoDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 303");
 		        se = st.getEndingState("locked", "enabled", "failed",  "coldstandby", "promote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,StandbyStatusException", makeString(se));
 
 		        logger.info("??? StateTransition testcase 304");
 		        se = st.getEndingState("locked", "enabled", "failed",  "coldstandby", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 305");
 		        se = st.getEndingState("locked", "enabled", "failed",  "hotstandby", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 306");
 		        se = st.getEndingState("locked", "enabled", "failed",  "hotstandby", "unlock");
-		        if (se != null) displayEndingState(se);
+				assertEquals("hotstandby,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 307");
 		        se = st.getEndingState("locked", "enabled", "failed",  "hotstandby", "disableFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 308");
 		        se = st.getEndingState("locked", "enabled", "failed",  "hotstandby", "enableNotFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 309");
 		        se = st.getEndingState("locked", "enabled", "failed",  "hotstandby", "disableDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 310");
 		        se = st.getEndingState("locked", "enabled", "failed",  "hotstandby", "enableNoDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 311");
 		        se = st.getEndingState("locked", "enabled", "failed",  "hotstandby", "promote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,StandbyStatusException", makeString(se));
 
 		        logger.info("??? StateTransition testcase 312");
 		        se = st.getEndingState("locked", "enabled", "failed",  "hotstandby", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 313");
 		        se = st.getEndingState("locked", "enabled", "failed",  "providingservice", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 314");
 		        se = st.getEndingState("locked", "enabled", "failed",  "providingservice", "unlock");
-		        if (se != null) displayEndingState(se);
+				assertEquals("hotstandby,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 315");
 		        se = st.getEndingState("locked", "enabled", "failed",  "providingservice", "disableFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 316");
 		        se = st.getEndingState("locked", "enabled", "failed",  "providingservice", "enableNotFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 317");
 		        se = st.getEndingState("locked", "enabled", "failed",  "providingservice", "disableDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 318");
 		        se = st.getEndingState("locked", "enabled", "failed",  "providingservice", "enableNoDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 319");
 		        se = st.getEndingState("locked", "enabled", "failed",  "providingservice", "promote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,StandbyStatusException", makeString(se));
 
 		        logger.info("??? StateTransition testcase 320");
 		        se = st.getEndingState("locked", "enabled", "failed",  "providingservice", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 321");
 		        se = st.getEndingState("locked", "enabled", "dependency",  "null", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 322");
 		        se = st.getEndingState("locked", "enabled", "dependency",  "null", "unlock");
-		        if (se != null) displayEndingState(se);
+				assertEquals("null,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 323");
 		        se = st.getEndingState("locked", "enabled", "dependency",  "null", "disableFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("null,locked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 324");
 		        se = st.getEndingState("locked", "enabled", "dependency",  "null", "enableNotFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("null,locked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 325");
 		        se = st.getEndingState("locked", "enabled", "dependency",  "null", "disableDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("null,locked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 326");
 		        se = st.getEndingState("locked", "enabled", "dependency",  "null", "enableNoDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("null,locked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 327");
 		        se = st.getEndingState("locked", "enabled", "dependency",  "null", "promote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,StandbyStatusException", makeString(se));
 
 		        logger.info("??? StateTransition testcase 328");
 		        se = st.getEndingState("locked", "enabled", "dependency",  "null", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 329");
 		        se = st.getEndingState("locked", "enabled", "dependency",  "coldstandby", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 330");
 		        se = st.getEndingState("locked", "enabled", "dependency",  "coldstandby", "unlock");
-		        if (se != null) displayEndingState(se);
+				assertEquals("hotstandby,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 331");
 		        se = st.getEndingState("locked", "enabled", "dependency",  "coldstandby", "disableFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 332");
 		        se = st.getEndingState("locked", "enabled", "dependency",  "coldstandby", "enableNotFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 333");
 		        se = st.getEndingState("locked", "enabled", "dependency",  "coldstandby", "disableDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 334");
 		        se = st.getEndingState("locked", "enabled", "dependency",  "coldstandby", "enableNoDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 335");
 		        se = st.getEndingState("locked", "enabled", "dependency",  "coldstandby", "promote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,StandbyStatusException", makeString(se));
 
 		        logger.info("??? StateTransition testcase 336");
 		        se = st.getEndingState("locked", "enabled", "dependency",  "coldstandby", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 337");
 		        se = st.getEndingState("locked", "enabled", "dependency",  "hotstandby", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 338");
 		        se = st.getEndingState("locked", "enabled", "dependency",  "hotstandby", "unlock");
-		        if (se != null) displayEndingState(se);
+				assertEquals("hotstandby,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 339");
 		        se = st.getEndingState("locked", "enabled", "dependency",  "hotstandby", "disableFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 340");
 		        se = st.getEndingState("locked", "enabled", "dependency",  "hotstandby", "enableNotFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 341");
 		        se = st.getEndingState("locked", "enabled", "dependency",  "hotstandby", "disableDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 342");
 		        se = st.getEndingState("locked", "enabled", "dependency",  "hotstandby", "enableNoDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 343");
 		        se = st.getEndingState("locked", "enabled", "dependency",  "hotstandby", "promote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,StandbyStatusException", makeString(se));
 
 		        logger.info("??? StateTransition testcase 344");
 		        se = st.getEndingState("locked", "enabled", "dependency",  "hotstandby", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 345");
 		        se = st.getEndingState("locked", "enabled", "dependency",  "providingservice", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 346");
 		        se = st.getEndingState("locked", "enabled", "dependency",  "providingservice", "unlock");
-		        if (se != null) displayEndingState(se);
+				assertEquals("hotstandby,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 347");
 		        se = st.getEndingState("locked", "enabled", "dependency",  "providingservice", "disableFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 348");
 		        se = st.getEndingState("locked", "enabled", "dependency",  "providingservice", "enableNotFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 349");
 		        se = st.getEndingState("locked", "enabled", "dependency",  "providingservice", "disableDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 350");
 		        se = st.getEndingState("locked", "enabled", "dependency",  "providingservice", "enableNoDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 351");
 		        se = st.getEndingState("locked", "enabled", "dependency",  "providingservice", "promote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,StandbyStatusException", makeString(se));
 
 		        logger.info("??? StateTransition testcase 352");
 		        se = st.getEndingState("locked", "enabled", "dependency",  "providingservice", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 353");
 		        se = st.getEndingState("locked", "enabled", "dependency,failed",  "null", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 354");
 		        se = st.getEndingState("locked", "enabled", "dependency,failed",  "null", "unlock");
-		        if (se != null) displayEndingState(se);
+				assertEquals("null,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 355");
 		        se = st.getEndingState("locked", "enabled", "dependency,failed",  "null", "disableFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("null,locked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 356");
 		        se = st.getEndingState("locked", "enabled", "dependency,failed",  "null", "enableNotFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("null,locked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 357");
 		        se = st.getEndingState("locked", "enabled", "dependency,failed",  "null", "disableDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("null,locked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 358");
 		        se = st.getEndingState("locked", "enabled", "dependency,failed",  "null", "enableNoDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("null,locked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 359");
 		        se = st.getEndingState("locked", "enabled", "dependency,failed",  "null", "promote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,StandbyStatusException", makeString(se));
 
 		        logger.info("??? StateTransition testcase 360");
 		        se = st.getEndingState("locked", "enabled", "dependency,failed",  "null", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 361");
 		        se = st.getEndingState("locked", "enabled", "dependency,failed",  "coldstandby", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 362");
 		        se = st.getEndingState("locked", "enabled", "dependency,failed",  "coldstandby", "unlock");
-		        if (se != null) displayEndingState(se);
+				assertEquals("hotstandby,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 363");
 		        se = st.getEndingState("locked", "enabled", "dependency,failed",  "coldstandby", "disableFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 364");
 		        se = st.getEndingState("locked", "enabled", "dependency,failed",  "coldstandby", "enableNotFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 365");
 		        se = st.getEndingState("locked", "enabled", "dependency,failed",  "coldstandby", "disableDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 366");
 		        se = st.getEndingState("locked", "enabled", "dependency,failed",  "coldstandby", "enableNoDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 367");
 		        se = st.getEndingState("locked", "enabled", "dependency,failed",  "coldstandby", "promote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,StandbyStatusException", makeString(se));
 
 		        logger.info("??? StateTransition testcase 368");
 		        se = st.getEndingState("locked", "enabled", "dependency,failed",  "coldstandby", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 369");
 		        se = st.getEndingState("locked", "enabled", "dependency,failed",  "hotstandby", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 370");
 		        se = st.getEndingState("locked", "enabled", "dependency,failed",  "hotstandby", "unlock");
-		        if (se != null) displayEndingState(se);
+				assertEquals("hotstandby,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 371");
 		        se = st.getEndingState("locked", "enabled", "dependency,failed",  "hotstandby", "disableFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 372");
 		        se = st.getEndingState("locked", "enabled", "dependency,failed",  "hotstandby", "enableNotFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 373");
 		        se = st.getEndingState("locked", "enabled", "dependency,failed",  "hotstandby", "disableDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 374");
 		        se = st.getEndingState("locked", "enabled", "dependency,failed",  "hotstandby", "enableNoDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 375");
 		        se = st.getEndingState("locked", "enabled", "dependency,failed",  "hotstandby", "promote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,StandbyStatusException", makeString(se));
 
 		        logger.info("??? StateTransition testcase 376");
 		        se = st.getEndingState("locked", "enabled", "dependency,failed",  "hotstandby", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 377");
 		        se = st.getEndingState("locked", "enabled", "dependency,failed",  "providingservice", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 378");
 		        se = st.getEndingState("locked", "enabled", "dependency,failed",  "providingservice", "unlock");
-		        if (se != null) displayEndingState(se);
+				assertEquals("hotstandby,unlocked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 379");
 		        se = st.getEndingState("locked", "enabled", "dependency,failed",  "providingservice", "disableFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 380");
 		        se = st.getEndingState("locked", "enabled", "dependency,failed",  "providingservice", "enableNotFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 381");
 		        se = st.getEndingState("locked", "enabled", "dependency,failed",  "providingservice", "disableDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 382");
 		        se = st.getEndingState("locked", "enabled", "dependency,failed",  "providingservice", "enableNoDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 383");
 		        se = st.getEndingState("locked", "enabled", "dependency,failed",  "providingservice", "promote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,StandbyStatusException", makeString(se));
 
 		        logger.info("??? StateTransition testcase 384");
 		        se = st.getEndingState("locked", "enabled", "dependency,failed",  "providingservice", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 385");
 		        se = st.getEndingState("locked", "disabled", "null",  "null", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 386");
 		        se = st.getEndingState("locked", "disabled", "null",  "null", "unlock");
-		        if (se != null) displayEndingState(se);
+				assertEquals("null,unlocked,disabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 387");
 		        se = st.getEndingState("locked", "disabled", "null",  "null", "disableFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("null,locked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 388");
 		        se = st.getEndingState("locked", "disabled", "null",  "null", "enableNotFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("null,locked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 389");
 		        se = st.getEndingState("locked", "disabled", "null",  "null", "disableDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("null,locked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 390");
 		        se = st.getEndingState("locked", "disabled", "null",  "null", "enableNoDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("null,locked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 391");
 		        se = st.getEndingState("locked", "disabled", "null",  "null", "promote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,null,StandbyStatusException", makeString(se));
 
 		        logger.info("??? StateTransition testcase 392");
 		        se = st.getEndingState("locked", "disabled", "null",  "null", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 393");
 		        se = st.getEndingState("locked", "disabled", "null",  "coldstandby", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 394");
 		        se = st.getEndingState("locked", "disabled", "null",  "coldstandby", "unlock");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 395");
 		        se = st.getEndingState("locked", "disabled", "null",  "coldstandby", "disableFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 396");
 		        se = st.getEndingState("locked", "disabled", "null",  "coldstandby", "enableNotFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 397");
 		        se = st.getEndingState("locked", "disabled", "null",  "coldstandby", "disableDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 398");
 		        se = st.getEndingState("locked", "disabled", "null",  "coldstandby", "enableNoDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 399");
 		        se = st.getEndingState("locked", "disabled", "null",  "coldstandby", "promote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,null,StandbyStatusException", makeString(se));
 
 		        logger.info("??? StateTransition testcase 400");
 		        se = st.getEndingState("locked", "disabled", "null",  "coldstandby", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 401");
 		        se = st.getEndingState("locked", "disabled", "null",  "hotstandby", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 402");
 		        se = st.getEndingState("locked", "disabled", "null",  "hotstandby", "unlock");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 403");
 		        se = st.getEndingState("locked", "disabled", "null",  "hotstandby", "disableFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 404");
 		        se = st.getEndingState("locked", "disabled", "null",  "hotstandby", "enableNotFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 405");
 		        se = st.getEndingState("locked", "disabled", "null",  "hotstandby", "disableDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 406");
 		        se = st.getEndingState("locked", "disabled", "null",  "hotstandby", "enableNoDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 407");
 		        se = st.getEndingState("locked", "disabled", "null",  "hotstandby", "promote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,null,StandbyStatusException", makeString(se));
 
 		        logger.info("??? StateTransition testcase 408");
 		        se = st.getEndingState("locked", "disabled", "null",  "hotstandby", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 409");
 		        se = st.getEndingState("locked", "disabled", "null",  "providingservice", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 410");
 		        se = st.getEndingState("locked", "disabled", "null",  "providingservice", "unlock");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 411");
 		        se = st.getEndingState("locked", "disabled", "null",  "providingservice", "disableFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 412");
 		        se = st.getEndingState("locked", "disabled", "null",  "providingservice", "enableNotFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 413");
 		        se = st.getEndingState("locked", "disabled", "null",  "providingservice", "disableDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 414");
 		        se = st.getEndingState("locked", "disabled", "null",  "providingservice", "enableNoDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 415");
 		        se = st.getEndingState("locked", "disabled", "null",  "providingservice", "promote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,null,StandbyStatusException", makeString(se));
 
 		        logger.info("??? StateTransition testcase 416");
 		        se = st.getEndingState("locked", "disabled", "null",  "providingservice", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 417");
 		        se = st.getEndingState("locked", "disabled", "failed",  "null", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 418");
 		        se = st.getEndingState("locked", "disabled", "failed",  "null", "unlock");
-		        if (se != null) displayEndingState(se);
+				assertEquals("null,unlocked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 419");
 		        se = st.getEndingState("locked", "disabled", "failed",  "null", "disableFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("null,locked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 420");
 		        se = st.getEndingState("locked", "disabled", "failed",  "null", "enableNotFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("null,locked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 421");
 		        se = st.getEndingState("locked", "disabled", "failed",  "null", "disableDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("null,locked,disabled,dependency,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 422");
 		        se = st.getEndingState("locked", "disabled", "failed",  "null", "enableNoDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("null,locked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 423");
 		        se = st.getEndingState("locked", "disabled", "failed",  "null", "promote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,failed,StandbyStatusException", makeString(se));
 
 		        logger.info("??? StateTransition testcase 424");
 		        se = st.getEndingState("locked", "disabled", "failed",  "null", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 425");
 		        se = st.getEndingState("locked", "disabled", "failed",  "coldstandby", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 426");
 		        se = st.getEndingState("locked", "disabled", "failed",  "coldstandby", "unlock");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 427");
 		        se = st.getEndingState("locked", "disabled", "failed",  "coldstandby", "disableFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 428");
 		        se = st.getEndingState("locked", "disabled", "failed",  "coldstandby", "enableNotFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 429");
 		        se = st.getEndingState("locked", "disabled", "failed",  "coldstandby", "disableDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,dependency,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 430");
 		        se = st.getEndingState("locked", "disabled", "failed",  "coldstandby", "enableNoDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 431");
 		        se = st.getEndingState("locked", "disabled", "failed",  "coldstandby", "promote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,failed,StandbyStatusException", makeString(se));
 
 		        logger.info("??? StateTransition testcase 432");
 		        se = st.getEndingState("locked", "disabled", "failed",  "coldstandby", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 433");
 		        se = st.getEndingState("locked", "disabled", "failed",  "hotstandby", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 434");
 		        se = st.getEndingState("locked", "disabled", "failed",  "hotstandby", "unlock");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 435");
 		        se = st.getEndingState("locked", "disabled", "failed",  "hotstandby", "disableFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 436");
 		        se = st.getEndingState("locked", "disabled", "failed",  "hotstandby", "enableNotFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 437");
 		        se = st.getEndingState("locked", "disabled", "failed",  "hotstandby", "disableDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,dependency,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 438");
 		        se = st.getEndingState("locked", "disabled", "failed",  "hotstandby", "enableNoDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 439");
 		        se = st.getEndingState("locked", "disabled", "failed",  "hotstandby", "promote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,failed,StandbyStatusException", makeString(se));
 
 		        logger.info("??? StateTransition testcase 440");
 		        se = st.getEndingState("locked", "disabled", "failed",  "hotstandby", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 441");
 		        se = st.getEndingState("locked", "disabled", "failed",  "providingservice", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 442");
 		        se = st.getEndingState("locked", "disabled", "failed",  "providingservice", "unlock");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 443");
 		        se = st.getEndingState("locked", "disabled", "failed",  "providingservice", "disableFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 444");
 		        se = st.getEndingState("locked", "disabled", "failed",  "providingservice", "enableNotFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 445");
 		        se = st.getEndingState("locked", "disabled", "failed",  "providingservice", "disableDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,dependency,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 446");
 		        se = st.getEndingState("locked", "disabled", "failed",  "providingservice", "enableNoDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 447");
 		        se = st.getEndingState("locked", "disabled", "failed",  "providingservice", "promote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,failed,StandbyStatusException", makeString(se));
 
 		        logger.info("??? StateTransition testcase 448");
 		        se = st.getEndingState("locked", "disabled", "failed",  "providingservice", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 449");
 		        se = st.getEndingState("locked", "disabled", "dependency",  "null", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 450");
 		        se = st.getEndingState("locked", "disabled", "dependency",  "null", "unlock");
-		        if (se != null) displayEndingState(se);
+				assertEquals("null,unlocked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 451");
 		        se = st.getEndingState("locked", "disabled", "dependency",  "null", "disableFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("null,locked,disabled,dependency,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 452");
 		        se = st.getEndingState("locked", "disabled", "dependency",  "null", "enableNotFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("null,locked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 453");
 		        se = st.getEndingState("locked", "disabled", "dependency",  "null", "disableDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("null,locked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 454");
 		        se = st.getEndingState("locked", "disabled", "dependency",  "null", "enableNoDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("null,locked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 455");
 		        se = st.getEndingState("locked", "disabled", "dependency",  "null", "promote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,dependency,StandbyStatusException", makeString(se));
 
 		        logger.info("??? StateTransition testcase 456");
 		        se = st.getEndingState("locked", "disabled", "dependency",  "null", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 457");
 		        se = st.getEndingState("locked", "disabled", "dependency",  "coldstandby", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 458");
 		        se = st.getEndingState("locked", "disabled", "dependency",  "coldstandby", "unlock");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 459");
 		        se = st.getEndingState("locked", "disabled", "dependency",  "coldstandby", "disableFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,dependency,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 460");
 		        se = st.getEndingState("locked", "disabled", "dependency",  "coldstandby", "enableNotFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 461");
 		        se = st.getEndingState("locked", "disabled", "dependency",  "coldstandby", "disableDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 462");
 		        se = st.getEndingState("locked", "disabled", "dependency",  "coldstandby", "enableNoDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 463");
 		        se = st.getEndingState("locked", "disabled", "dependency",  "coldstandby", "promote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,dependency,StandbyStatusException", makeString(se));
 
 		        logger.info("??? StateTransition testcase 464");
 		        se = st.getEndingState("locked", "disabled", "dependency",  "coldstandby", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 465");
 		        se = st.getEndingState("locked", "disabled", "dependency",  "hotstandby", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 466");
 		        se = st.getEndingState("locked", "disabled", "dependency",  "hotstandby", "unlock");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 467");
 		        se = st.getEndingState("locked", "disabled", "dependency",  "hotstandby", "disableFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,dependency,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 468");
 		        se = st.getEndingState("locked", "disabled", "dependency",  "hotstandby", "enableNotFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 469");
 		        se = st.getEndingState("locked", "disabled", "dependency",  "hotstandby", "disableDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 470");
 		        se = st.getEndingState("locked", "disabled", "dependency",  "hotstandby", "enableNoDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 471");
 		        se = st.getEndingState("locked", "disabled", "dependency",  "hotstandby", "promote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,dependency,StandbyStatusException", makeString(se));
 
 		        logger.info("??? StateTransition testcase 472");
 		        se = st.getEndingState("locked", "disabled", "dependency",  "hotstandby", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 473");
 		        se = st.getEndingState("locked", "disabled", "dependency",  "providingservice", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 474");
 		        se = st.getEndingState("locked", "disabled", "dependency",  "providingservice", "unlock");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 475");
 		        se = st.getEndingState("locked", "disabled", "dependency",  "providingservice", "disableFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,dependency,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 476");
 		        se = st.getEndingState("locked", "disabled", "dependency",  "providingservice", "enableNotFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 477");
 		        se = st.getEndingState("locked", "disabled", "dependency",  "providingservice", "disableDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 478");
 		        se = st.getEndingState("locked", "disabled", "dependency",  "providingservice", "enableNoDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,enabled,null,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 479");
 		        se = st.getEndingState("locked", "disabled", "dependency",  "providingservice", "promote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,dependency,StandbyStatusException", makeString(se));
 
 		        logger.info("??? StateTransition testcase 480");
 		        se = st.getEndingState("locked", "disabled", "dependency",  "providingservice", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 481");
 		        se = st.getEndingState("locked", "disabled", "dependency,failed",  "null", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,dependency,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 482");
 		        se = st.getEndingState("locked", "disabled", "dependency,failed",  "null", "unlock");
-		        if (se != null) displayEndingState(se);
+				assertEquals("null,unlocked,disabled,dependency,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 483");
 		        se = st.getEndingState("locked", "disabled", "dependency,failed",  "null", "disableFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("null,locked,disabled,dependency,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 484");
 		        se = st.getEndingState("locked", "disabled", "dependency,failed",  "null", "enableNotFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("null,locked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 485");
 		        se = st.getEndingState("locked", "disabled", "dependency,failed",  "null", "disableDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("null,locked,disabled,dependency,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 486");
 		        se = st.getEndingState("locked", "disabled", "dependency,failed",  "null", "enableNoDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("null,locked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 487");
 		        se = st.getEndingState("locked", "disabled", "dependency,failed",  "null", "promote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,dependency,failed,StandbyStatusException", makeString(se));
 
 		        logger.info("??? StateTransition testcase 488");
 		        se = st.getEndingState("locked", "disabled", "dependency,failed",  "null", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,dependency,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 489");
 		        se = st.getEndingState("locked", "disabled", "dependency,failed",  "coldstandby", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,dependency,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 490");
 		        se = st.getEndingState("locked", "disabled", "dependency,failed",  "coldstandby", "unlock");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,dependency,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 491");
 		        se = st.getEndingState("locked", "disabled", "dependency,failed",  "coldstandby", "disableFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,dependency,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 492");
 		        se = st.getEndingState("locked", "disabled", "dependency,failed",  "coldstandby", "enableNotFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 493");
 		        se = st.getEndingState("locked", "disabled", "dependency,failed",  "coldstandby", "disableDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,dependency,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 494");
 		        se = st.getEndingState("locked", "disabled", "dependency,failed",  "coldstandby", "enableNoDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 495");
 		        se = st.getEndingState("locked", "disabled", "dependency,failed",  "coldstandby", "promote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,dependency,failed,StandbyStatusException", makeString(se));
 
 		        logger.info("??? StateTransition testcase 496");
 		        se = st.getEndingState("locked", "disabled", "dependency,failed",  "coldstandby", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,dependency,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 497");
 		        se = st.getEndingState("locked", "disabled", "dependency,failed",  "hotstandby", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,dependency,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 498");
 		        se = st.getEndingState("locked", "disabled", "dependency,failed",  "hotstandby", "unlock");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,dependency,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 499");
 		        se = st.getEndingState("locked", "disabled", "dependency,failed",  "hotstandby", "disableFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,dependency,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 500");
 		        se = st.getEndingState("locked", "disabled", "dependency,failed",  "hotstandby", "enableNotFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 501");
 		        se = st.getEndingState("locked", "disabled", "dependency,failed",  "hotstandby", "disableDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,dependency,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 502");
 		        se = st.getEndingState("locked", "disabled", "dependency,failed",  "hotstandby", "enableNoDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 503");
 		        se = st.getEndingState("locked", "disabled", "dependency,failed",  "hotstandby", "promote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,dependency,failed,StandbyStatusException", makeString(se));
 
 		        logger.info("??? StateTransition testcase 504");
 		        se = st.getEndingState("locked", "disabled", "dependency,failed",  "hotstandby", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,dependency,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 505");
 		        se = st.getEndingState("locked", "disabled", "dependency,failed",  "providingservice", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,dependency,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 506");
 		        se = st.getEndingState("locked", "disabled", "dependency,failed",  "providingservice", "unlock");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,unlocked,disabled,dependency,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 507");
 		        se = st.getEndingState("locked", "disabled", "dependency,failed",  "providingservice", "disableFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,dependency,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 508");
 		        se = st.getEndingState("locked", "disabled", "dependency,failed",  "providingservice", "enableNotFailed");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,dependency,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 509");
 		        se = st.getEndingState("locked", "disabled", "dependency,failed",  "providingservice", "disableDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,dependency,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 510");
 		        se = st.getEndingState("locked", "disabled", "dependency,failed",  "providingservice", "enableNoDependency");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,failed,", makeString(se));
 
 		        logger.info("??? StateTransition testcase 511");
 		        se = st.getEndingState("locked", "disabled", "dependency,failed",  "providingservice", "promote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,dependency,failed,StandbyStatusException", makeString(se));
 
 		        logger.info("??? StateTransition testcase 512");
 		        se = st.getEndingState("locked", "disabled", "dependency,failed",  "providingservice", "demote");
-		        if (se != null) displayEndingState(se);
+				assertEquals("coldstandby,locked,disabled,dependency,failed,", makeString(se));
 		        
 		    } catch (Exception ex) {
 		    	logger.error("EndingState NOT found");
 		    	throw new Exception("EndingState NOT found. " + ex);
 		    }
-
-		   	//if (emf.isOpen()) {
-		   		//emf.close(); 
-		   	//}
+		    
 		} catch(Exception ex) {
 			logger.error("Exception: {}" + ex.toString());
 			throw new Exception("Failure getting ending state. " + ex );
-		} finally {
-			if (emf != null && emf.isOpen()) {
-			    emf.close(); 
-			}
 		}
 
 	    logger.info("\n\nStateTransitionTest: Exit\n\n");
 	}
-	
-	private void displayEndingState(StateElement se) 
+
+	/**
+	 * Converts a state element to a comma-separated string.
+	 * @param se	element to be converted
+	 * @return a string representing the element
+	 */
+	private String makeString(StateElement se)
 	{
-		String endingStandbyStatus = se.getEndingStandbyStatus(); 
-		if (endingStandbyStatus != null) {
-			endingStandbyStatus.replace(".",  ",");
+		if(se == null) {
+			return null;
 		}
-	    logger.info("EndingAdminState   = [{}]" + se.getEndingAdminState()); 
-	    logger.info("EndingOpState      = [{}]" + se.getEndingOpState()); 
-	   	logger.info("EndingAvailStatus  = [{}]" + se.getEndingAvailStatus()); 
-	   	logger.info("EndingStandbyStatus= [{}]" + endingStandbyStatus);
-	   	logger.info("Exception          = [{}]" + se.getException()); 	   	
-	} 
-}
\ No newline at end of file
+		
+		StringBuilder b = new StringBuilder();
+		
+		String endingStandbyStatus = se.getEndingStandbyStatus();
+		if (endingStandbyStatus != null) {
+			b.append(endingStandbyStatus.replace(".",  ","));
+			b.append(',');
+		}
+		
+		b.append(se.getEndingAdminState());
+		b.append(',');
+		b.append(se.getEndingOpState());
+		b.append(',');
+		b.append(se.getEndingAvailStatus());
+		b.append(',');
+		b.append(se.getException());
+	   	
+	   	return b.toString();
+	}
+}
diff --git a/integrity-monitor/src/test/java/org/onap/policy/common/im/test/AllSeemsWellTest.java b/integrity-monitor/src/test/java/org/onap/policy/common/im/test/AllSeemsWellTest.java
deleted file mode 100644
index 6fa8114..0000000
--- a/integrity-monitor/src/test/java/org/onap/policy/common/im/test/AllSeemsWellTest.java
+++ /dev/null
@@ -1,265 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * Integrity Monitor
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.policy.common.im.test;
-
-import static org.junit.Assert.*;
-
-import java.util.Map;
-import java.util.Properties;
-
-import javax.persistence.EntityManager;
-import javax.persistence.EntityManagerFactory;
-import javax.persistence.EntityTransaction;
-import javax.persistence.Persistence;
-
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.onap.policy.common.im.IntegrityMonitor;
-import org.onap.policy.common.im.IntegrityMonitorProperties;
-import org.onap.policy.common.im.StateManagement;
-import org.onap.policy.common.im.jpa.ForwardProgressEntity;
-import org.onap.policy.common.im.jpa.StateManagementEntity;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class AllSeemsWellTest {
-	private static Logger logger = LoggerFactory.getLogger(AllSeemsWellTest.class);
-	private static Properties myProp;
-	private static EntityManagerFactory emf;
-	private static EntityManager em;
-	private static EntityTransaction et;
-	private static String resourceName;
-	private static Properties systemProps;
-	
-	private static final String DEFAULT_DB_DRIVER = "org.h2.Driver";
-	private static final String DEFAULT_DB_URL = "jdbc:h2:file:./sql/imTest";
-	private static final String DEFAULT_DB_USER = "sa";
-	private static final String DEFAULT_DB_PWD = "";
-	
-	@BeforeClass
-	public static void setUpClass() throws Exception {
-
-	}
-
-	@AfterClass
-	public static void tearDownClass() throws Exception {
-	}
-
-	@Before
-	public void setUp() throws Exception {
-		IntegrityMonitor.setUnitTesting(true);
-		
-		myProp = new Properties();
-		myProp.put(IntegrityMonitorProperties.DB_DRIVER, AllSeemsWellTest.DEFAULT_DB_DRIVER);
-		myProp.put(IntegrityMonitorProperties.DB_URL, AllSeemsWellTest.DEFAULT_DB_URL);
-		myProp.put(IntegrityMonitorProperties.DB_USER, AllSeemsWellTest.DEFAULT_DB_USER);
-		myProp.put(IntegrityMonitorProperties.DB_PWD, AllSeemsWellTest.DEFAULT_DB_PWD);
-		myProp.put(IntegrityMonitorProperties.SITE_NAME, "SiteA");
-		myProp.put(IntegrityMonitorProperties.NODE_TYPE, "pap");
-		
-		// set JMX remote port in system properties
-		systemProps = System.getProperties();
-		systemProps.put("com.sun.management.jmxremote.port", "9797");
-		
-		resourceName = "siteA.pap1";
-		
-		//Create the data schema and entity manager factory
-		emf = Persistence.createEntityManagerFactory("schemaPU", myProp);
-
-		// Create an entity manager to use the DB
-		em = emf.createEntityManager();
-
-	}
-	
-
-	@After
-	public void tearDown() throws Exception {
-		// clear jmx remote port setting
-		systemProps.remove("com.sun.management.jmxremote.port");
-	}
-
-	//Ignore
-	@Test
-	public void testAllSeemsWell() throws Exception {
-		logger.debug("\nIntegrityMonitorTest: Entering testAllSeemsWell\n\n");
-		
-		// parameters are passed via a properties file
-		myProp.put(IntegrityMonitorProperties.DEPENDENCY_GROUPS, "");
-		myProp.put(IntegrityMonitorProperties.TEST_VIA_JMX, "false");
-		myProp.put(IntegrityMonitorProperties.REFRESH_STATE_AUDIT_INTERVAL_MS, "-1");
-		myProp.put(IntegrityMonitorProperties.STATE_AUDIT_INTERVAL_MS, "-1");
-		myProp.put(IntegrityMonitorProperties.FAILED_COUNTER_THRESHOLD, "1");
-		myProp.put(IntegrityMonitorProperties.FP_MONITOR_INTERVAL, "5");
-		myProp.put(IntegrityMonitorProperties.TEST_TRANS_INTERVAL, "1");
-		myProp.put(IntegrityMonitorProperties.WRITE_FPC_INTERVAL, "1");
-
-		IntegrityMonitor.updateProperties(myProp);
-		/*
-		 *  The monitorInterval is 5 and the failedCounterThreshold is 1
-		 *  A forward progress will be stale after 5 seconds.
-		 */
-		
-		et = em.getTransaction();
-		et.begin();
-
-		// Make sure we start with the DB clean
-		em.createQuery("DELETE FROM StateManagementEntity").executeUpdate();
-		em.createQuery("DELETE FROM ResourceRegistrationEntity").executeUpdate();
-		em.createQuery("DELETE FROM ForwardProgressEntity").executeUpdate();
-
-		em.flush();
-		et.commit();
-
-		IntegrityMonitor.deleteInstance();
-		
-		IntegrityMonitor im = IntegrityMonitor.getInstance(resourceName, myProp);
-
-		StateManagement sm = im.getStateManager();
-		
-		//Give it time to set the states in the DB
-		Thread.sleep(15000);
-
-		//Check the state
-		logger.debug("\n\ntestAllSeemsWell starting im state \nAdminState = {}\nOpState() = {}\nAvailStatus = {}\nStandbyStatus = {}\n",
-				sm.getAdminState(),
-				sm.getOpState(),
-				sm.getAvailStatus(),
-				sm.getStandbyStatus());
-		
-		assertTrue(sm.getOpState().equals(StateManagement.ENABLED));
-		
-		//Indicate a failure
-		im.allSeemsWell(this.getClass().getName(), IntegrityMonitorProperties.ALLNOTWELL, 
-				"'AllSeemsWellTest - ALLNOTWELL'");
-		
-		//Wait for the state to change due to ALLNOTWELL
-		Thread.sleep(15000);
-		//Check the state
-		logger.debug("\n\ntestAllSeemsWell after ALLNOTWELL: im state \nAdminState = {}\nOpState() = {}\nAvailStatus = {}\nStandbyStatus = {}\n",
-				sm.getAdminState(),
-				sm.getOpState(),
-				sm.getAvailStatus(),
-				sm.getStandbyStatus());
-		
-		//assertTrue(sm.getOpState().equals(StateManagement.DISABLED));
-		
-		Map<String, String> allNotWellMap = im.getAllNotWellMap();
-		for(String key: allNotWellMap.keySet()){
-			logger.debug("AllSeemsWellTest: allNotWellMap: key = {}  msg = {}", key, allNotWellMap.get(key));							
-		}
-		//assertTrue(allNotWellMap.size() == 1);
-
-		Map<String,String> allSeemsWellMap = im.getAllSeemsWellMap();
-		//assertTrue(allSeemsWellMap.isEmpty());
-		
-		//Return to normal
-		im.allSeemsWell(this.getClass().getName(), IntegrityMonitorProperties.ALLSEEMSWELL, 
-				"'AllSeemsWellTest - ALLSEEMSWELL'");
-		
-		//Wait for the state to change due to ALLNOTWELL
-		Thread.sleep(15000);
-		//Check the state
-		logger.debug("\n\ntestAllSeemsWell after ALLSEEMSWELL: im state \nAdminState = {}\nOpState() = {}\nAvailStatus = {}\nStandbyStatus = {}\n",
-				sm.getAdminState(),
-				sm.getOpState(),
-				sm.getAvailStatus(),
-				sm.getStandbyStatus());
-		
-		//assertTrue(sm.getOpState().equals(StateManagement.ENABLED));
-		
-		allNotWellMap = im.getAllNotWellMap();
-		assertTrue(allNotWellMap.isEmpty());
-		
-		allSeemsWellMap = im.getAllSeemsWellMap();
-		assertTrue(allSeemsWellMap.size() == 1);
-		for(String key: allSeemsWellMap.keySet()){
-			logger.debug("AllSeemsWellTest: allSeemsWellMap: key = {}  msg = {}", key, allSeemsWellMap.get(key));							
-		}
-		
-		//Check for null parameters
-		try{
-			im.allSeemsWell(null, IntegrityMonitorProperties.ALLSEEMSWELL, 
-					"'AllSeemsWellTest - ALLSEEMSWELL'");
-			assertTrue(false);
-		}catch (IllegalArgumentException e) {
-			assertTrue(true);
-		}
-		
-		try{
-			im.allSeemsWell("", IntegrityMonitorProperties.ALLSEEMSWELL, 
-					"'AllSeemsWellTest - ALLSEEMSWELL'");
-			assertTrue(false);
-		}catch (IllegalArgumentException e) {
-			assertTrue(true);
-		}
-		
-		try{
-			im.allSeemsWell(this.getClass().getName(), null, 
-					"'AllSeemsWellTest - ALLSEEMSWELL'");
-			assertTrue(false);
-		}catch (IllegalArgumentException e) {
-			assertTrue(true);
-		}
-		
-		try{
-			im.allSeemsWell(this.getClass().getName(), IntegrityMonitorProperties.ALLSEEMSWELL, 
-					null);
-			assertTrue(false);
-		}catch (IllegalArgumentException e) {
-			assertTrue(true);
-		}
-		
-		try{
-			im.allSeemsWell(this.getClass().getName(), IntegrityMonitorProperties.ALLSEEMSWELL, 
-					"");
-			assertTrue(false);
-		}catch (IllegalArgumentException e) {
-			assertTrue(true);
-		}
-		
-		// undo settings
-		myProp.put(IntegrityMonitorProperties.FAILED_COUNTER_THRESHOLD, Integer.toString(IntegrityMonitorProperties.DEFAULT_FAILED_COUNTER_THRESHOLD));
-		myProp.put(IntegrityMonitorProperties.FP_MONITOR_INTERVAL, Integer.toString(IntegrityMonitorProperties.DEFAULT_MONITOR_INTERVAL));
-		myProp.put(IntegrityMonitorProperties.FAILED_COUNTER_THRESHOLD, Integer.toString(IntegrityMonitorProperties.DEFAULT_FAILED_COUNTER_THRESHOLD));
-		myProp.put(IntegrityMonitorProperties.FP_MONITOR_INTERVAL, Integer.toString(IntegrityMonitorProperties.DEFAULT_MONITOR_INTERVAL));
-		myProp.put(IntegrityMonitorProperties.TEST_TRANS_INTERVAL, Integer.toString(IntegrityMonitorProperties.DEFAULT_TEST_INTERVAL));
-		myProp.put(IntegrityMonitorProperties.WRITE_FPC_INTERVAL, Integer.toString(IntegrityMonitorProperties.DEFAULT_WRITE_FPC_INTERVAL));
-		IntegrityMonitor.updateProperties(myProp);
-
-		et = em.getTransaction();
-		
-		et.begin();
-		// Make sure we leave the DB clean
-		em.createQuery("DELETE FROM StateManagementEntity").executeUpdate();
-		em.createQuery("DELETE FROM ResourceRegistrationEntity").executeUpdate();
-		em.createQuery("DELETE FROM ForwardProgressEntity").executeUpdate();
-
-		em.flush();
-		et.commit();
-		
-		logger.debug("\n\ntestAllSeemsWell: Exit\n\n");
-	}
-
-}
diff --git a/integrity-monitor/src/test/java/org/onap/policy/common/im/test/IntegrityMonitorTest.java b/integrity-monitor/src/test/java/org/onap/policy/common/im/test/IntegrityMonitorTest.java
deleted file mode 100644
index 1efc90c..0000000
--- a/integrity-monitor/src/test/java/org/onap/policy/common/im/test/IntegrityMonitorTest.java
+++ /dev/null
@@ -1,1095 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * Integrity Monitor
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.policy.common.im.test;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-import java.util.Date;
-import java.util.List;
-import java.util.Properties;
-
-import javax.persistence.EntityManager;
-import javax.persistence.EntityManagerFactory;
-import javax.persistence.EntityTransaction;
-import javax.persistence.Persistence;
-import javax.persistence.Query;
-import javax.persistence.TemporalType;
-
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.onap.policy.common.im.IntegrityMonitor;
-import org.onap.policy.common.im.IntegrityMonitorProperties;
-import org.onap.policy.common.im.StateManagement;
-import org.onap.policy.common.im.jpa.ForwardProgressEntity;
-import org.onap.policy.common.im.jpa.ResourceRegistrationEntity;
-import org.onap.policy.common.im.jpa.StateManagementEntity;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/*
- * All JUnits are designed to run in the local development environment
- * where they have write privileges and can execute time-sensitive
- * tasks.
- */
-public class IntegrityMonitorTest {
-	private static Logger logger = LoggerFactory.getLogger(IntegrityMonitorTest.class);
-	private static Properties myProp;
-	private static EntityManagerFactory emf;
-	private static EntityManager em;
-	private static EntityTransaction et;
-	private static String resourceName;
-	private static Properties systemProps;
-	
-	private static final String DEFAULT_DB_DRIVER = "org.h2.Driver";
-	private static final String DEFAULT_DB_URL = "jdbc:h2:file:./sql/imTest";
-	private static final String DEFAULT_DB_USER = "sa";
-	private static final String DEFAULT_DB_PWD = "";
-	
-	@BeforeClass
-	public static void setUpClass() throws Exception {
-
-	}
-
-	@AfterClass
-	public static void tearDownClass() throws Exception {
-	}
-
-	@Before
-	public void setUp() throws Exception {
-		IntegrityMonitor.setUnitTesting(true);
-		
-		cleanMyProp();
-		
-		// set JMX remote port in system properties
-		systemProps = System.getProperties();
-		systemProps.put("com.sun.management.jmxremote.port", "9797");
-		
-		resourceName = "siteA.pap1";
-		
-		//Create the data schema and entity manager factory
-		emf = Persistence.createEntityManagerFactory("schemaPU", myProp);
-
-		// Create an entity manager to use the DB
-		em = emf.createEntityManager();
-
-	}
-	
-
-	@After
-	public void tearDown() throws Exception {
-		// clear jmx remote port setting
-		systemProps.remove("com.sun.management.jmxremote.port");
-	}
-	
-	private void cleanMyProp(){
-		myProp = new Properties();
-		myProp.put(IntegrityMonitorProperties.DB_DRIVER, IntegrityMonitorTest.DEFAULT_DB_DRIVER);
-		myProp.put(IntegrityMonitorProperties.DB_URL, IntegrityMonitorTest.DEFAULT_DB_URL);
-		myProp.put(IntegrityMonitorProperties.DB_USER, IntegrityMonitorTest.DEFAULT_DB_USER);
-		myProp.put(IntegrityMonitorProperties.DB_PWD, IntegrityMonitorTest.DEFAULT_DB_PWD);
-		myProp.put(IntegrityMonitorProperties.SITE_NAME, "SiteA");
-		myProp.put(IntegrityMonitorProperties.NODE_TYPE, "pap");
-	}
-	
-	private void cleanDb(){
-		et = em.getTransaction();
-		
-		et.begin();
-		// Make sure we leave the DB clean
-		em.createQuery("DELETE FROM StateManagementEntity").executeUpdate();
-		em.createQuery("DELETE FROM ResourceRegistrationEntity").executeUpdate();
-		em.createQuery("DELETE FROM ForwardProgressEntity").executeUpdate();
-		em.flush();
-		et.commit();
-	}
-	
-	
-	/*
-	 * The following runs all tests and controls the order of execution. If you allow
-	 * the tests to execute individually, you cannot predict the order and some
-	 * conflicts may occur.
-	 */
-	//@Ignore
-	@Test
-	public void runAllTests() throws Exception{
-		testSanityJmx();
-		testIM(); 
-		testSanityState();
-		testRefreshStateAudit();
-		testStateCheck();
-		testGetAllForwardProgressEntity();
-		testStateAudit(); 
-	}
-
-	/*
-	 * The following test verifies the following test cases:
-	 * New Install
-	 * New Install - Bad Dependency data
-	 * Recovery from bad dependency data
-	 * Lock
-	 * Lock restart
-	 * Unlock
-	 * Unlock restart
-	 */
-	public void testSanityJmx() throws Exception {
-		logger.debug("\nIntegrityMonitorTest: Entering testSanityJmx\n\n");
-		cleanDb();
-		cleanMyProp();
-		IntegrityMonitor.deleteInstance();
-		
-		String dependent = "group1_logparser";
-		
-		// parameters are passed via a properties file
-		myProp.put(IntegrityMonitorProperties.DEPENDENCY_GROUPS, dependent);
-		myProp.put(IntegrityMonitorProperties.TEST_VIA_JMX, "true");
-		// Disable the integrity monitor so it will not interfere
-		myProp.put(IntegrityMonitorProperties.FP_MONITOR_INTERVAL, "-1");
-		// Disable the refresh state audit
-		myProp.put(IntegrityMonitorProperties.REFRESH_STATE_AUDIT_INTERVAL_MS, "-1");
-		// Disable the state audit
-		myProp.put(IntegrityMonitorProperties.STATE_AUDIT_INTERVAL_MS, "-1");
-		// Disable the test transaction
-		myProp.put(IntegrityMonitorProperties.TEST_TRANS_INTERVAL, "-1");
-		// Disable the write FPC
-		myProp.put(IntegrityMonitorProperties.WRITE_FPC_INTERVAL, "-1");
-		// Speed up the check
-		myProp.put(IntegrityMonitorProperties.CHECK_DEPENDENCY_INTERVAL, "1");
-		// Fail dependencies after three seconds
-		myProp.put(IntegrityMonitorProperties.MAX_FPC_UPDATE_INTERVAL, "3");
-		
-		IntegrityMonitor im = IntegrityMonitor.getInstance(resourceName, myProp);
-		logger.debug("\n\ntestSanityJmx starting im state \nAdminState = {}\nOpState() = {}\nAvailStatus = {}\nStandbyStatus = {}\n",
-				im.getStateManager().getAdminState(),
-				im.getStateManager().getOpState(),
-				im.getStateManager().getAvailStatus(),
-				im.getStateManager().getStandbyStatus());
-		// add an entry to Resource registration table in the DB for the dependent resource
-		
-		
-		et = em.getTransaction();
-		et.begin();
-    	Query rquery = em.createQuery("Select r from ResourceRegistrationEntity r where r.resourceName=:rn");
-    	rquery.setParameter("rn", dependent);
-
-    	@SuppressWarnings("rawtypes")
-    	List rrList = rquery.getResultList();
-    	ResourceRegistrationEntity rrx = null;
-    	if(rrList.isEmpty()){
-    		// register resource by adding entry to table in DB
-    		logger.debug("Adding resource {}  to ResourceRegistration table", dependent);  	
-    		rrx = new ResourceRegistrationEntity();
-    		// set columns in entry
-    		rrx.setResourceName(dependent);
-    		rrx.setResourceUrl("service:jmx:somewhere:9999");
-    		rrx.setNodeType("logparser");
-    		rrx.setSite("siteA");
-    	}
-    	em.persist(rrx);
-    	// flush to the DB
-    	em.flush();
-    	
-    	// commit transaction
-    	et.commit();
-    	
-    	Thread.sleep(5000); //sleep 5 sec so the FPManager has time to check dependency health
-		
-		boolean sanityPass = true;
-		try {
-			im.evaluateSanity();
-		} catch (Exception e) {
-			logger.error("evaluateSanity exception: ", e);
-			sanityPass = false;
-		}
-		assertFalse(sanityPass);  // expect sanity test to fail
-
-		// undo dependency groups and jmx test properties settings
-		myProp.put(IntegrityMonitorProperties.DEPENDENCY_GROUPS, "");
-		myProp.put(IntegrityMonitorProperties.TEST_VIA_JMX, "false");
-		IntegrityMonitor.updateProperties(myProp);
-
-		logger.debug("\ntestSantityJmx ending properties: {}", myProp);
-		
-		//We know at this point that the IM is disable-dependency.  We want to be
-		//sure it will recover from this condition since the properties were
-		//updated.
-		
-		
-		logger.debug("\n\ntestSanityJmx ending im state\nAdminState = {}\nOpState() = {}\nAvailStatus = {}\nStandbyStatus = {}\n",
-				im.getStateManager().getAdminState(),
-				im.getStateManager().getOpState(),
-				im.getStateManager().getAvailStatus(),
-				im.getStateManager().getStandbyStatus());
-		
-		//Destroy the instance
-		logger.debug("\ntestSanityJmx restarting the IntegrityMonitor");
-		IntegrityMonitor.deleteInstance();
-		//Create a new instance.  It should recover from the disabled-dependency condition
-		im = IntegrityMonitor.getInstance(resourceName, myProp);
-		
-		logger.debug("\n\ntestSanityJmx state after creating new im\n"+
-					"AdminState = {}\nOpState() = {}\nAvailStatus = {}\nStandbyStatus = {}\n",
-						im.getStateManager().getAdminState(),
-						im.getStateManager().getOpState(),
-						im.getStateManager().getAvailStatus(),
-						im.getStateManager().getStandbyStatus());
-
-		//Verify the state
-		assertEquals(im.getStateManager().getAdminState(), StateManagement.UNLOCKED);
-		assertEquals(im.getStateManager().getOpState(), StateManagement.ENABLED);
-		assertEquals(im.getStateManager().getAvailStatus(), StateManagement.NULL_VALUE);
-		assertEquals(im.getStateManager().getStandbyStatus(), StateManagement.NULL_VALUE);
-		
-		//Test state manager via the IntegrityMonitor
-		StateManagement sm = im.getStateManager();
-		
-		// Verify lock state
-		sm.lock();
-		logger.debug("\n\nsm.lock()\nAdminState = {}\nOpState() = {}\nAvailStatus = {}\nStandbyStatus = {}\n",
-			sm.getAdminState(),
-			sm.getOpState(),
-			sm.getAvailStatus(),
-			sm.getStandbyStatus());
-		assert(sm.getAdminState().equals(StateManagement.LOCKED));
-		
-		//Verify lock persists across a restart
-		//Destroy the instance
-		logger.debug("\ntestSanityJmx restarting the IntegrityMonitor");
-		IntegrityMonitor.deleteInstance();
-		//Create a new instance.  It should come up with the admin state locked
-		im = IntegrityMonitor.getInstance(resourceName, myProp);
-		sm = im.getStateManager();
-		logger.debug("\n\ntestSanityJmx restart with AdminState=locked"+
-					 "\nAdminState = {}\nOpState() = {}\nAvailStatus = {}\nStandbyStatus = {}\n",
-					 	sm.getAdminState(),
-					 	sm.getOpState(),
-					 	sm.getAvailStatus(),
-					 	sm.getStandbyStatus());
-		assert(sm.getAdminState().equals(StateManagement.LOCKED));
-		
-		// Verify unlock
-		sm.unlock();
-		logger.debug("\n\ntestSanityJmx sm.unlock\nAdminState = {}\nOpState() = {}\nAvailStatus = {}\nStandbyStatus = {}\n",
-				sm.getAdminState(),
-				sm.getOpState(),
-				sm.getAvailStatus(),
-				sm.getStandbyStatus());
-		assert(sm.getAdminState().equals(StateManagement.UNLOCKED));		
-		
-		// Verify unlock restart
-		//Destroy the instance
-		logger.debug("\ntestSanityJmx restarting the IntegrityMonitor");
-		IntegrityMonitor.deleteInstance();
-		//Create a new instance.  It should come up with the admin state locked
-		im = IntegrityMonitor.getInstance(resourceName, myProp);
-		sm = im.getStateManager();
-		logger.debug("\n\ntestSanityJmx restart with AdminState=unlocked\n" + 
-					"AdminState = {}\nOpState() = {}\nAvailStatus = {}\nStandbyStatus = {}\n",
-						sm.getAdminState(),
-						sm.getOpState(),
-						sm.getAvailStatus(),
-						sm.getStandbyStatus());
-		
-		assert(sm.getAdminState().equals(StateManagement.UNLOCKED));
-		
-		logger.debug("\n\ntestSanityJmx: Exit\n\n");
-	}
-	
-
-	public void testIM() throws Exception {
-		logger.debug("\nIntegrityMonitorTest: Entering testIM\n\n");
-		cleanDb();
-		cleanMyProp();
-		IntegrityMonitor.deleteInstance();
-		
-		// Disable the integrity monitor so it will not interfere
-		myProp.put(IntegrityMonitorProperties.FP_MONITOR_INTERVAL, "-1");
-		// Disable dependency checking
-		myProp.put(IntegrityMonitorProperties.CHECK_DEPENDENCY_INTERVAL, "-1");
-		// Disable the refresh state audit
-		myProp.put(IntegrityMonitorProperties.REFRESH_STATE_AUDIT_INTERVAL_MS, "-1");
-		// Disable the state audit
-		myProp.put(IntegrityMonitorProperties.STATE_AUDIT_INTERVAL_MS, "-1");
-		// Disable the test transaction
-		myProp.put(IntegrityMonitorProperties.TEST_TRANS_INTERVAL, "-1");
-		// Disable writing the FPC
-		myProp.put(IntegrityMonitorProperties.WRITE_FPC_INTERVAL, "-1");
-		
-		IntegrityMonitor im = IntegrityMonitor.getInstance(resourceName, myProp);
-		
-		logger.debug("\n\nim initial state: \nAdminState = {}\nOpState() = {}\nAvailStatus = {}\nStandbyStatus = {}\n",
-						im.getStateManager().getAdminState(),
-						im.getStateManager().getOpState(),
-						im.getStateManager().getAvailStatus(),
-						im.getStateManager().getStandbyStatus());
-		
-		// test evaluate sanity
-		boolean sanityPass = true;
-		try {
-			im.evaluateSanity();
-		} catch (Exception e) {
-			logger.error("evaluateSanity exception: ", e);
-			sanityPass = false;
-		}
-		assertTrue(sanityPass);  // expect sanity test to pass
-		
-		//Test startTransaction - should works since it is unlocked
-		boolean transPass = true;
-		try{
-			im.startTransaction();
-		} catch (Exception e){
-			logger.error("startTransaction exception: ", e);
-			transPass = false;
-		}
-		assertTrue(transPass);
-		
-		//Test state manager via the IntegrityMonitor
-		StateManagement sm = im.getStateManager();
-		
-		sm.lock();
-		
-		logger.debug("\n\nsm.lock()\nAdminState = {}\nOpState() = {}\nAvailStatus = {}\nStandbyStatus = {}\n",
-					sm.getAdminState(),
-					sm.getOpState(),
-					sm.getAvailStatus(),
-					sm.getStandbyStatus());
-		
-		assert(sm.getAdminState().equals(StateManagement.LOCKED));
-		
-		//test startTransaction.  It should fail since it is locked
-		transPass = true;
-		try{
-			im.startTransaction();
-		} catch (Exception e){
-			logger.error("startTransaction exception: ", e);
-			transPass = false;
-		}
-		assertTrue(!transPass); //expect it to fail
-		
-		sm.unlock();
-		logger.debug("\n\nsm.unlock()\nAdminState = {}\nOpState() = {}\nAvailStatus = {}\nStandbyStatus = {}\n",
-						sm.getAdminState(),
-						sm.getOpState(),
-						sm.getAvailStatus(),
-						sm.getStandbyStatus());
-		assert(sm.getAdminState().equals(StateManagement.UNLOCKED));
-		
-		//test startTransaction.  It should succeed
-		transPass = true;
-		try{
-			im.startTransaction();
-		} catch (Exception e){
-			logger.error("startTransaction exception: ", e);
-			transPass = false;
-		}
-		assertTrue(transPass); //expect it to succeed
-		
-		sm.disableDependency();
-		logger.debug("\n\nsm.disableDependency()\nAdminState = {}\nOpState() = {}\nAvailStatus = {}\nStandbyStatus = {}\n",
-				sm.getAdminState(),
-				sm.getOpState(),
-				sm.getAvailStatus(),
-				sm.getStandbyStatus());
-		
-		assert(sm.getOpState().equals(StateManagement.DISABLED));
-		assert(sm.getAvailStatus().equals(StateManagement.DEPENDENCY));
-		
-		//test startTransaction.  It should succeed since standby status is null and unlocked
-		transPass = true;
-		try{
-			im.startTransaction();
-		} catch (Exception e){
-			logger.error("startTransaction exception: ", e);
-			transPass = false;
-		}
-		assertTrue(transPass); //expect it to succeed
-	
-		sm.enableNoDependency();
-
-		logger.debug("\n\nsm.enableNoDependency()\nAdminState = {}\nOpState() = {}\nAvailStatus = {}\nStandbyStatus = {}\n",
-				sm.getAdminState(),
-				sm.getOpState(),
-				sm.getAvailStatus(),
-				sm.getStandbyStatus());
-		assert(sm.getOpState().equals(StateManagement.ENABLED));
-		//test startTransaction.  It should succeed since standby status is null and unlocked
-		transPass = true;
-		try{
-			im.startTransaction();
-		} catch (Exception e){
-			System.out.println("startTransaction exception: " + e);
-			transPass = false;
-		}
-		assertTrue(transPass); //expect it to succeed
-	
-		
-		sm.disableFailed();
-		logger.debug("\n\nsm.disableFailed()\nAdminState = {}\nOpState() = {}\nAvailStatus = {}\nStandbyStatus = {}\n",
-				sm.getAdminState(),
-				sm.getOpState(),
-				sm.getAvailStatus(),
-				sm.getStandbyStatus());
-
-		assert(sm.getOpState().equals(StateManagement.DISABLED));
-		assert(sm.getAvailStatus().equals(StateManagement.FAILED));
-		//test startTransaction.  It should succeed since standby status is null and unlocked
-		transPass = true;
-		try{
-			im.startTransaction();
-		} catch (Exception e){
-			System.out.println("startTransaction exception: " + e);
-			transPass = false;
-		}
-		assertTrue(transPass); //expect it to succeed
-	
-		sm.enableNotFailed();
-		
-		logger.debug("\n\nsm.enabledNotFailed()\nAdminState = {}\nOpState() = {}\nAvailStatus = {}\nStandbyStatus = {}\n",
-				sm.getAdminState(),
-				sm.getOpState(),
-				sm.getAvailStatus(),
-				sm.getStandbyStatus());
-		
-		assert(sm.getOpState().equals(StateManagement.ENABLED));
-		//test startTransaction.  It should succeed since standby status is null and unlocked
-		transPass = true;
-		try{
-			im.startTransaction();
-		} catch (Exception e){
-			logger.error("startTransaction exception: ", e);
-			transPass = false;
-		}
-		assertTrue(transPass); //expect it to succeed
-	
-		sm.demote();
-
-		logger.debug("\n\nsm.demote()\nAdminState = {}\nOpState() = {}\nAvailStatus = {}\nStandbyStatus = {}\n",
-				sm.getAdminState(),
-				sm.getOpState(),
-				sm.getAvailStatus(),
-				sm.getStandbyStatus());
-		
-		assert(sm.getStandbyStatus().equals(StateManagement.HOT_STANDBY));
-
-		//test startTransaction.  It should fail since it is standby
-		transPass = true;
-		try{
-			im.startTransaction();
-		} catch (Exception e){
-			logger.error("startTransaction exception: ", e);
-			transPass = false;
-		}
-		assertTrue(!transPass); //expect it to fail
-		
-		sm.promote();
-
-		logger.debug("\n\nsm.promote()\nAdminState = {}\nOpState() = {}\nAvailStatus = {}\nStandbyStatus = {}\n",
-				sm.getAdminState(),
-				sm.getOpState(),
-				sm.getAvailStatus(),
-				sm.getStandbyStatus());
-		
-		assert(sm.getStandbyStatus().equals(StateManagement.PROVIDING_SERVICE));
-
-		//test startTransaction.  It should succeed since it is providing service
-		transPass = true;
-		try{
-			im.startTransaction();
-		} catch (Exception e){
-			logger.error("startTransaction exception: ", e);
-			transPass = false;
-		}
-		assertTrue(transPass); //expect it to succeed
-		
-		
-		//Test the multi-valued availability status
-		sm.disableDependency();
-		sm.disableFailed();
-
-		logger.debug("\n\nsm.disableDependency(), sm.disableFailed\nAdminState = {}\nOpState() = {}\nAvailStatus = {}\nStandbyStatus = {}\n",
-				sm.getAdminState(),
-				sm.getOpState(),
-				sm.getAvailStatus(),
-				sm.getStandbyStatus());
-		
-		assert(sm.getAvailStatus().equals(StateManagement.DEPENDENCY_FAILED));
-		
-		//Test startTransaction.  Should fail since standby status is cold standby
-		transPass = true;
-		try{
-			im.startTransaction();
-		} catch (Exception e){
-			logger.error("startTransaction exception: ", e);
-			transPass = false;
-		}
-		assertTrue(!transPass); //expect it to fail
-		
-		sm.enableNoDependency();
-
-		logger.debug("\n\nsm.enableNoDependency()\nAdminState = {}\nOpState() = {}\nAvailStatus = {}\nStandbyStatus = {}\n",
-				sm.getAdminState(),
-				sm.getOpState(),
-				sm.getAvailStatus(),
-				sm.getStandbyStatus());
-		assert(sm.getAvailStatus().equals(StateManagement.FAILED));
-		//Test startTransaction.  Should fail since standby status is cold standby
-		transPass = true;
-		try{
-			im.startTransaction();
-		} catch (Exception e){
-			logger.error("startTransaction exception: ", e);
-			transPass = false;
-		}
-		assertTrue(!transPass); //expect it to fail
-	
-		sm.disableDependency();
-		sm.enableNotFailed();
-		
-		logger.debug("\n\nsm.disableDependency(),sm.enableNotFailed()\nAdminState = {}\nOpState() = {}\nAvailStatus = {}\nStandbyStatus = {}\n",
-				sm.getAdminState(),
-				sm.getOpState(),
-				sm.getAvailStatus(),
-				sm.getStandbyStatus());		
-
-		assert(sm.getAvailStatus().equals(StateManagement.DEPENDENCY));
-		//Test startTransaction.  Should fail since standby status is cold standby
-		transPass = true;
-		try{
-			im.startTransaction();
-		} catch (Exception e){
-			logger.error("startTransaction exception: ", e);
-			transPass = false;
-		}
-		assertTrue(!transPass); //expect it to fail
-	
-		sm.enableNoDependency();
-		logger.debug("\n\nsm.enableNoDependency()\nAdminState = {}\nOpState() = {}\nAvailStatus = {}\nStandbyStatus = {}\n",
-				sm.getAdminState(),
-				sm.getOpState(),
-				sm.getAvailStatus(),
-				sm.getStandbyStatus());
-		assert(sm.getOpState().equals(StateManagement.ENABLED));
-		//test startTransaction.  It should fail since standby status is hot standby
-		transPass = true;
-		try{
-			im.startTransaction();
-		} catch (Exception e){
-			logger.error("startTransaction exception: ", e);
-			transPass = false;
-		}
-		assertTrue(!transPass); //expect it to fail
-	
-		logger.debug("\n\ntestIM: Exit\n\n");
-	}
-	
-
-	public void testSanityState() throws Exception {
-		logger.debug("\nIntegrityMonitorTest: Entering testSanityState\n\n");
-		cleanDb();
-		cleanMyProp();
-		IntegrityMonitor.deleteInstance();
-		
-		// parameters are passed via a properties file
-		myProp.put(IntegrityMonitorProperties.DEPENDENCY_GROUPS, "group1_dep1,group1_dep2; group2_dep1");
-		// Disable the integrity monitor so it will not interfere
-		myProp.put(IntegrityMonitorProperties.FP_MONITOR_INTERVAL, "-1");
-		// Disable the refresh state audit
-		myProp.put(IntegrityMonitorProperties.REFRESH_STATE_AUDIT_INTERVAL_MS, "-1");
-		// Disable dependency checking so it does not interfere
-		myProp.put(IntegrityMonitorProperties.CHECK_DEPENDENCY_INTERVAL, "-1");
-		// Disable the state audit
-		myProp.put(IntegrityMonitorProperties.STATE_AUDIT_INTERVAL_MS, "-1");
-		// Disable the test transaction
-		myProp.put(IntegrityMonitorProperties.TEST_TRANS_INTERVAL, "-1");
-		// Disable writing the FPC
-		myProp.put(IntegrityMonitorProperties.WRITE_FPC_INTERVAL, "-1");
-		// Max interval for use in deciding if a FPC entry is stale in seconds
-		myProp.put(IntegrityMonitorProperties.MAX_FPC_UPDATE_INTERVAL, "120");
-		
-		IntegrityMonitor im = IntegrityMonitor.getInstance(resourceName, myProp);
-		
-		// Add a group1 dependent resources to put an entry in the forward progress table
-		ForwardProgressEntity fpe = new ForwardProgressEntity();
-		ForwardProgressEntity fpe2 = new ForwardProgressEntity();
-		fpe.setFpcCount(0);
-		fpe.setResourceName("group1_dep1");
-		fpe2.setFpcCount(0);
-		fpe2.setResourceName("group1_dep2");
-		et = em.getTransaction();
-		et.begin();
-		em.persist(fpe);
-		em.persist(fpe2);
-		em.flush();
-		et.commit();
-
-		
-		// Add a group2 dependent resource to the StateManagementEntity DB table and set its admin state to locked
-		// Expect sanity test to fail.
-		StateManagement stateManager = new StateManagement(emf, "group2_dep1");
-		stateManager.lock();
-		
-		new StateManagement(emf, "group1_dep1");
-		new StateManagement(emf, "group1_dep2");
-		
-		boolean sanityPass = true;
-		// Call the dependency check directly instead of waiting for FPManager to do it.
-		logger.debug("\n\nIntegrityMonitor.testSanityState: calling im.dependencyCheck()\n\n");
-		im.dependencyCheck();
-		try {
-			im.evaluateSanity();
-		} catch (Exception e) {
-			logger.error("evaluateSanity exception: ", e);
-			sanityPass = false;
-		}
-		assertFalse(sanityPass);  // expect sanity test to fail
-		
-		logger.debug("\n\ntestSanityState: Exit\n\n");
-	}
-	
-	public void testRefreshStateAudit() throws Exception {
-		logger.debug("\nIntegrityMonitorTest: testRefreshStateAudit Enter\n\n");
-		cleanDb();
-		cleanMyProp();
-		IntegrityMonitor.deleteInstance();
-
-		// parameters are passed via a properties file
-		myProp.put(IntegrityMonitorProperties.DEPENDENCY_GROUPS, "");
-		myProp.put(IntegrityMonitorProperties.TEST_VIA_JMX, "false");
-		// Disable the integrity monitor so it will not interfere
-		myProp.put(IntegrityMonitorProperties.FP_MONITOR_INTERVAL, "-1");
-		// Disable the refresh state audit
-		myProp.put(IntegrityMonitorProperties.REFRESH_STATE_AUDIT_INTERVAL_MS, "-1");
-		// Disable dependency checking so it does not interfere
-		myProp.put(IntegrityMonitorProperties.CHECK_DEPENDENCY_INTERVAL, "-1");
-		// Disable the state audit
-		myProp.put(IntegrityMonitorProperties.STATE_AUDIT_INTERVAL_MS, "-1");
-		// Disable the test transaction
-		myProp.put(IntegrityMonitorProperties.TEST_TRANS_INTERVAL, "-1");
-		// Disable writing the FPC
-		myProp.put(IntegrityMonitorProperties.WRITE_FPC_INTERVAL, "-1");
-		
-		IntegrityMonitor im = IntegrityMonitor.getInstance(resourceName, myProp);
-
-		//the state here is unlocked, enabled, null, null
-		StateManagementEntity sme = null;
-
-		Query query = em.createQuery("Select p from StateManagementEntity p where p.resourceName=:resource");
-
-		query.setParameter("resource", resourceName);
-
-		//Just test that we are retrieving the right object
-		@SuppressWarnings("rawtypes")
-		List resourceList = query.getResultList();
-		if (!resourceList.isEmpty()) {
-			// exist 
-			sme = (StateManagementEntity) resourceList.get(0);
-			em.refresh(sme);
-
-			logger.debug("??? -- Retrieve StateManagementEntity from database --\nsme.getResourceName() = {}\n"+
-						"sme.getAdminState() = {}\nsme.getOpState() = {}\nsme.getAvailStatus() = {}\nsme.getStandbyStatus() = {}",
-							sme.getResourceName(), 
-							sme.getAdminState(),
-							sme.getOpState(),
-							sme.getAvailStatus(),
-							sme.getStandbyStatus());
-
-			assertTrue(sme.getAdminState().equals(StateManagement.UNLOCKED)); 
-			assertTrue(sme.getOpState().equals(StateManagement.ENABLED)); 
-			assertTrue(sme.getAvailStatus().equals(StateManagement.NULL_VALUE)); 
-			assertTrue(sme.getStandbyStatus().equals(StateManagement.NULL_VALUE));
-			logger.debug("--");
-		} else {
-			logger.debug("Record not found, resourceName: " + resourceName);
-			assertTrue(false);
-		}
-
-		et = em.getTransaction();
-		et.begin();
-
-		sme.setStandbyStatus(StateManagement.COLD_STANDBY);
-		em.persist(sme);
-		em.flush();
-		et.commit();
-
-		// Run the refreshStateAudit
-		im.executeRefreshStateAudit();
-
-		//The refreshStateAudit should run and change the state to unlocked,enabled,null,hotstandby
-		StateManagementEntity sme1 = null;
-
-		Query query1 = em.createQuery("Select p from StateManagementEntity p where p.resourceName=:resource");
-
-		query1.setParameter("resource", resourceName);
-
-		@SuppressWarnings("rawtypes")
-		List resourceList1 = query1.getResultList();
-		if (!resourceList1.isEmpty()) {
-			// exist 
-			sme1 = (StateManagementEntity) resourceList1.get(0);
-			em.refresh(sme1);
-			logger.debug("??? -- Retrieve StateManagementEntity from database --\nsme1.getResourceName() = {}\n" +
-							"sme1.getAdminState() = {}\nsme1.getOpState() = {}\nsme1.getAvailStatus() = {}\nsme1.getStandbyStatus() = {}",
-							sme1.getResourceName(), 
-							sme1.getAdminState(),
-							sme1.getOpState(),
-							sme1.getAvailStatus(),
-							sme1.getStandbyStatus());
-
-			assertTrue(sme1.getAdminState().equals(StateManagement.UNLOCKED)); 
-			assertTrue(sme1.getOpState().equals(StateManagement.ENABLED)); 
-			assertTrue(sme1.getAvailStatus().equals(StateManagement.NULL_VALUE)); 
-			assertTrue(sme1.getStandbyStatus().equals(StateManagement.HOT_STANDBY)); 
-			logger.debug("--");
-		} else {
-			logger.debug("Record not found, resourceName: " + resourceName);
-			assertTrue(false);
-		}
-
-		logger.debug("\nIntegrityMonitorTest: testRefreshStateAudit Exit\n\n");
-	}
-	
-	public void testStateCheck() throws Exception {
-		logger.debug("\nIntegrityMonitorTest: Entering testStateCheck\n\n");
-		cleanDb();
-		cleanMyProp();
-		IntegrityMonitor.deleteInstance();
-		
-		// parameters are passed via a properties file
-		myProp.put(IntegrityMonitorProperties.DEPENDENCY_GROUPS, "group1_dep1");
-		myProp.put(IntegrityMonitorProperties.TEST_VIA_JMX, "false");
-		myProp.put(IntegrityMonitorProperties.FAILED_COUNTER_THRESHOLD, "1");
-		/*
-		 *  The monitorInterval is set to 10 and the failedCounterThreshold is 1
-		 *  because stateCheck() uses the faileCounterThreshold * monitorInterval to determine
-		 *  if an entry is stale, it will be stale after 10 seconds.
-		 */
-		myProp.put(IntegrityMonitorProperties.FP_MONITOR_INTERVAL, "5");
-		/* 
-		 * We accelerate the test transaction and write FPC intervals because we don't want
-		 * there to be any chance of a FPC failure because of the short monitor interval
-		 */
-		myProp.put(IntegrityMonitorProperties.TEST_TRANS_INTERVAL, "1");
-		myProp.put(IntegrityMonitorProperties.WRITE_FPC_INTERVAL, "2");
-		// Disable the refresh state audit
-		myProp.put(IntegrityMonitorProperties.REFRESH_STATE_AUDIT_INTERVAL_MS, "-1");
-		// The maximum time in seconds to determine that a FPC entry is stale
-		myProp.put(IntegrityMonitorProperties.MAX_FPC_UPDATE_INTERVAL, "5");
-		myProp.put(IntegrityMonitorProperties.CHECK_DEPENDENCY_INTERVAL, "5");
-		
-		IntegrityMonitor im = IntegrityMonitor.getInstance(resourceName, myProp);
-		
-		// Add a group1 dependent resources to put an entry in the forward progress table
-		// This sets lastUpdated to the current time
-		ForwardProgressEntity fpe = new ForwardProgressEntity();
-		fpe.setFpcCount(0);
-		fpe.setResourceName("group1_dep1");
-		et = em.getTransaction();
-		et.begin();
-		em.persist(fpe);
-		em.flush();
-		et.commit();
-
-		new StateManagement(emf, "group1_dep1");
-		
-		boolean sanityPass = true;
-		//Thread.sleep(15000);
-		//Thread.sleep(5000);
-		try {
-			im.evaluateSanity();
-		} catch (Exception e) {
-			logger.error("testStateCheck: After 5 sec sleep - evaluateSanity exception: ", e);
-			sanityPass = false;
-		}
-		assertTrue(sanityPass);  // expect sanity test to pass
-		
-		//now wait 10 seconds.  The dependency entry  is checked every 10 sec.  So, even in the worst case
-		//it should now be stale and the sanity check should fail
-		
-		sanityPass = true;
-		Thread.sleep(10000);
-		try {
-			im.evaluateSanity();
-		} catch (Exception e) {
-			logger.error("testStateCheck: After 15 sec sleep - evaluateSanity exception: ", e);
-			sanityPass = false;
-		}
-		assertFalse(sanityPass);  // expect sanity test to fail
-		
-		logger.debug("\n\ntestStateCheck: Exit\n\n");
-	}
-	
-	public void testGetAllForwardProgressEntity() throws Exception{
-		logger.debug("\nIntegrityMonitorTest: Entering testGetAllForwardProgressEntity\n\n");
-		cleanDb();
-		cleanMyProp();
-		IntegrityMonitor.deleteInstance();
-		// parameters are passed via a properties file
-		myProp.put(IntegrityMonitorProperties.DEPENDENCY_GROUPS, "");
-		myProp.put(IntegrityMonitorProperties.TEST_VIA_JMX, "false");
-		// Disable the integrity monitor so it will not interfere
-		myProp.put(IntegrityMonitorProperties.FP_MONITOR_INTERVAL, "-1");
-		// Disable the refresh state audit
-		myProp.put(IntegrityMonitorProperties.REFRESH_STATE_AUDIT_INTERVAL_MS, "-1");
-		// Disable dependency checking so it does not interfere
-		myProp.put(IntegrityMonitorProperties.CHECK_DEPENDENCY_INTERVAL, "-1");
-		// Disable the state audit
-		myProp.put(IntegrityMonitorProperties.STATE_AUDIT_INTERVAL_MS, "-1");
-		// Disable the test transaction
-		myProp.put(IntegrityMonitorProperties.TEST_TRANS_INTERVAL, "-1");
-		// Disable writing the FPC
-		myProp.put(IntegrityMonitorProperties.WRITE_FPC_INTERVAL, "-1");
-		
-		IntegrityMonitor im = IntegrityMonitor.getInstance(resourceName, myProp);
-		
-		logger.debug("\nIntegrityMonitorTest: Creating ForwardProgressEntity entries\n\n");
-		// Add resource entries in the forward progress table
-		ForwardProgressEntity fpe = new ForwardProgressEntity();
-		ForwardProgressEntity fpe2 = new ForwardProgressEntity();
-		ForwardProgressEntity fpe3 = new ForwardProgressEntity();
-		fpe.setFpcCount(0);
-		fpe.setResourceName("siteA_pap2");
-		fpe2.setFpcCount(0);
-		fpe2.setResourceName("siteB_pap1");
-		fpe3.setFpcCount(0);
-		fpe3.setResourceName("siteB_pap2");
-		et = em.getTransaction();
-		et.begin();
-		em.persist(fpe);
-		em.persist(fpe2);
-		em.persist(fpe3);
-		em.flush();
-		et.commit();
-
-		logger.debug("\nIntegrityMonitorTest:testGetAllForwardProgressEntity Calling im.getAllForwardProgressEntity()\n\n");
-		List<ForwardProgressEntity> fpeList = im.getAllForwardProgressEntity();
-		
-		assertTrue(fpeList.size()==4);
-		
-		logger.debug("\nIntegrityMonitorTest: Exit testGetAllForwardProgressEntity\n\n");
-	}
-	
-	public void testStateAudit() throws Exception{
-		logger.debug("\nIntegrityMonitorTest: Entering testStateAudit\n\n");
-		cleanDb();
-		cleanMyProp();
-		IntegrityMonitor.deleteInstance();
-		
-		// parameters are passed via a properties file
-
-		// No Dependency Groups
-		myProp.put(IntegrityMonitorProperties.DEPENDENCY_GROUPS, "");
-		// Don't use JMX
-		myProp.put(IntegrityMonitorProperties.TEST_VIA_JMX, "false");
-		// Disable the internal sanity monitoring.
-		myProp.put(IntegrityMonitorProperties.FP_MONITOR_INTERVAL, "-1");
-		// Disable the dependency monitoring.
-		myProp.put(IntegrityMonitorProperties.CHECK_DEPENDENCY_INTERVAL, "-1");
-		// Disable the refresh state audit
-		myProp.put(IntegrityMonitorProperties.REFRESH_STATE_AUDIT_INTERVAL_MS, "-1");
-		// Disable the test transaction
-		myProp.put(IntegrityMonitorProperties.TEST_TRANS_INTERVAL, "-1");
-		// Disable the write FPC
-		myProp.put(IntegrityMonitorProperties.WRITE_FPC_INTERVAL, "-1");
-		// Disable the State Audit we will call it directly
-		myProp.put(IntegrityMonitorProperties.STATE_AUDIT_INTERVAL_MS, "-1");
-		// Max interval for use in deciding if a FPC entry is stale in seconds
-		myProp.put(IntegrityMonitorProperties.MAX_FPC_UPDATE_INTERVAL, "120");
-
-		
-		IntegrityMonitor im = IntegrityMonitor.getInstance(resourceName, myProp);
-		logger.debug("\nIntegrityMonitorTest: Creating ForwardProgressEntity entries\n\n");
-		// Add resources to put an entry in the forward progress table
-		Date staleDate = new Date(0);
-		ForwardProgressEntity fpe1 = new ForwardProgressEntity();
-		ForwardProgressEntity fpe2 = new ForwardProgressEntity();
-		ForwardProgressEntity fpe3 = new ForwardProgressEntity();
-		fpe1.setFpcCount(0);
-		fpe1.setResourceName("siteA_pap2");
-		fpe2.setFpcCount(0);
-		fpe2.setResourceName("siteB_pap1");
-		fpe3.setFpcCount(0);
-		fpe3.setResourceName("siteB_pap2");
-		logger.debug("\nIntegrityMonitorTest: Creating StateManagementEntity entries\n\n");
-		StateManagementEntity sme1 = new StateManagementEntity();
-		StateManagementEntity sme2 = new StateManagementEntity();
-		StateManagementEntity sme3= new StateManagementEntity();
-		sme1.setResourceName("siteA_pap2");
-		sme1.setAdminState(StateManagement.UNLOCKED);
-		sme1.setOpState(StateManagement.ENABLED);
-		sme1.setAvailStatus(StateManagement.NULL_VALUE);
-		sme1.setStandbyStatus(StateManagement.NULL_VALUE);
-		sme2.setResourceName("siteB_pap1");
-		sme2.setAdminState(StateManagement.UNLOCKED);
-		sme2.setOpState(StateManagement.ENABLED);
-		sme2.setAvailStatus(StateManagement.NULL_VALUE);
-		sme2.setStandbyStatus(StateManagement.NULL_VALUE);
-		sme3.setResourceName("siteB_pap2");
-		sme3.setAdminState(StateManagement.UNLOCKED);
-		sme3.setOpState(StateManagement.ENABLED);
-		sme3.setAvailStatus(StateManagement.NULL_VALUE);
-		sme3.setStandbyStatus(StateManagement.NULL_VALUE);
-		et = em.getTransaction();
-		et.begin();
-		em.persist(fpe1);
-		em.persist(fpe2);
-		em.persist(fpe3);
-		em.persist(sme1);
-		em.persist(sme2);
-		em.persist(sme3);
-		em.flush();
-		et.commit();
-		
-		Query updateQuery = em.createQuery("UPDATE ForwardProgressEntity f "
-				+ "SET f.lastUpdated = :newDate "
-				+ "WHERE f.resourceName=:resource");
-		updateQuery.setParameter("newDate", staleDate, TemporalType.TIMESTAMP);
-		updateQuery.setParameter("resource", fpe1.getResourceName());
-		
-		et = em.getTransaction();
-		et.begin();
-		updateQuery.executeUpdate();
-		et.commit();
-		
-		logger.debug("\nIntegrityMonitorTest:testStateAudit Calling im.getAllForwardProgressEntity()\n\n");
-		List<ForwardProgressEntity> fpeList = im.getAllForwardProgressEntity();
-		
-		logger.debug("\n\n");
-		logger.debug("IntegrityMonitorTest:testStateAudit:ForwardProgressEntity entries");
-		for(ForwardProgressEntity myFpe : fpeList){
-			logger.debug("\n    ResourceName: {}" + 
-						 "\n        LastUpdated: {}",
-						 myFpe.getResourceName(),
-						 myFpe.getLastUpdated());
-		}
-		logger.debug("\n\n");
-		
-		logger.debug("\nIntegrityMonitorTest:testStateAudit getting list of StateManagementEntity entries\n\n");
-		Query query = em.createQuery("SELECT s FROM StateManagementEntity s");
-		List<?> smeList = query.getResultList();
-		
-		logger.debug("\n\n");
-		logger.debug("IntegrityMonitorTest:testStateAudit:StateManagementEntity entries");
-		for(Object mySme : smeList){
-			StateManagementEntity tmpSme = (StateManagementEntity) mySme;
-			em.refresh(tmpSme);
-			logger.debug("\n    ResourceName: {}" + 
-					 "\n        AdminState: {}" + 
-					 "\n        OpState: {}" + 
-					 "\n        AvailStatus: {}" + 
-					 "\n        StandbyStatus: {}",
-					 tmpSme.getResourceName(),
-					 tmpSme.getAdminState(),
-					 tmpSme.getOpState(),
-					 tmpSme.getAvailStatus(),
-					 tmpSme.getStandbyStatus()
-					);
-		}
-		logger.debug("\n\n");
-		
-		em.refresh(sme1);
-		assertTrue(sme1.getOpState().equals(StateManagement.ENABLED));
-		
-		logger.debug("IntegrityMonitorTest:testStateAudit: calling stateAudit()");
-		im.executeStateAudit();
-		logger.debug("IntegrityMonitorTest:testStateAudit: call to stateAudit() complete");
-		
-		logger.debug("\nIntegrityMonitorTest:testStateAudit getting list of StateManagementEntity entries\n\n");
-		smeList = query.getResultList();
-		
-		logger.debug("\n\n");
-		logger.debug("IntegrityMonitorTest:testStateAudit:StateManagementEntity entries");
-		for(Object mySme : smeList){
-			StateManagementEntity tmpSme = (StateManagementEntity) mySme;
-			em.refresh(tmpSme);
-			logger.debug("\n    ResourceName: {}" + 
-					 "\n        AdminState: {}" + 
-					 "\n        OpState: {}" + 
-					 "\n        AvailStatus: {}" + 
-					 "\n        StandbyStatus: {}",
-					 tmpSme.getResourceName(),
-					 tmpSme.getAdminState(),
-					 tmpSme.getOpState(),
-					 tmpSme.getAvailStatus(),
-					 tmpSme.getStandbyStatus()
-					);
-		}
-		logger.debug("\n\n");
-		
-		em.refresh(sme1);
-		assertTrue(sme1.getOpState().equals(StateManagement.DISABLED));
-		
-		//Now let's add sme2 to the mix
-		updateQuery = em.createQuery("UPDATE ForwardProgressEntity f "
-				+ "SET f.lastUpdated = :newDate "
-				+ "WHERE f.resourceName=:resource");
-		updateQuery.setParameter("newDate", staleDate, TemporalType.TIMESTAMP);
-		updateQuery.setParameter("resource", fpe2.getResourceName());
-		
-		et = em.getTransaction();
-		et.begin();
-		updateQuery.executeUpdate();
-		et.commit();
-		
-		//Give it a chance to write the DB and run the audit
-		logger.debug("IntegrityMonitorTest:testStateAudit: (restart4) Running State Audit");
-		Thread.sleep(2000);
-		im.executeStateAudit();
-		Thread.sleep(1000);
-		logger.debug("IntegrityMonitorTest:testStateAudit: (restart4) State Audit complete");
-		
-		//Now check its state
-		logger.debug("\nIntegrityMonitorTest:testStateAudit (restart4) getting list of StateManagementEntity entries\n\n");
-		smeList = query.getResultList();
-		
-		logger.debug("\n\n");
-		logger.debug("IntegrityMonitorTest:testStateAudit:StateManagementEntity (restart4) entries");
-		for(Object mySme : smeList){
-			StateManagementEntity tmpSme = (StateManagementEntity) mySme;
-			em.refresh(tmpSme);
-
-			logger.debug("\n    (restart4) ResourceName: {}" + 
-					 "\n        AdminState: {}" + 
-					 "\n        OpState: {}" + 
-					 "\n        AvailStatus: {}" + 
-					 "\n        StandbyStatus: {}",
-					 tmpSme.getResourceName(),
-					 tmpSme.getAdminState(),
-					 tmpSme.getOpState(),
-					 tmpSme.getAvailStatus(),
-					 tmpSme.getStandbyStatus()
-					);
-		}
-		logger.debug("\n\n");
-		
-		em.refresh(sme1);
-		assertTrue(sme1.getOpState().equals(StateManagement.DISABLED));
-		
-		em.refresh(sme2);
-		assertTrue(sme2.getOpState().equals(StateManagement.DISABLED));
-		
-		logger.debug("\nIntegrityMonitorTest: Exit testStateAudit\n\n");
-		System.out.println("\n\ntestStateAudit: Exit\n\n");
-	}
-}
diff --git a/integrity-monitor/src/test/java/org/onap/policy/common/im/test/StateManagementEntityTest.java b/integrity-monitor/src/test/java/org/onap/policy/common/im/test/StateManagementEntityTest.java
deleted file mode 100644
index 852a04f..0000000
--- a/integrity-monitor/src/test/java/org/onap/policy/common/im/test/StateManagementEntityTest.java
+++ /dev/null
@@ -1,193 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * Integrity Monitor
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.policy.common.im.test;
-
-import java.util.List;
-import java.util.Properties;
-
-import javax.persistence.EntityManager;
-import javax.persistence.EntityManagerFactory;
-import javax.persistence.EntityTransaction;
-import javax.persistence.Persistence;
-import javax.persistence.Query;
-
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-import org.onap.policy.common.im.StateManagement;
-import org.onap.policy.common.im.jpa.StateManagementEntity;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class StateManagementEntityTest {
-	private static Logger logger = LoggerFactory.getLogger(StateManagementEntityTest.class);
-	
-	private static final String DEFAULT_DB_DRIVER = "org.h2.Driver";
-	private static final String DEFAULT_DB_URL = "jdbc:h2:file:./sql/smTest";
-	//private static final String DEFAULT_DB_URL = "jdbc:h2:file:./sql/xacml";
-	private static final String DEFAULT_DB_USER = "sa";
-	private static final String DEFAULT_DB_PWD = "";
-
-	/*
-	private static final String DEFAULT_DB_DRIVER = "org.mariadb.jdbc.Driver";
-	private static final String DEFAULT_DB_URL    = "jdbc:mariadb://localhost:3306/xacml";
-	private static final String DEFAULT_DB_USER   = "policy_user";
-	private static final String DEFAULT_DB_PWD    = "policy_user";
-	*/
-
-	private static final String DB_DRIVER         = "javax.persistence.jdbc.driver";
-	private static final String DB_URL            = "javax.persistence.jdbc.url";
-	private static final String DB_USER           = "javax.persistence.jdbc.user";
-	private static final String DB_PWD            = "javax.persistence.jdbc.password";
-	  
-	@BeforeClass
-	public static void setUpClass() throws Exception {
-
-	}
-
-	@AfterClass
-	public static void tearDownClass() throws Exception {
-	}
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	//@Ignore
-	@Test
-	public void testJPA() throws Exception {
-		logger.debug("\n??? logger.infor StateManagementEntityTest: Entering\n\n");
-		
-		Properties myProp = new Properties();
-		myProp.put(DB_DRIVER, DEFAULT_DB_DRIVER);
-		myProp.put(DB_URL,    DEFAULT_DB_URL);
-		myProp.put(DB_USER,   DEFAULT_DB_USER);
-		myProp.put(DB_PWD,    DEFAULT_DB_PWD);
-		
-		logger.debug("??? {} = {}", DB_DRIVER, DEFAULT_DB_DRIVER); 
-		logger.debug("??? {} = {}",  DB_URL, DEFAULT_DB_URL); 
-		logger.debug("??? {} = {}",  DB_USER, DEFAULT_DB_USER); 
-		logger.debug("??? {} = {}",  DB_PWD, DEFAULT_DB_PWD); 
-		
-		//Create the data schema and entity manager factory
-		logger.debug("??? createEntityManagerFactory for schemaPU"); 
-		EntityManagerFactory emf = Persistence.createEntityManagerFactory("schemaPU", myProp);
-
-		// Create an entity manager to use the DB
-		logger.debug("??? createEntityManager");
-		EntityManager em = emf.createEntityManager();
-		logger.debug("??? getTransaction");
-		EntityTransaction et = em.getTransaction();
-		et.begin();
-		// Make sure the DB is clean
-		logger.debug("??? clean StateManagementEntity");
-		em.createQuery("DELETE FROM StateManagementEntity").executeUpdate();
-
-		//Define the resourceName for the StateManagement constructor
-		String resourceName = "test_resource1";
-		
-		//
-		logger.debug("Create StateManagementEntity, resourceName: {}", resourceName);
-		logger.debug("??? instantiate StateManagementEntity object");
-		StateManagementEntity sme = new StateManagementEntity(); 
-		
-		logger.debug("??? setResourceName : {}", resourceName);
-		sme.setResourceName(resourceName);
-		logger.debug("??? getResourceName : {}", sme.getResourceName());
-
-		logger.debug("??? setAdminState   : {}", StateManagement.UNLOCKED);
-		sme.setAdminState(StateManagement.UNLOCKED); 
-		logger.debug("??? getAdminState   : {}", sme.getAdminState());
-		
-		logger.debug("??? setOpState      : {}", StateManagement.ENABLED);
-		sme.setOpState(StateManagement.ENABLED);
-		logger.debug("??? getOpState      : {}", sme.getOpState());
-		
-		logger.debug("??? setAvailStatus   : {}", StateManagement.NULL_VALUE);
-		sme.setAvailStatus(StateManagement.NULL_VALUE);
-		logger.debug("??? getAvailStatus   : {}", sme.getAvailStatus());
-		
-		logger.debug("??? setStandbyStatus: {}", StateManagement.COLD_STANDBY);
-		sme.setStandbyStatus(StateManagement.COLD_STANDBY);
-		logger.debug("??? getStandbyStatus: {}", sme.getStandbyStatus());
-		
-		logger.debug("??? before persist");
-		em.persist(sme); 
-		logger.debug("??? after  persist");
-		
-		em.flush(); 
-		logger.debug("??? after flush");
-
-		et.commit(); 
-		logger.debug("??? after commit");
-		
-		try {
-	        Query query = em.createQuery("Select p from StateManagementEntity p where p.resourceName=:resource");
-	       
-	        query.setParameter("resource", resourceName);
-	       
-	        //Just test that we are retrieving the right object
-	        @SuppressWarnings("rawtypes")
-	        List resourceList = query.getResultList();
-	        if (!resourceList.isEmpty()) {
-	           // exist 
-	           StateManagementEntity sme2 = (StateManagementEntity) resourceList.get(0);
-	       	   logger.debug("??? -- Retrieve StateManagementEntity from database --\n\nsme.getResourceName() = {}\n" + 
-	       			   			"sme2getResourceName() = {}\n\nsme.getAdminState() = {}\nsme2.getAdminState() = {}\n\n" + 
-	       			   			"sme.getOpState() = {}\nsme2.getOpState() = {}\n\nsme.getAvailStatus() = {}\n" +
-	       			   			"sme2.getAvailStatus() = {}\n\nsme.getStandbyStatus() = {}\nsme2.getStandbyStatus() = {}",
-	       			   			sme.getResourceName(), 
-	       			   			sme2.getResourceName(), 
-	       			   			sme.getAdminState(),
-	       			   			sme2.getAdminState(),
-	       			   			sme.getOpState(),
-	       			   			sme2.getOpState(),
-	       			   			sme.getAvailStatus(),
-	       			   			sme.getAvailStatus(),
-	       			   			sme.getStandbyStatus(),
-	       			   			sme2.getStandbyStatus());
-	       	   		
-	       	   
-	       	   assert(sme2.getResourceName().equals(sme.getResourceName())); 
-	       	   assert(sme2.getAdminState().equals(sme.getAdminState())); 
-	       	   assert(sme2.getOpState().equals(sme.getOpState())); 
-	       	   assert(sme2.getAvailStatus().equals(sme.getAvailStatus())); 
-	       	   assert(sme2.getStandbyStatus().equals(sme.getStandbyStatus())); 
-			   logger.debug("--");
-	        } else {
-	           logger.debug("Record not found, resourceName: {}", resourceName);
-	        }
-		  } catch(Exception ex) {
-			logger.error("Exception on select query: " + ex.toString());
-	    }
-		
-		em.close(); 
-		logger.debug("\n??? after close");
-		logger.debug("\n\nJpaTest: Exit\n\n");
-	}
-}
diff --git a/integrity-monitor/src/test/java/org/onap/policy/common/im/test/StateManagementTest.java b/integrity-monitor/src/test/java/org/onap/policy/common/im/test/StateManagementTest.java
deleted file mode 100644
index a3c0fcd..0000000
--- a/integrity-monitor/src/test/java/org/onap/policy/common/im/test/StateManagementTest.java
+++ /dev/null
@@ -1,315 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * Integrity Monitor
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.policy.common.im.test;
-
-import java.util.Properties;
-import javax.persistence.EntityManagerFactory;
-import javax.persistence.Persistence;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.onap.policy.common.im.StateManagement;
-import org.onap.policy.common.im.StandbyStatusException; 
-import org.onap.policy.common.im.StateChangeNotifier; 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/*
- * All JUnits are designed to run in the local development environment
- * where they have write privileges and can execute time-sensitive
- * tasks.
- */
-public class StateManagementTest {
-	private static Logger logger = LoggerFactory.getLogger(StateManagementTest.class);
-	
-	private static final String DEFAULT_DB_DRIVER = "org.h2.Driver";
-	private static final String DEFAULT_DB_URL    = "jdbc:h2:file:./sql/smTest";
-	private static final String DEFAULT_DB_USER   = "sa";
-	private static final String DEFAULT_DB_PWD    = "";
-
-	private static final String DB_DRIVER         = "javax.persistence.jdbc.driver";
-	private static final String DB_URL            = "javax.persistence.jdbc.url";
-	private static final String DB_USER           = "javax.persistence.jdbc.user";
-	private static final String DB_PWD            = "javax.persistence.jdbc.password";
-	// 
-	  
-	@BeforeClass
-	public static void setUpClass() throws Exception {
-
-	}
-
-	@AfterClass
-	public static void tearDownClass() throws Exception {
-	}
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	//@Ignore
-	@Test
-	public void testJPA() throws Exception {
-		logger.info("\n\nlogger.infor StateManagementTest: Entering\n\n");
-		String resourceName = "test_resource1"; 
-		boolean standbyExceptionThrown = false; 
-		
-		//These parameters are in a properties file
-		EntityManagerFactory emf = null; 
-		try {
-		    Properties myProp = new Properties();
-		    myProp.put(DB_DRIVER, DEFAULT_DB_DRIVER);
-		    myProp.put(DB_URL,    DEFAULT_DB_URL);
-		    myProp.put(DB_USER,   DEFAULT_DB_USER);
-		    myProp.put(DB_PWD,    DEFAULT_DB_PWD);
-		
-		    //Create the data schema and entity manager factory
-		    emf = Persistence.createEntityManagerFactory("schemaPU", myProp);
-
-		    StateManagement sm = new StateManagement(emf, resourceName);
-		    logger.info("\n\ntest lock()");
-		    displayState(resourceName, sm);
-		    logger.info("\n??? test lock()");
-		    logger.info("{} before adminState   = {}", resourceName, sm.getAdminState()); 
-		    logger.info("{} before opState      = {}", resourceName, sm.getOpState()); 
-		   	logger.info("{} before availStatus  = {}", resourceName, sm.getAvailStatus()); 
-		   	logger.info("{} before standbyStatus= {}", resourceName, sm.getStandbyStatus()); 
-		    sm.lock(); 
-		    System.out.println("\n\nafter lock()");
-		    displayState(resourceName, sm);		    
-		    logger.info("{} after  adminState   = {}", resourceName, sm.getAdminState()); 
-		    logger.info("{} after  opState      = {}", resourceName, sm.getOpState()); 
-		   	logger.info("{} after  availStatus  = {}", resourceName, sm.getAvailStatus()); 
-		   	logger.info("{} after  standbyStatus= {}", resourceName, sm.getStandbyStatus()); 
-		   	 
-		    logger.info("\n??? test unlock()");
-		    sm.unlock(); 
-		    System.out.println("\n\nafter unlock()");
-		    displayState(resourceName, sm);		
-		    logger.info("{} adminState   = {}", resourceName, sm.getAdminState()); 
-		    logger.info("{} opState      = {}", resourceName, sm.getOpState()); 
-		   	logger.info("{} availStatus  = {}", resourceName, sm.getAvailStatus()); 
-		   	logger.info("{} standbyStatus= {}", resourceName, sm.getStandbyStatus()); 
-		   	
-		    logger.info("\n??? test enableNotFailed()");
-		    sm.enableNotFailed(); 
-		    System.out.println("\n\nafter enableNotFailed()");
-		    displayState(resourceName, sm);		
-		    logger.info("{} adminState   = {}", resourceName, sm.getAdminState()); 
-		    logger.info("{} opState      = {}", resourceName, sm.getOpState()); 
-		   	logger.info("{} availStatus  = {}", resourceName, sm.getAvailStatus()); 
-		   	logger.info("{} standbyStatus= {}", resourceName, sm.getStandbyStatus()); 
-		    
-		    logger.info("\n??? test disableFailed()");
-		    sm.disableFailed();
-		    System.out.println("\n\nafter disableFailed()");
-		    displayState(resourceName, sm);		
-		    logger.info("{} adminState   = {}", resourceName, sm.getAdminState()); 
-		    logger.info("{} opState      = {}", resourceName, sm.getOpState()); 
-		   	logger.info("{} availStatus  = {}", resourceName, sm.getAvailStatus()); 
-		   	logger.info("{} standbyStatus= {}", resourceName, sm.getStandbyStatus()); 
-		   	
-		    // P4 If promote() is called while either the opState is disabled or the adminState is locked,  
-		    // the standbystatus shall transition to coldstandby and a StandbyStatusException shall be thrown
-		    logger.info("\n??? promote() test case P4");
-		   	try {
-		    	sm.disableFailed(); 
-		    	sm.lock();
-			    System.out.println("\n\nafter lock() and disableFailed");
-			    displayState(resourceName, sm);		
-			    logger.info("{} adminState   = {}", resourceName, sm.getAdminState()); 
-			    logger.info("{} opState      = {}", resourceName, sm.getOpState());
-			   	logger.info("{} standbyStatus= {}", resourceName, sm.getStandbyStatus()); 
-			   	sm.promote(); 
-			    System.out.println("\n\nafter promote");
-			    displayState(resourceName, sm);		
-		    } catch(StandbyStatusException ex) {
-		    	standbyExceptionThrown = true; 
-		    	logger.info("StandbyStatusException thrown and catched");
-		    } catch(Exception ex) {
-		    	logger.info("??? Exception: " + ex.toString());
-		    }
-		   	assert(standbyExceptionThrown); 
-	    	assert(sm.getStandbyStatus().equals(StateManagement.COLD_STANDBY)); 
-	    	standbyExceptionThrown = false; 
-		    
-		   	// P3 If promote() is called while standbyStatus is coldstandby, the state shall not transition 
-		    //    and a StandbyStatusException shall be thrown
-		    logger.info("\n??? promote() test case P3");
-		    try {
-			   	logger.info(resourceName + " standbyStatus= " + sm.getStandbyStatus()); 		    	
-		    	sm.promote(); 
-		    } catch(StandbyStatusException ex) {
-		    	standbyExceptionThrown = true; 
-		    	logger.info("StandbyStatusException thrown and catched");
-		    } catch(Exception ex) {
-		    	logger.info("??? Exception: " + ex.toString());
-		    }	
-		   	assert(standbyExceptionThrown); 
-	    	assert(sm.getStandbyStatus().equals(StateManagement.COLD_STANDBY)); 
-		    logger.info("\n\nP3 after promote()");
-		    displayState(resourceName, sm);	
-	    	standbyExceptionThrown = false; 		    
-		    
-		    // P2 If promote() is called while the standbyStatus is null and the opState is enabled and adminState is unlocked, 
-		    //    the state shall transition to providingservice
-		    logger.info("\n??? promote() test case P2");
-		    resourceName = "test_resource2"; 
-		    StateManagement sm2 = new StateManagement(emf, resourceName);
-		    sm2.enableNotFailed();
-		    sm2.unlock(); 
-		    logger.info("\n\nafter sm2.enableNotFailed() and sm2.unlock()");
-		    displayState(resourceName, sm2);	
-		    logger.info("{} adminState   = {}", resourceName, sm2.getAdminState()); 
-		    logger.info("{} opState      = {}", resourceName, sm2.getOpState());
-		   	logger.info("{} standbyStatus= {}", resourceName, sm2.getStandbyStatus()); 	    
-		    sm2.promote(); 
-		    logger.info("\n\nP2 after sm2.promote");
-		    displayState(resourceName, sm2);	
-		    assert(sm2.getAdminState().equals(StateManagement.UNLOCKED)); 
-		    assert(sm2.getOpState().equals(StateManagement.ENABLED)); 
-		    assert(sm2.getStandbyStatus().equals(StateManagement.PROVIDING_SERVICE));
-		    
-		    // P5 If promote() is called while standbyStatus is providingservice, no action is taken
-		    logger.info("\n??? promote() test case P5");
-		   	logger.info(resourceName + " standbyStatus= " + sm2.getStandbyStatus()); 
-		    sm2.promote();  
-		    logger.info("\n\nP5 after sm2.promote()");
-		    displayState(resourceName, sm2);	
-		    assert(sm2.getStandbyStatus().equals(StateManagement.PROVIDING_SERVICE));
-		    
-		    // D1 If demote() is called while standbyStatus is providingservice, the state shall transition to hotstandby
-		    logger.info("\n??? demote() test case D1");
-		    logger.info(resourceName + " standbyStatus= " + sm2.getStandbyStatus()); 
-		    sm2.demote(); 
-		    logger.info("\n\nD1 after sm2.demote()");
-		    displayState(resourceName, sm2);	
-		    assert(sm2.getStandbyStatus().equals(StateManagement.HOT_STANDBY));
-		    
-		    // D4 If demote() is called while standbyStatus is hotstandby, no action is taken
-		    logger.info("\n??? demote() test case D4");
-		    logger.info(resourceName + " standbyStatus= " + sm2.getStandbyStatus()); 
-		    sm2.demote(); 
-		    logger.info("\n\nD4 after sm2.demote()");
-		    displayState(resourceName, sm2);	
-		    assert(sm2.getStandbyStatus().equals(StateManagement.HOT_STANDBY));
-		    
-		    // D3 If demote() is called while standbyStatus is null and adminState is locked or opState is disabled, 
-		    //    the state shall transition to coldstandby
-		    logger.info("\n??? demote() test case D3"); 
-		    resourceName = "test_resource3"; 
-		    StateManagement sm3 = new StateManagement(emf, resourceName);
-		    sm3.lock(); 
-		    sm3.disableFailed(); 
-		    logger.info("\n\nD3 after sm3.lock() and sm3.disableFailed()");
-		    displayState(resourceName, sm3);	
-		    logger.info("{} adminState   = {}", resourceName, sm3.getAdminState()); 
-		    logger.info("{} opState      = {}", resourceName, sm3.getOpState());
-		   	logger.info("{} standbyStatus= {}", resourceName, sm3.getStandbyStatus()); 		    
-		    sm3.demote(); 
-		    logger.info("\n\nD3 after sm3.demote()");
-		    displayState(resourceName, sm3);	
-		    assert(sm3.getStandbyStatus().equals(StateManagement.COLD_STANDBY));
-		    
-		    // D5 If demote() is called while standbyStatus is coldstandby, no action is taken
-		    logger.info("\n??? demote() test case D5");	
-		    logger.info(resourceName + " standbyStatus= " + sm3.getStandbyStatus()); 
-		    sm3.demote(); 
-		    logger.info("\n\nD5 after sm3.demote()");
-		    displayState(resourceName, sm3);	
-		    assert(sm3.getStandbyStatus().equals(StateManagement.COLD_STANDBY));		    
-		    
-		    // D2 If demote() is called while standbyStatus is null and adminState is unlocked and opState is enabled, 
-		    //    the state shall transition to hotstandby
-		    logger.info("\n??? demote() test case D2");
-		    resourceName = "test_resource4"; 
-		    StateManagement sm4 = new StateManagement(emf, resourceName);
-		    sm4.unlock(); 
-		    sm4.enableNotFailed(); 
-		    logger.info("\n\nD2 after sm4.unlock() and sm4.enableNotFailed()");
-		    displayState(resourceName, sm4);	
-		    logger.info("{} adminState   = {}", resourceName, sm4.getAdminState()); 
-		    logger.info("{} opState      = {}", resourceName, sm4.getOpState());
-		   	logger.info("{} standbyStatus= {}", resourceName, sm4.getStandbyStatus());
-		    sm4.demote(); 
-		    assert(sm4.getStandbyStatus().equals(StateManagement.HOT_STANDBY));
-		    
-		    // P1 If promote() is called while standbyStatus is hotstandby, the state shall transition to providingservice.
-		    logger.info("\n??? promote() test case P1");
-		    logger.info(resourceName + " standbyStatus= " + sm4.getStandbyStatus()); 
-		    sm4.promote(); 
-		    logger.info("\n\nP1 after sm4.promote()");
-		    displayState(resourceName, sm4);	
-		    assert(sm4.getStandbyStatus().equals(StateManagement.PROVIDING_SERVICE));
-		    
-		    // State change notification
-		    logger.info("\n??? State change notification test case 1 - lock()");
-		    StateChangeNotifier stateChangeNotifier = new StateChangeNotifier(); 
-		    sm.addObserver(stateChangeNotifier); 
-		    sm.lock(); 
-		    
-		    logger.info("\n??? State change notification test case 2 - unlock()");
-		    sm.unlock(); 
-		    
-		    logger.info("\n??? State change notification test case 3 - enabled()");
-		    sm.enableNotFailed(); 
-		    
-		    logger.info("\n??? State change notification test case 4 - disableFailed()");
-		    sm.disableFailed(); 
-
-		    logger.info("\n??? State change notification test case 5 - demote()");
-		    sm.demote(); 
-
-	        logger.info("\n??? State change notification test case 6 - promote()");
-		    try {
-		      sm.promote(); 
-		    } catch(Exception ex) {
-		    	logger.info("Exception from promote(): {}", ex.toString());
-		    }
- 
-		   	if (emf.isOpen()) {
-		   		emf.close(); 
-		   	}
-		} catch(Exception ex) {
-			logger.error("Exception: {}", ex.toString());
-		} finally {
-			if (emf.isOpen()) {
-			    emf.close(); 
-			}
-		}
-
-	    logger.info("\n\nStateManagementTest: Exit\n\n");
-	}
-	
-	private void displayState(String resourceName, StateManagement sm) 
-	{
-		logger.info("{} adminState   = {}", resourceName, sm.getAdminState()); 
-	    logger.info("{} opState      = {}", resourceName, sm.getOpState()); 
-	   	logger.info("{} availStatus  = {}", resourceName, sm.getAvailStatus()); 
-	   	logger.info("{} standbyStatus= {}", resourceName, sm.getStandbyStatus()); 
-	}
-}
-
