diff --git a/policy-persistence/src/test/java/org/openecomp/policy/drools/controller/test/IntegrityAuditIntegrationTest.java b/policy-persistence/src/test/java/org/openecomp/policy/drools/controller/test/IntegrityAuditIntegrationTest.java
new file mode 100644
index 0000000..6b65473
--- /dev/null
+++ b/policy-persistence/src/test/java/org/openecomp/policy/drools/controller/test/IntegrityAuditIntegrationTest.java
@@ -0,0 +1,279 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * policy-persistence
+ * ================================================================================
+ * 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.openecomp.policy.drools.controller.test;
+
+import static org.junit.Assert.assertTrue;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.util.Date;
+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.openecomp.policy.common.logging.eelf.PolicyLogger;
+import org.openecomp.policy.common.ia.IntegrityAudit;
+import org.openecomp.policy.common.im.AdministrativeStateException;
+import org.openecomp.policy.common.im.IntegrityMonitor;
+import org.openecomp.policy.common.im.StandbyStatusException;
+import org.openecomp.policy.common.im.StateManagement;
+import org.openecomp.policy.drools.core.DroolsPDPIntegrityMonitor;
+import org.openecomp.policy.drools.core.IntegrityMonitorProperties;
+import org.openecomp.policy.drools.core.PolicyContainer;
+import org.openecomp.policy.drools.im.PMStandbyStateChangeNotifier;
+import org.openecomp.policy.drools.persistence.DroolsPdpEntity;
+import org.openecomp.policy.drools.persistence.DroolsPdpImpl;
+import org.openecomp.policy.drools.persistence.DroolsPdpsConnector;
+import org.openecomp.policy.drools.persistence.JpaDroolsPdpsConnector;
+import org.openecomp.policy.drools.persistence.DroolsPersistenceProperties;
+import org.openecomp.policy.drools.persistence.PersistenceFeature;
+import org.openecomp.policy.drools.persistence.XacmlPersistenceProperties;
+import org.openecomp.policy.drools.system.Main;
+import org.openecomp.policy.drools.system.PolicyEngine;
+
+/*
+ * Cloned from StandbyStateManagement.java in support of US673632.
+ * See MultiSite_v1-10.ppt, slide 38
+ */
+public class IntegrityAuditIntegrationTest {
+		
+	
+	public static final String INTEGRITY_MONITOR_PROPERTIES_FILE="src/test/server/config/IntegrityMonitor.properties";
+
+	/*
+	 * Currently, the DroolsPdpsElectionHandler.DesignationWaiter is invoked every ten seconds, starting 
+	 * at ten seconds after the minute boundary (e.g. 13:05:10). So, an 80 second sleep should be 
+	 * sufficient to ensure that we wait for the DesignationWaiter to do its job, before 
+	 * checking the results. 
+	 */
+	private long sleepTime = 80000;
+		
+	/*
+	 * Sleep 5 seconds after each test to allow interrupt (shutdown) recovery.
+	 */
+	private long interruptRecoveryTime = 5000;
+	
+	/*
+	 * See the IntegrityMonitor.getJmxUrl() method for the rationale behind this jmx related processing.
+	 */
+	@BeforeClass
+	public static void setUpClass() throws Exception {
+		
+		PolicyLogger.info("setUpClass: Entering");
+
+		String userDir = System.getProperty("user.dir");
+		PolicyLogger.debug("setUpClass: userDir=" + userDir);
+		System.setProperty("com.sun.management.jmxremote.port", "9980");
+		System.setProperty("com.sun.management.jmxremote.authenticate","false");
+				
+		// Make sure path to config directory is set correctly in PolicyContainer.main
+		// Also make sure we ignore HTTP server failures resulting from port conflicts.
+		PolicyContainer.isUnitTesting = true;
+		
+		/*
+		 * Setting isUnitTesting to true ensures
+		 * 
+		 * 1) That we load test version of properties files
+		 * 
+		 * and
+		 * 
+		 * 2) that we use dbAuditSimulate() method, because all we care about
+		 * for this JUnit testing is that the audits are executed.
+		 */
+		IntegrityAudit.isUnitTesting = true;
+		
+		initializeDb();
+		
+		PolicyLogger.info("setUpClass: Exiting");
+		
+	}
+
+	@AfterClass
+	public static void tearDownClass() throws Exception {
+				
+	}
+
+	@Before
+	public void setUp() throws Exception {
+		
+	}
+
+	@After
+	public void tearDown() throws Exception {
+		
+	}
+
+	
+	/*
+	 * Verifies that audit thread starts successfully.
+	 */
+	//@Ignore
+	@Test
+	public void testAuditInit() throws Exception {
+		
+		PolicyLogger.debug("\n\ntestAuditInit: Entering\n\n");
+
+		PolicyLogger.debug("testAuditInit: Reading IntegrityMonitorProperties");
+		Properties integrityMonitorProperties = new Properties();
+		integrityMonitorProperties.load(new FileInputStream(new File(
+				INTEGRITY_MONITOR_PROPERTIES_FILE)));
+		IntegrityMonitorProperties.initProperties(integrityMonitorProperties);
+		String thisPdpId = IntegrityMonitorProperties
+				.getProperty(IntegrityMonitorProperties.PDP_INSTANCE_ID);
+		
+		PolicyLogger.debug("testAuditInit: Reading xacmlPersistenceProperties");
+		Properties xacmlPersistenceProperties = new Properties();
+		xacmlPersistenceProperties.load(new FileInputStream(new File(
+				"src/test/server/config/xacmlPersistence.properties")));
+		XacmlPersistenceProperties.initProperties(xacmlPersistenceProperties);
+		
+		PolicyLogger.debug("testAuditInit: Creating emfXacml");
+		EntityManagerFactory emfXacml = Persistence.createEntityManagerFactory(
+				"junitXacmlPU", xacmlPersistenceProperties);
+		
+		PolicyLogger.debug("testAuditInit: Reading droolsPersistenceProperties");
+		Properties droolsPersistenceProperties = new Properties();
+		droolsPersistenceProperties.load(new FileInputStream(new File(
+				"src/test/server/config/droolsPersistence.properties")));
+		DroolsPersistenceProperties.initProperties(droolsPersistenceProperties);
+
+		PolicyLogger.debug("testAuditInit: Creating emfDrools");
+		EntityManagerFactory emfDrools = Persistence.createEntityManagerFactory(
+				"junitDroolsPU", droolsPersistenceProperties);
+		
+		DroolsPdpsConnector conn = new JpaDroolsPdpsConnector(emfDrools);
+		
+		PolicyLogger.debug("testAuditInit: Cleaning up tables");
+		conn.deleteAllSessions();
+		conn.deleteAllPdps();
+		
+		/*
+		 * Insert this PDP as designated.  Initial standby state will be 
+		 * either null or cold standby.   
+		 */
+		PolicyLogger.debug("testAuditInit: Inserting PDP=" + thisPdpId + " as designated");
+		DroolsPdpImpl pdp = new DroolsPdpImpl(thisPdpId, true, 4, new Date());
+		conn.insertPdp(pdp);
+		DroolsPdpEntity droolsPdpEntity = conn.getPdp(thisPdpId);
+		PolicyLogger.debug("testAuditInit: After insertion, PDP=" + thisPdpId + " has DESIGNATED="
+				+ droolsPdpEntity.isDesignated());
+		assertTrue(droolsPdpEntity.isDesignated() == true);
+		
+		PolicyLogger.debug("testAuditInit: Instantiating stateManagement object");
+		StateManagement sm = new StateManagement(emfXacml, "dummy");
+		sm.deleteAllStateManagementEntities();
+		sm = new StateManagement(emfXacml, thisPdpId);
+		PMStandbyStateChangeNotifier pmStandbyStateChangeNotifier = new PMStandbyStateChangeNotifier();
+		sm.addObserver(pmStandbyStateChangeNotifier);
+				
+		PolicyLogger.debug("testAuditInit: Running policy-management.Main class, designated="
+				+ conn.getPdp(thisPdpId).isDesignated());
+		PolicyManagementRunner policyManagementRunner = new PolicyManagementRunner();
+		policyManagementRunner.start();
+		
+		PolicyLogger.debug("testAuditInit: Runner started; Sleeping "
+				+ interruptRecoveryTime + "ms before promoting PDP="
+				+ thisPdpId);
+		Thread.sleep(interruptRecoveryTime);
+		
+		IntegrityAudit integrityAudit = PersistenceFeature.getIntegrityAudit();
+		PolicyLogger.debug("testAuditInit: isThreadInitialized=" + integrityAudit.isThreadInitialized());
+		assertTrue("AuditThread not initialized!?",integrityAudit.isThreadInitialized());
+				
+		PolicyLogger.debug("testAuditInit: Stopping auditThread");
+		integrityAudit.stopAuditThread();
+		Thread.sleep(1000);
+		//This will interrupt thread.  However, the thread will not die.  It keeps on ticking and trying to
+		//run the audit.
+		assertTrue("AuditThread not still running after stopAuditThread invoked!?",integrityAudit.isThreadInitialized());
+
+		PolicyLogger.debug("testAuditInit: Stopping policyManagementRunner");
+		policyManagementRunner.stopRunner();
+		
+		PolicyLogger.debug("\n\ntestAuditInit: Exiting\n\n");
+		Thread.sleep(interruptRecoveryTime);
+
+	}	
+	
+    /*
+     * This method initializes and cleans the DB so that PDP-D will be able to 
+     * store IntegrityAuditEntity in the DB.
+     */
+	public static void initializeDb(){
+		
+		PolicyLogger.debug("initializeDb: Entering");
+		
+    	Properties cleanProperties = new Properties();
+    	cleanProperties.put(DroolsPersistenceProperties.DB_DRIVER,"org.h2.Driver");
+    	cleanProperties.put(DroolsPersistenceProperties.DB_URL, "jdbc:h2:file:./sql/drools");
+    	cleanProperties.put(DroolsPersistenceProperties.DB_USER, "sa");
+    	cleanProperties.put(DroolsPersistenceProperties.DB_PWD, "");
+    	//EntityManagerFactory emf = Persistence.createEntityManagerFactory("schemaPU", cleanProperties);
+    	EntityManagerFactory emf = Persistence.createEntityManagerFactory("junitDroolsPU", cleanProperties);
+		
+		EntityManager em = emf.createEntityManager();
+		// Start a transaction
+		EntityTransaction et = em.getTransaction();
+
+		et.begin();
+
+		// Clean up the DB
+		em.createQuery("Delete from IntegrityAuditEntity").executeUpdate();
+
+		// commit transaction
+		et.commit();
+		em.close();
+		
+		PolicyLogger.debug("initializeDb: Exiting");
+	}	
+	
+	private class PolicyManagementRunner extends Thread {
+
+		public void run() {
+			PolicyLogger.info("PolicyManagementRunner.run: Entering");
+			String args[] = { "src/main/server/config" };
+			try {
+				Main.main(args);
+			} catch (Exception e) {
+				PolicyLogger
+						.info("PolicyManagementRunner.run: Exception thrown from Main.main(), message="
+								+ e.getMessage());
+			}
+			PolicyLogger.info("PolicyManagementRunner.run: Exiting");
+		}
+		
+		public void stopRunner() {
+			PolicyEngine.manager.shutdown();
+		}
+
+	}
+	
+}
diff --git a/policy-persistence/src/test/java/org/openecomp/policy/drools/controller/test/ResiliencyTestCases.java b/policy-persistence/src/test/java/org/openecomp/policy/drools/controller/test/ResiliencyTestCases.java
new file mode 100644
index 0000000..f58d304
--- /dev/null
+++ b/policy-persistence/src/test/java/org/openecomp/policy/drools/controller/test/ResiliencyTestCases.java
@@ -0,0 +1,1267 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * policy-persistence
+ * ================================================================================
+ * 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.openecomp.policy.drools.controller.test;
+
+import static org.junit.Assert.assertTrue;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.util.Date;
+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.openecomp.policy.common.logging.eelf.PolicyLogger;
+import org.openecomp.policy.common.im.AdministrativeStateException;
+import org.openecomp.policy.common.im.IntegrityMonitor;
+import org.openecomp.policy.common.im.StandbyStatusException;
+import org.openecomp.policy.common.im.StateManagement;
+import org.openecomp.policy.drools.core.DroolsPDPIntegrityMonitor;
+import org.openecomp.policy.drools.core.IntegrityMonitorProperties;
+import org.openecomp.policy.drools.core.PolicyContainer;
+import org.openecomp.policy.drools.im.PMStandbyStateChangeNotifier;
+import org.openecomp.policy.drools.persistence.DroolsPdp;
+import org.openecomp.policy.drools.persistence.DroolsPdpEntity;
+import org.openecomp.policy.drools.persistence.DroolsPdpImpl;
+import org.openecomp.policy.drools.persistence.DroolsPdpsConnector;
+import org.openecomp.policy.drools.persistence.JpaDroolsPdpsConnector;
+import org.openecomp.policy.drools.persistence.DroolsPersistenceProperties;
+import org.openecomp.policy.drools.persistence.XacmlPersistenceProperties;
+import org.openecomp.policy.drools.system.Main;
+import org.openecomp.policy.drools.system.PolicyEngine;
+
+import org.apache.commons.lang3.time.DateUtils;
+
+/*
+ * Cloned from StandbyStateManagement.java in support of US673632.
+ * See MultiSite_v1-10.ppt, slide 38
+ */
+public class ResiliencyTestCases {
+			
+	/*
+	 * Currently, the DroolsPdpsElectionHandler.DesignationWaiter is invoked every ten seconds, starting 
+	 * at ten seconds after the minute boundary (e.g. 13:05:10). So, an 80 second sleep should be 
+	 * sufficient to ensure that we wait for the DesignationWaiter to do its job, before 
+	 * checking the results. 
+	 */
+	long sleepTime = 80000;
+	
+	/*
+	 * DroolsPdpsElectionHandler runs every ten seconds, so a 15 second sleep should be 
+	 * plenty to ensure it has time to re-promote this PDP.
+	 */
+	long electionWaitSleepTime = 15000;
+	
+	/*
+	 * Sleep 5 seconds after each test to allow interrupt (shutdown) recovery.
+	 */
+	long interruptRecoveryTime = 5000;
+
+	/*
+	 * See the IntegrityMonitor.getJmxUrl() method for the rationale behind this jmx related processing.
+	 */
+	@BeforeClass
+	public static void setUpClass() throws Exception {
+		
+		String userDir = System.getProperty("user.dir");
+		PolicyLogger.debug("setUpClass: userDir=" + userDir);
+		System.setProperty("com.sun.management.jmxremote.port", "9980");
+		System.setProperty("com.sun.management.jmxremote.authenticate","false");
+				
+		// Make sure path to config directory is set correctly in PolicyContainer.main
+		// Also make sure we ignore HTTP server failures resulting from port conflicts.
+		PolicyContainer.isUnitTesting = true;
+		
+	}
+
+	@AfterClass
+	public static void tearDownClass() throws Exception {
+	}
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+				
+	}
+	
+	public void cleanDroolsDB() throws Exception{
+		PolicyLogger.debug("\n\ncleanDroolsDB: Entering\n\n");
+
+		PolicyLogger.debug("cleanDroolsDB: Reading droolsPersistenceProperties");
+		Properties droolsPersistenceProperties = new Properties();
+		droolsPersistenceProperties.load(new FileInputStream(new File(
+				"src/test/server/config/droolsPersistence.properties")));
+
+		PolicyLogger.debug("cleanDroolsDB: Creating emfDrools");
+		EntityManagerFactory emf = Persistence.createEntityManagerFactory(
+				"junitDroolsPU", droolsPersistenceProperties);
+		
+		PolicyLogger.debug("cleanDroolsDB: Cleaning up tables");
+		
+		EntityManager em = emf.createEntityManager();
+		EntityTransaction et = em.getTransaction();
+		et.begin();
+		
+		// Make sure the DB is clean
+		PolicyLogger.debug("cleanDroolsDB: clean DroolsPdpEntity");
+		em.createQuery("DELETE FROM DroolsPdpEntity").executeUpdate();
+		PolicyLogger.debug("cleanDroolsDB: clean DroolsSessionEntity");
+		em.createQuery("DELETE FROM DroolsSessionEntity").executeUpdate();
+		
+		em.flush(); 
+		PolicyLogger.debug("cleanDroolsDB: after flush");
+
+		et.commit(); 
+		
+		PolicyLogger.debug("\n\ncleanDroolsDB: Exiting\n\n");
+	}
+	
+	public void cleanXacmlDB() throws Exception {
+		PolicyLogger.debug("\n\ncleanXacmlDB: Entering\n\n");
+
+		PolicyLogger.debug("cleanXacmlDB: Reading IntegrityMonitorProperties");
+
+		PolicyLogger.debug("cleanXacmlDB: Reading xacmlPersistenceProperties");
+		Properties xacmlPersistenceProperties = new Properties();
+		xacmlPersistenceProperties.load(new FileInputStream(new File(
+				"src/test/server/config/xacmlPersistence.properties")));
+		
+		PolicyLogger.debug("cleanXacmlDB: Creating emf");
+		EntityManagerFactory emf = Persistence.createEntityManagerFactory(
+				"junitXacmlPU", xacmlPersistenceProperties);
+		
+		EntityManager em = emf.createEntityManager();
+		EntityTransaction et = em.getTransaction();
+		et.begin();
+		
+		// Make sure the DB is clean
+		PolicyLogger.debug("cleanXacmlDB: clean StateManagementEntity");
+		em.createQuery("DELETE FROM StateManagementEntity").executeUpdate();
+		PolicyLogger.debug("cleanXacmlDB: clean ResourceRegistrationEntity");
+		em.createQuery("DELETE FROM ResourceRegistrationEntity").executeUpdate();
+		PolicyLogger.debug("cleanXacmlDB: clean ForwardProgressEntity");
+		em.createQuery("DELETE FROM ForwardProgressEntity").executeUpdate();
+		
+		em.flush(); 
+		PolicyLogger.debug("cleandXacmlDB: after flush");
+
+		et.commit(); 
+		
+		PolicyLogger.debug("\n\ncleanXacmlDB: Exiting\n\n");
+		
+	}
+	
+	@Ignore
+	@Test
+	public void singleNodeTests() throws Exception{
+		//snNewInstall();
+		snNewInstallBadDepData();
+		/*snRecoveryFromBadDepData();
+		snLock();
+		snLockRestart();
+		snUnlock();
+		snUnlockRestart();*/
+	}
+	
+	@Ignore
+	@Test
+	public void twoNodeTests() throws Exception{
+		tnNewInstall();
+		tnLockActive();
+		tnUnlockColdStandby();
+		tnFailActive();
+		tnRecoverFailed();
+	}
+	
+	@Ignore
+	@Test
+	public void twoSitesTwoNodesPerSiteTests() throws Exception{
+		tstnNewInstall();
+		tstnLock1Site1();
+		tstnLock2Site1();
+		tstnFailActiveSite2();
+		tstnRecoverFailedSite2();
+		tstnUnlockSite1();
+		tstnFailSite2();
+	}
+	
+
+	/*
+	 * Single Node Tests
+	 */
+	public void snNewInstall() throws Exception{
+		PolicyLogger.debug("\n\nsnNewInstall: Entry\n\n");
+		cleanDroolsDB();
+		cleanXacmlDB();
+		
+		//*******************************************
+		
+		PolicyLogger.debug("snNewInstall: Reading IntegrityMonitorProperties");
+		Properties integrityMonitorProperties = new Properties();
+		integrityMonitorProperties.load(new FileInputStream(new File(
+				"src/test/server/config/IntegrityMonitor.properties")));
+		IntegrityMonitorProperties.initProperties(integrityMonitorProperties);
+		String thisPdpId = IntegrityMonitorProperties
+				.getProperty(IntegrityMonitorProperties.PDP_INSTANCE_ID);
+
+		PolicyLogger.debug("snNewInstall: Reading xacmlPersistenceProperties");
+		Properties xacmlPersistenceProperties = new Properties();
+		xacmlPersistenceProperties.load(new FileInputStream(new File(
+				"src/test/server/config/xacmlPersistence.properties")));
+		XacmlPersistenceProperties.initProperties(xacmlPersistenceProperties);
+		
+		PolicyLogger.debug("snNewInstall: Creating emfXacml");
+		EntityManagerFactory emfXacml = Persistence.createEntityManagerFactory(
+				"junitXacmlPU", xacmlPersistenceProperties);
+		
+		PolicyLogger.debug("snNewInstall: Reading droolsPersistenceProperties");
+		Properties droolsPersistenceProperties = new Properties();
+		droolsPersistenceProperties.load(new FileInputStream(new File(
+				"src/test/server/config/droolsPersistence.properties")));
+		DroolsPersistenceProperties.initProperties(droolsPersistenceProperties);
+
+		PolicyLogger.debug("snNewInstall: Creating emfDrools");
+		EntityManagerFactory emfDrools = Persistence.createEntityManagerFactory(
+				"junitDroolsPU", droolsPersistenceProperties);
+		
+		DroolsPdpsConnector conn = new JpaDroolsPdpsConnector(emfDrools);
+	
+		PolicyLogger.debug("snNewInstall: Inserting PDP=" + thisPdpId + " as designated");
+		DroolsPdp pdp = new DroolsPdpImpl(thisPdpId, true, 4, new Date());
+		conn.insertPdp(pdp);
+		DroolsPdpEntity droolsPdpEntity = conn.getPdp(thisPdpId);
+		PolicyLogger.debug("snNewInstall: After insertion, DESIGNATED="
+				+ droolsPdpEntity.isDesignated() + " for PDP=" + thisPdpId);
+		assertTrue(droolsPdpEntity.isDesignated() == true);
+
+		/*
+		 * When the Standby Status changes (from providingservice) to hotstandby
+		 * or coldstandby,the Active/Standby selection algorithm must stand down
+		 * if thePDP-D is currently the lead/active node and allow another PDP-D
+		 * to take over.
+		 * 
+		 * It must also call lock on all engines in the engine management.
+		 * 
+		 */
+		PolicyLogger.debug("snNewInstall: Instantiating stateManagement object");
+		StateManagement sm = new StateManagement(emfXacml, thisPdpId);
+		PMStandbyStateChangeNotifier pmStandbyStateChangeNotifier = new PMStandbyStateChangeNotifier();
+		sm.addObserver(pmStandbyStateChangeNotifier);
+		
+		// Artificially putting a PDP into service is really a two step process, 1)
+		// inserting it as designated and 2) promoting it so that its standbyStatus
+		// is providing service.
+		
+		PolicyLogger.debug("snNewInstall: Running policy-management.Main class");
+		PolicyManagementRunner policyManagementRunner = new PolicyManagementRunner();
+		policyManagementRunner.start();
+		
+		PolicyLogger.debug("snNewInstall: Runner started; Sleeping "
+				+ interruptRecoveryTime + "ms before promoting PDP="
+				+ thisPdpId);
+		Thread.sleep(interruptRecoveryTime);
+
+		PolicyLogger.debug("snNewInstall: Promoting PDP=" + thisPdpId);
+		sm.promote();		
+		
+		String standbyStatus = sm.getStandbyStatus(thisPdpId);
+		PolicyLogger.debug("snNewInstall: Before locking, PDP=" + thisPdpId + " has standbyStatus="
+				+ standbyStatus);
+		
+		PolicyLogger.debug("snNewInstall: Locking sm");
+		sm.lock();
+		
+		Thread.sleep(interruptRecoveryTime);
+		/*
+		 * Verify that the PDP is no longer designated.
+		 */
+		droolsPdpEntity = conn.getPdp(thisPdpId);
+		PolicyLogger.debug("snNewInstall: After lock sm.lock() invoked, DESIGNATED="
+				+ droolsPdpEntity.isDesignated() + " for PDP=" + thisPdpId);
+		assertTrue(droolsPdpEntity.isDesignated() == false);
+		
+		PolicyLogger.debug("snNewInstall: Stopping policyManagementRunner");
+		policyManagementRunner.stopRunner();
+	
+		PolicyLogger.debug("\n\nsnNewInstall: Exiting\n\n");
+		Thread.sleep(interruptRecoveryTime);
+		
+		//********************************************
+
+		PolicyLogger.debug("\n\nsnNewInstall: Exit\n\n");
+	}
+	
+	public void snNewInstallBadDepData() throws Exception{
+		PolicyLogger.debug("\n\nsnNewInstallBadDepData: Entry\n\n");
+		cleanDroolsDB();
+		cleanXacmlDB();
+		
+		//*******************************************
+		
+		PolicyLogger.debug("snNewInstallBadDepData: Reading IntegrityMonitor_BadDependencyData.properties");
+		Properties integrityMonitorProperties = new Properties();
+		integrityMonitorProperties.load(new FileInputStream(new File(
+				"src/test/server/config/IntegrityMonitor_BadDependencyData.properties")));
+		IntegrityMonitorProperties.initProperties(integrityMonitorProperties);
+		String thisPdpId = IntegrityMonitorProperties
+				.getProperty(IntegrityMonitorProperties.PDP_INSTANCE_ID);
+
+		PolicyLogger.debug("snNewInstallBadDepData: Reading xacmlPersistenceProperties");
+		Properties xacmlPersistenceProperties = new Properties();
+		xacmlPersistenceProperties.load(new FileInputStream(new File(
+				"src/test/server/config/xacmlPersistence.properties")));
+		XacmlPersistenceProperties.initProperties(xacmlPersistenceProperties);
+		
+		PolicyLogger.debug("snNewInstallBadDepData: Creating emfXacml");
+		EntityManagerFactory emfXacml = Persistence.createEntityManagerFactory(
+				"junitXacmlPU", xacmlPersistenceProperties);
+		
+		PolicyLogger.debug("snNewInstallBadDepData: Reading droolsPersistenceProperties");
+		Properties droolsPersistenceProperties = new Properties();
+		droolsPersistenceProperties.load(new FileInputStream(new File(
+				"src/test/server/config/droolsPersistence.properties")));
+		DroolsPersistenceProperties.initProperties(droolsPersistenceProperties);
+
+		PolicyLogger.debug("snNewInstallBadDepData: Creating emfDrools");
+		EntityManagerFactory emfDrools = Persistence.createEntityManagerFactory(
+				"junitDroolsPU", droolsPersistenceProperties);
+		
+		DroolsPdpsConnector conn = new JpaDroolsPdpsConnector(emfDrools);
+	
+		PolicyLogger.debug("snNewInstallBadDepData: Inserting PDP=" + thisPdpId + " as designated");
+		DroolsPdp pdp = new DroolsPdpImpl(thisPdpId, true, 4, new Date());
+		conn.insertPdp(pdp);
+		DroolsPdpEntity droolsPdpEntity = conn.getPdp(thisPdpId);
+		//PolicyLogger.debug
+		System.out.println
+		("\n\nsnNewInstallBadDepData: After insertion, DESIGNATED="
+				+ droolsPdpEntity.isDesignated() + " for PDP=" + thisPdpId + "\n\n********************");
+		assertTrue(droolsPdpEntity.isDesignated() == true);
+		
+		/*
+		 * When the Standby Status changes (from providingservice) to hotstandby
+		 * or coldstandby,the Active/Standby selection algorithm must stand down
+		 * if thePDP-D is currently the lead/active node and allow another PDP-D
+		 * to take over.
+		 */
+		PolicyLogger.debug("snNewInstall: Instantiating stateManagement object");
+		StateManagement sm = new StateManagement(emfXacml, thisPdpId);
+		PMStandbyStateChangeNotifier pmStandbyStateChangeNotifier = new PMStandbyStateChangeNotifier();
+		sm.addObserver(pmStandbyStateChangeNotifier);
+		
+		// Artificially putting a PDP into service is really a two step process, 1)
+		// inserting it as designated and 2) promoting it so that its standbyStatus
+		// is providing service.
+		
+		PolicyLogger.debug("snNewInstall: Running policy-management.Main class");
+		PolicyManagementRunner policyManagementRunner = new PolicyManagementRunner();
+		policyManagementRunner.start();
+		
+		PolicyLogger.debug("snNewInstall: Runner started; Sleeping "
+				+ interruptRecoveryTime + "ms before promoting PDP="
+				+ thisPdpId);
+		Thread.sleep(interruptRecoveryTime);
+
+		PolicyLogger.debug("snNewInstall: Promoting PDP=" + thisPdpId);
+		sm.promote();		
+		
+		String standbyStatus = sm.getStandbyStatus(thisPdpId);
+		PolicyLogger.debug("snNewInstall: Before locking, PDP=" + thisPdpId + " has standbyStatus="
+				+ standbyStatus);
+		
+		/*
+		 * Verify that the PDP is no longer designated.
+		 */
+		droolsPdpEntity = conn.getPdp(thisPdpId);
+		PolicyLogger.debug("snNewInstall: After lock sm.lock() invoked, DESIGNATED="
+				+ droolsPdpEntity.isDesignated() + " for PDP=" + thisPdpId);
+		assertTrue(droolsPdpEntity.isDesignated() == false);
+		
+		PolicyLogger.debug("snNewInstall: Stopping policyManagementRunner");
+		policyManagementRunner.stopRunner();
+	
+		PolicyLogger.debug("\n\nsnNewInstall: Exiting\n\n");
+		Thread.sleep(interruptRecoveryTime);
+		
+		//********************************************
+
+		PolicyLogger.debug("\n\nsnNewInstallBadDepData: Exit\n\n");
+	}
+	
+	public void snRecoveryFromBadDepData() throws Exception{
+		
+	}
+	
+	public void snLock() throws Exception {
+		
+	}
+	
+	public void snLockRestart() throws Exception {
+		
+	}
+	
+	public void snUnlock() throws Exception {
+		
+	}
+	
+	public void snUnlockRestart() throws Exception {
+		
+	}
+	
+	/*
+	 * Two Nodes tests
+	 */
+	public void tnNewInstall() throws Exception {
+		
+	}
+	
+	public void tnLockActive() throws Exception {
+		
+	}
+	
+	public void tnUnlockColdStandby() throws Exception {
+		
+	}
+	
+	public void tnFailActive() throws Exception {
+		
+	}
+	
+	public void tnRecoverFailed() throws Exception {
+		
+	}
+	
+	/*
+	 * Two Sites, Two Nodes Each Site tests
+	 */
+	
+	public void tstnNewInstall() throws Exception {
+		
+	}
+	
+	public void tstnLock1Site1() throws Exception {
+		
+	}
+	
+	public void tstnLock2Site1() throws Exception {
+		
+	}
+	
+	public void tstnFailActiveSite2() throws Exception {
+		
+	}
+	
+	public void tstnRecoverFailedSite2() throws Exception {
+		
+	}
+	
+	public void tstnUnlockSite1() throws Exception {
+		
+	}
+	
+	public void tstnFailSite2() throws Exception {
+		
+	}
+	
+	
+	@Ignore
+	@Test
+	public void testColdStandby() throws Exception {
+
+		PolicyLogger.debug("\n\ntestColdStandby: Entering\n\n");
+
+		PolicyLogger.debug("testColdStandby: Reading IntegrityMonitorProperties");
+		Properties integrityMonitorProperties = new Properties();
+		integrityMonitorProperties.load(new FileInputStream(new File(
+				"src/test/server/config/IntegrityMonitor.properties")));
+		IntegrityMonitorProperties.initProperties(integrityMonitorProperties);
+		String thisPdpId = IntegrityMonitorProperties
+				.getProperty(IntegrityMonitorProperties.PDP_INSTANCE_ID);
+
+		PolicyLogger.debug("testColdStandby: Reading xacmlPersistenceProperties");
+		Properties xacmlPersistenceProperties = new Properties();
+		xacmlPersistenceProperties.load(new FileInputStream(new File(
+				"src/test/server/config/xacmlPersistence.properties")));
+		XacmlPersistenceProperties.initProperties(xacmlPersistenceProperties);
+		
+		PolicyLogger.debug("testColdStandby: Creating emfXacml");
+		EntityManagerFactory emfXacml = Persistence.createEntityManagerFactory(
+				"junitXacmlPU", xacmlPersistenceProperties);
+		
+		PolicyLogger.debug("testColdStandby: Reading droolsPersistenceProperties");
+		Properties droolsPersistenceProperties = new Properties();
+		droolsPersistenceProperties.load(new FileInputStream(new File(
+				"src/test/server/config/droolsPersistence.properties")));
+		DroolsPersistenceProperties.initProperties(droolsPersistenceProperties);
+
+		PolicyLogger.debug("testColdStandby: Creating emfDrools");
+		EntityManagerFactory emfDrools = Persistence.createEntityManagerFactory(
+				"junitDroolsPU", droolsPersistenceProperties);
+		
+		DroolsPdpsConnector conn = new JpaDroolsPdpsConnector(emfDrools);
+		
+		PolicyLogger.debug("testColdStandby: Cleaning up tables");
+		conn.deleteAllSessions();
+		conn.deleteAllPdps();
+	
+		PolicyLogger.debug("testColdStandby: Inserting PDP=" + thisPdpId + " as designated");
+		DroolsPdp pdp = new DroolsPdpImpl(thisPdpId, true, 4, new Date());
+		conn.insertPdp(pdp);
+		DroolsPdpEntity droolsPdpEntity = conn.getPdp(thisPdpId);
+		PolicyLogger.debug("testColdStandby: After insertion, DESIGNATED="
+				+ droolsPdpEntity.isDesignated() + " for PDP=" + thisPdpId);
+		assertTrue(droolsPdpEntity.isDesignated() == true);
+
+		/*
+		 * When the Standby Status changes (from providingservice) to hotstandby
+		 * or coldstandby,the Active/Standby selection algorithm must stand down
+		 * if thePDP-D is currently the lead/active node and allow another PDP-D
+		 * to take over.
+		 * 
+		 * It must also call lock on all engines in the engine management.
+		 * 
+		 * Yes, this is kludgy, but we have a chicken and egg problem here: we
+		 * need a StateManagement object to invoke the
+		 * deleteAllStateManagementEntities method.
+		 */
+		PolicyLogger.debug("testColdStandby: Instantiating stateManagement object");
+		StateManagement sm = new StateManagement(emfXacml, "dummy");
+		sm.deleteAllStateManagementEntities();
+		sm = new StateManagement(emfXacml, thisPdpId);
+		PMStandbyStateChangeNotifier pmStandbyStateChangeNotifier = new PMStandbyStateChangeNotifier();
+		sm.addObserver(pmStandbyStateChangeNotifier);
+		
+		// Artificially putting a PDP into service is really a two step process, 1)
+		// inserting it as designated and 2) promoting it so that its standbyStatus
+		// is providing service.
+		
+		PolicyLogger.debug("testColdStandby: Running policy-management.Main class");
+		PolicyManagementRunner policyManagementRunner = new PolicyManagementRunner();
+		policyManagementRunner.start();
+		
+		PolicyLogger.debug("testColdStandby: Runner started; Sleeping "
+				+ interruptRecoveryTime + "ms before promoting PDP="
+				+ thisPdpId);
+		Thread.sleep(interruptRecoveryTime);
+
+		PolicyLogger.debug("testColdStandby: Promoting PDP=" + thisPdpId);
+		sm.promote();		
+		
+		String standbyStatus = sm.getStandbyStatus(thisPdpId);
+		PolicyLogger.debug("testColdStandby: Before locking, PDP=" + thisPdpId + " has standbyStatus="
+				+ standbyStatus);
+		
+		PolicyLogger.debug("testColdStandby: Locking sm");
+		sm.lock();
+		
+		Thread.sleep(interruptRecoveryTime);
+		/*
+		 * Verify that the PDP is no longer designated.
+		 */
+		droolsPdpEntity = conn.getPdp(thisPdpId);
+		PolicyLogger.debug("testColdStandby: After lock sm.lock() invoked, DESIGNATED="
+				+ droolsPdpEntity.isDesignated() + " for PDP=" + thisPdpId);
+		assertTrue(droolsPdpEntity.isDesignated() == false);
+		
+		PolicyLogger.debug("testColdStandby: Stopping policyManagementRunner");
+		policyManagementRunner.stopRunner();
+	
+		PolicyLogger.debug("\n\ntestColdStandby: Exiting\n\n");
+		Thread.sleep(interruptRecoveryTime);
+
+	}
+	
+	/*
+	 * Tests hot standby when there is only one PDP.
+	 */
+	@Ignore
+	@Test
+	public void testHotStandby1() throws Exception {
+	
+		PolicyLogger.debug("\n\ntestHotStandby1: Entering\n\n");
+		
+		PolicyLogger.debug("testHotStandby1: Reading IntegrityMonitorProperties");
+		Properties integrityMonitorProperties = new Properties();
+		integrityMonitorProperties.load(new FileInputStream(new File(
+				"src/test/server/config/IntegrityMonitor.properties")));
+		IntegrityMonitorProperties.initProperties(integrityMonitorProperties);
+		String thisPdpId = IntegrityMonitorProperties
+				.getProperty(IntegrityMonitorProperties.PDP_INSTANCE_ID);
+		
+		PolicyLogger.debug("testHotStandby1: Reading xacmlPersistenceProperties");
+		Properties xacmlPersistenceProperties = new Properties();
+		xacmlPersistenceProperties.load(new FileInputStream(new File(
+				"src/test/server/config/xacmlPersistence.properties")));
+		XacmlPersistenceProperties.initProperties(xacmlPersistenceProperties);
+		
+		PolicyLogger.debug("testHotStandby1: Creating emfXacml");
+		EntityManagerFactory emfXacml = Persistence.createEntityManagerFactory(
+				"junitXacmlPU", xacmlPersistenceProperties);
+		
+		PolicyLogger.debug("testHotStandby1: Reading droolsPersistenceProperties");
+		Properties droolsPersistenceProperties = new Properties();
+		droolsPersistenceProperties.load(new FileInputStream(new File(
+				"src/test/server/config/droolsPersistence.properties")));
+		DroolsPersistenceProperties.initProperties(droolsPersistenceProperties);
+
+		PolicyLogger.debug("testHotStandby1: Creating emfDrools");
+		EntityManagerFactory emfDrools = Persistence.createEntityManagerFactory(
+				"junitDroolsPU", droolsPersistenceProperties);
+		
+		DroolsPdpsConnector conn = new JpaDroolsPdpsConnector(emfDrools);
+		
+		PolicyLogger.debug("testHotStandby1: Cleaning up tables");
+		conn.deleteAllSessions();
+		conn.deleteAllPdps();
+					
+		/*
+		 * Insert this PDP as not designated.  Initial standby state will be 
+		 * either null or cold standby.   Demoting should transit state to
+		 * hot standby.
+		 */
+		PolicyLogger.debug("testHotStandby1: Inserting PDP=" + thisPdpId + " as not designated");
+		Date yesterday = DateUtils.addDays(new Date(), -1);
+		DroolsPdpImpl pdp = new DroolsPdpImpl(thisPdpId, false, 4, yesterday);
+		conn.insertPdp(pdp);
+		DroolsPdpEntity droolsPdpEntity = conn.getPdp(thisPdpId);
+		PolicyLogger.debug("testHotStandby1: After insertion, PDP=" + thisPdpId + " has DESIGNATED="
+				+ droolsPdpEntity.isDesignated());
+		assertTrue(droolsPdpEntity.isDesignated() == false);
+		
+		PolicyLogger.debug("testHotStandby1: Instantiating stateManagement object");
+		StateManagement sm = new StateManagement(emfXacml, "dummy");
+		sm.deleteAllStateManagementEntities();
+		sm = new StateManagement(emfXacml, thisPdpId);
+		PMStandbyStateChangeNotifier pmStandbyStateChangeNotifier = new PMStandbyStateChangeNotifier();
+		sm.addObserver(pmStandbyStateChangeNotifier);
+
+		PolicyLogger.debug("testHotStandby1: Demoting PDP=" + thisPdpId);
+		// demoting should cause state to transit to hotstandby
+		sm.demote();
+		
+		PolicyLogger.debug("testHotStandby1: Running policy-management.Main class");
+		PolicyManagementRunner policyManagementRunner = new PolicyManagementRunner();
+		policyManagementRunner.start();
+				
+		PolicyLogger.debug("testHotStandby1: Sleeping "
+				+ sleepTime
+				+ "ms, to allow JpaDroolsPdpsConnector time to check droolspdpentity table");
+		Thread.sleep(sleepTime);
+		
+		/*
+		 * Verify that this formerly un-designated PDP in HOT_STANDBY is now designated and providing service.
+		 */
+		droolsPdpEntity = conn.getPdp(thisPdpId);
+		PolicyLogger.debug("testHotStandby1: After sm.demote() invoked, DESIGNATED="
+				+ droolsPdpEntity.isDesignated() + " for PDP=" + thisPdpId);
+		assertTrue(droolsPdpEntity.isDesignated() == true);
+		String standbyStatus = sm.getStandbyStatus(thisPdpId);
+		PolicyLogger.debug("testHotStandby1: After demotion, PDP=" + thisPdpId + " has standbyStatus="
+				+ standbyStatus);
+		assertTrue(standbyStatus != null  &&  standbyStatus.equals(StateManagement.PROVIDING_SERVICE));
+				
+		PolicyLogger.debug("testHotStandby1: Stopping policyManagementRunner");
+		policyManagementRunner.stopRunner();		
+	
+		PolicyLogger.debug("\n\ntestHotStandby1: Exiting\n\n");
+		Thread.sleep(interruptRecoveryTime);
+
+	}
+
+	/*
+	 * Tests hot standby when two PDPs are involved.
+	 */
+	@Ignore
+	@Test
+	public void testHotStandby2() throws Exception {
+
+		PolicyLogger.debug("\n\ntestHotStandby2: Entering\n\n");
+		
+		PolicyLogger.debug("testHotStandby2: Reading IntegrityMonitorProperties");
+		Properties integrityMonitorProperties = new Properties();
+		integrityMonitorProperties.load(new FileInputStream(new File(
+				"src/test/server/config/IntegrityMonitor.properties")));
+		IntegrityMonitorProperties.initProperties(integrityMonitorProperties);
+		String thisPdpId = IntegrityMonitorProperties
+				.getProperty(IntegrityMonitorProperties.PDP_INSTANCE_ID);
+		
+		PolicyLogger.debug("testHotStandby2: Reading xacmlPersistenceProperties");
+		Properties xacmlPersistenceProperties = new Properties();
+		xacmlPersistenceProperties.load(new FileInputStream(new File(
+				"src/test/server/config/xacmlPersistence.properties")));
+		XacmlPersistenceProperties.initProperties(xacmlPersistenceProperties);
+		
+		PolicyLogger.debug("testHotStandby2: Creating emfXacml");
+		EntityManagerFactory emfXacml = Persistence.createEntityManagerFactory(
+				"junitXacmlPU", xacmlPersistenceProperties);
+		
+		PolicyLogger.debug("testHotStandby2: Reading droolsPersistenceProperties");
+		Properties droolsPersistenceProperties = new Properties();
+		droolsPersistenceProperties.load(new FileInputStream(new File(
+				"src/test/server/config/droolsPersistence.properties")));
+		DroolsPersistenceProperties.initProperties(droolsPersistenceProperties);
+
+		PolicyLogger.debug("testHotStandby2: Creating emfDrools");
+		EntityManagerFactory emfDrools = Persistence.createEntityManagerFactory(
+				"junitDroolsPU", droolsPersistenceProperties);
+		
+		DroolsPdpsConnector conn = new JpaDroolsPdpsConnector(emfDrools);
+		
+		PolicyLogger.debug("testHotStandby2: Cleaning up tables");
+		conn.deleteAllSessions();
+		conn.deleteAllPdps();
+		
+		/*
+		 * Insert a PDP that's designated but not current.
+		 */
+		String activePdpId = "pdp2";
+		PolicyLogger.debug("testHotStandby2: Inserting PDP=" + activePdpId + " as stale, designated PDP");
+		Date yesterday = DateUtils.addDays(new Date(), -1);
+		DroolsPdp pdp = new DroolsPdpImpl(activePdpId, true, 4, yesterday);
+		conn.insertPdp(pdp);
+		DroolsPdpEntity droolsPdpEntity = conn.getPdp(activePdpId);
+		PolicyLogger.debug("testHotStandby2: After insertion, PDP=" + activePdpId + ", which is not current, has DESIGNATED="
+				+ droolsPdpEntity.isDesignated());
+		assertTrue(droolsPdpEntity.isDesignated() == true);
+		
+		/*
+		 * Promote the designated PDP.
+		 * 
+		 * We have a chicken and egg problem here: we need a StateManagement
+		 * object to invoke the deleteAllStateManagementEntities method.
+		 */
+		PolicyLogger.debug("testHotStandy2: Promoting PDP=" + activePdpId);
+		StateManagement sm = new StateManagement(emfXacml, "dummy");
+		sm.deleteAllStateManagementEntities();
+		sm = new StateManagement(emfXacml, activePdpId);
+		PMStandbyStateChangeNotifier pmStandbyStateChangeNotifier = new PMStandbyStateChangeNotifier();
+		sm.addObserver(pmStandbyStateChangeNotifier);
+		
+		// Artificially putting a PDP into service is really a two step process, 1)
+		// inserting it as designated and 2) promoting it so that its standbyStatus
+		// is providing service.
+				
+		/*
+		 * Insert this PDP as not designated.  Initial standby state will be 
+		 * either null or cold standby.   Demoting should transit state to
+		 * hot standby.
+		 */
+		PolicyLogger.debug("testHotStandby2: Inserting PDP=" + thisPdpId + " as not designated");
+		pdp = new DroolsPdpImpl(thisPdpId, false, 4, yesterday);
+		conn.insertPdp(pdp);
+		droolsPdpEntity = conn.getPdp(thisPdpId);
+		PolicyLogger.debug("testHotStandby2: After insertion, PDP=" + thisPdpId + " has DESIGNATED="
+				+ droolsPdpEntity.isDesignated());
+		assertTrue(droolsPdpEntity.isDesignated() == false);
+		
+		PolicyLogger.debug("testHotStandby2: Demoting PDP=" + thisPdpId);
+		StateManagement sm2 = new StateManagement(emfXacml, thisPdpId);
+		sm2.addObserver(pmStandbyStateChangeNotifier);
+		
+		PolicyLogger.debug("testHotStandby2: Running policy-management.Main class");
+		PolicyManagementRunner policyManagementRunner = new PolicyManagementRunner();
+		policyManagementRunner.start();
+		
+		PolicyLogger.debug("testHotStandby2: Runner started; Sleeping "
+				+ interruptRecoveryTime + "ms before promoting/demoting");
+		Thread.sleep(interruptRecoveryTime);
+
+		PolicyLogger.debug("testHotStandby2: Runner started; promoting PDP=" + activePdpId);
+		sm.promote();
+		String standbyStatus = sm.getStandbyStatus(activePdpId);
+		PolicyLogger.debug("testHotStandby2: After promoting, PDP=" + activePdpId + " has standbyStatus="
+				+ standbyStatus);
+		
+		// demoting PDP should ensure that state transits to hotstandby
+		PolicyLogger.debug("testHotStandby2: Runner started; demoting PDP=" + thisPdpId);
+		sm2.demote();
+		standbyStatus = sm.getStandbyStatus(thisPdpId);
+		PolicyLogger.debug("testHotStandby2: After demoting, PDP=" + thisPdpId + " has standbyStatus="
+				+ standbyStatus);
+		
+		PolicyLogger.debug("testHotStandby2: Sleeping "
+				+ sleepTime
+				+ "ms, to allow JpaDroolsPdpsConnector time to check droolspdpentity table");
+		Thread.sleep(sleepTime);
+		
+		/*
+		 * Verify that this PDP, demoted to HOT_STANDBY, is now
+		 * re-designated and providing service.
+		 */
+		droolsPdpEntity = conn.getPdp(thisPdpId);
+		PolicyLogger.debug("testHotStandby2: After demoting PDP=" + activePdpId
+				+ ", DESIGNATED=" + droolsPdpEntity.isDesignated()
+				+ " for PDP=" + thisPdpId);
+		assertTrue(droolsPdpEntity.isDesignated() == true);
+		standbyStatus = sm2.getStandbyStatus(thisPdpId);
+		PolicyLogger.debug("testHotStandby2: After demoting PDP=" + activePdpId
+				+ ", PDP=" + thisPdpId + " has standbyStatus=" + standbyStatus);
+		assertTrue(standbyStatus != null
+				&& standbyStatus.equals(StateManagement.PROVIDING_SERVICE));
+				
+		PolicyLogger.debug("testHotStandby2: Stopping policyManagementRunner");
+		policyManagementRunner.stopRunner();		
+
+		PolicyLogger.debug("\n\ntestHotStandby2: Exiting\n\n");
+		Thread.sleep(interruptRecoveryTime);
+
+	}
+	
+	/*
+	 * 1) Inserts and designates this PDP, then verifies that startTransaction
+	 * is successful.
+	 * 
+	 * 2) Demotes PDP, and verifies that because there is only one PDP, it will
+	 * be immediately re-promoted, thus allowing startTransaction to be
+	 * successful.
+	 * 
+	 * 3) Locks PDP and verifies that startTransaction results in
+	 * AdministrativeStateException.
+	 * 
+	 * 4) Unlocks PDP and verifies that startTransaction results in
+	 * StandbyStatusException.
+	 * 
+	 * 5) Promotes PDP and verifies that startTransaction is once again
+	 * successful.
+	 */
+	@Ignore
+	@Test
+	public void testLocking1() throws Exception {
+				
+		PolicyLogger.debug("testLocking1: Reading IntegrityMonitorProperties");
+		Properties integrityMonitorProperties = new Properties();
+		integrityMonitorProperties.load(new FileInputStream(new File(
+				"src/test/server/config/IntegrityMonitor.properties")));
+		IntegrityMonitorProperties.initProperties(integrityMonitorProperties);
+		String thisPdpId = IntegrityMonitorProperties
+				.getProperty(IntegrityMonitorProperties.PDP_INSTANCE_ID);
+
+		PolicyLogger.debug("testLocking1: Reading xacmlPersistenceProperties");
+		Properties xacmlPersistenceProperties = new Properties();
+		xacmlPersistenceProperties.load(new FileInputStream(new File(
+				"src/test/server/config/xacmlPersistence.properties")));
+		XacmlPersistenceProperties.initProperties(xacmlPersistenceProperties);
+		
+		PolicyLogger.debug("testLocking1: Creating emfXacml");
+		EntityManagerFactory emfXacml = Persistence.createEntityManagerFactory(
+				"junitXacmlPU", xacmlPersistenceProperties);
+		
+		PolicyLogger.debug("testLocking1: Reading droolsPersistenceProperties");
+		Properties droolsPersistenceProperties = new Properties();
+		droolsPersistenceProperties.load(new FileInputStream(new File(
+				"src/test/server/config/droolsPersistence.properties")));
+		DroolsPersistenceProperties.initProperties(droolsPersistenceProperties);
+
+		PolicyLogger.debug("testLocking1: Creating emfDrools");
+		EntityManagerFactory emfDrools = Persistence.createEntityManagerFactory(
+				"junitDroolsPU", droolsPersistenceProperties);
+		
+		DroolsPdpsConnector conn = new JpaDroolsPdpsConnector(emfDrools);
+		
+		PolicyLogger.debug("testLocking1: Cleaning up tables");
+		conn.deleteAllSessions();
+		conn.deleteAllPdps();
+		
+		/*
+		 * Insert this PDP as designated.  Initial standby state will be 
+		 * either null or cold standby.   
+		 */
+		PolicyLogger.debug("testLocking1: Inserting PDP=" + thisPdpId + " as designated");
+		DroolsPdpImpl pdp = new DroolsPdpImpl(thisPdpId, true, 4, new Date());
+		conn.insertPdp(pdp);
+		DroolsPdpEntity droolsPdpEntity = conn.getPdp(thisPdpId);
+		PolicyLogger.debug("testLocking1: After insertion, PDP=" + thisPdpId + " has DESIGNATED="
+				+ droolsPdpEntity.isDesignated());
+		assertTrue(droolsPdpEntity.isDesignated() == true);
+		
+		PolicyLogger.debug("testLocking1: Instantiating stateManagement object");
+		StateManagement sm = new StateManagement(emfXacml, "dummy");
+		sm.deleteAllStateManagementEntities();
+		sm = new StateManagement(emfXacml, thisPdpId);
+		PMStandbyStateChangeNotifier pmStandbyStateChangeNotifier = new PMStandbyStateChangeNotifier();
+		sm.addObserver(pmStandbyStateChangeNotifier);
+				
+		PolicyLogger.debug("testLocking1: Running policy-management.Main class, designated="
+				+ conn.getPdp(thisPdpId).isDesignated());
+		PolicyManagementRunner policyManagementRunner = new PolicyManagementRunner();
+		policyManagementRunner.start();
+		
+		PolicyLogger.debug("testLocking1: Runner started; Sleeping "
+				+ interruptRecoveryTime + "ms before promoting PDP="
+				+ thisPdpId);
+		Thread.sleep(interruptRecoveryTime);
+
+		PolicyLogger.debug("testLocking1: Promoting PDP=" + thisPdpId);
+		sm.promote();
+
+		PolicyLogger.debug("testLocking1: Sleeping "
+				+ sleepTime
+				+ "ms, to allow time for policy-management.Main class to come up, designated="
+				+ conn.getPdp(thisPdpId).isDesignated());
+		Thread.sleep(sleepTime);
+		
+		PolicyLogger.debug("testLocking1: Waking up and invoking startTransaction on active PDP="
+				+ thisPdpId
+				+ ", designated="
+				+ conn.getPdp(thisPdpId).isDesignated());
+		DroolsPDPIntegrityMonitor droolsPdpIntegrityMonitor = (DroolsPDPIntegrityMonitor) IntegrityMonitor
+				.getInstance();
+		try {
+			droolsPdpIntegrityMonitor.startTransaction();
+			droolsPdpIntegrityMonitor.endTransaction();
+			PolicyLogger.debug("testLocking1: As expected, transaction successful");
+		} catch (AdministrativeStateException e) {
+			PolicyLogger.error("testLocking1: Unexpectedly caught AdministrativeStateException, message=" + e.getMessage());
+			assertTrue(false);
+		} catch (StandbyStatusException e) {
+			PolicyLogger.error("testLocking1: Unexpectedly caught StandbyStatusException, message=" + e.getMessage());
+			assertTrue(false);
+		} catch (Exception e) {
+			PolicyLogger.error("testLocking1: Unexpectedly caught Exception, message=" + e.getMessage());
+			assertTrue(false);
+		}
+		
+		// demoting should cause state to transit to hotstandby, followed by re-promotion,
+		// since there is only one PDP.
+		PolicyLogger.debug("testLocking1: demoting PDP=" + thisPdpId);
+		sm = droolsPdpIntegrityMonitor.getStateManager();
+		sm.demote();
+		
+		PolicyLogger.debug("testLocking1: sleeping" + electionWaitSleepTime
+				+ " to allow election handler to re-promote PDP=" + thisPdpId);
+		Thread.sleep(electionWaitSleepTime);
+								
+		PolicyLogger.debug("testLocking1: Invoking startTransaction on re-promoted PDP="
+				+ thisPdpId
+				+ ", designated="
+				+ conn.getPdp(thisPdpId).isDesignated());
+		try {
+			droolsPdpIntegrityMonitor.startTransaction();
+			droolsPdpIntegrityMonitor.endTransaction();
+			PolicyLogger.debug("testLocking1: As expected, transaction successful");
+		} catch (AdministrativeStateException e) {
+			PolicyLogger.error("testLocking1: Unexpectedly caught AdministrativeStateException, message=" + e.getMessage());
+			assertTrue(false);
+		} catch (StandbyStatusException e) {
+			PolicyLogger.error("testLocking1: Unexpectedly caught StandbyStatusException, message=" + e.getMessage());
+			assertTrue(false);
+		} catch (Exception e) {
+			PolicyLogger.error("testLocking1: Unexpectedly caught Exception, message=" + e.getMessage());
+			assertTrue(false);
+		}
+		
+		// locking should cause state to transit to cold standby
+		PolicyLogger.debug("testLocking1: locking PDP=" + thisPdpId);
+		sm.lock();
+		
+		// Just to avoid any race conditions, sleep a little after locking
+		PolicyLogger.debug("testLocking1: Sleeping a few millis after locking, to avoid race condition");
+		Thread.sleep(100);
+		
+		PolicyLogger.debug("testLocking1: Invoking startTransaction on locked PDP="
+				+ thisPdpId
+				+ ", designated="
+				+ conn.getPdp(thisPdpId).isDesignated());
+		try {
+			droolsPdpIntegrityMonitor.startTransaction();
+			PolicyLogger.error("testLocking1: startTransaction unexpectedly successful");
+			assertTrue(false);
+		} catch (AdministrativeStateException e) {
+			PolicyLogger.debug("testLocking1: As expected, caught AdministrativeStateException, message=" + e.getMessage());
+		} catch (StandbyStatusException e) {
+			PolicyLogger.error("testLocking1: Unexpectedly caught StandbyStatusException, message=" + e.getMessage());
+			assertTrue(false);
+		} catch (Exception e) {
+			PolicyLogger.error("testLocking1: Unexpectedly caught Exception, message=" + e.getMessage());
+			assertTrue(false);
+		} finally {
+			droolsPdpIntegrityMonitor.endTransaction();
+		}		
+		
+		// unlocking should cause state to transit to hot standby
+		PolicyLogger.debug("testLocking1: unlocking PDP=" + thisPdpId);
+		sm.unlock();
+		
+		// Just to avoid any race conditions, sleep a little after locking
+		PolicyLogger.debug("testLocking1: Sleeping a few millis after unlocking, to avoid race condition");
+		Thread.sleep(100);
+		
+		PolicyLogger.debug("testLocking1: Invoking startTransaction on unlocked PDP="
+				+ thisPdpId
+				+ ", designated="
+				+ conn.getPdp(thisPdpId).isDesignated());
+		try {
+			droolsPdpIntegrityMonitor.startTransaction();
+			PolicyLogger.error("testLocking1: startTransaction unexpectedly successful");
+			assertTrue(false);
+		} catch (AdministrativeStateException e) {
+			PolicyLogger.error("testLocking1: Unexpectedly caught AdministrativeStateException, message=" + e.getMessage());
+			assertTrue(false);
+		} catch (StandbyStatusException e) {
+			PolicyLogger.debug("testLocking1: As expected, caught StandbyStatusException, message=" + e.getMessage());
+		} catch (Exception e) {
+			PolicyLogger.error("testLocking1: Unexpectedly caught Exception, message=" + e.getMessage());
+			assertTrue(false);
+		} finally {
+			droolsPdpIntegrityMonitor.endTransaction();
+		}
+		
+		// promoting should cause state to transit to providing service
+		PolicyLogger.debug("testLocking1: promoting PDP=" + thisPdpId);
+		sm.promote();
+		
+		// Just to avoid any race conditions, sleep a little after promoting
+		PolicyLogger.debug("testLocking1: Sleeping a few millis after promoting, to avoid race condition");
+		Thread.sleep(100);
+		
+		PolicyLogger.debug("testLocking1: Invoking startTransaction on promoted PDP="
+				+ thisPdpId
+				+ ", designated="
+				+ conn.getPdp(thisPdpId).isDesignated());
+		try {
+			droolsPdpIntegrityMonitor.startTransaction();
+			droolsPdpIntegrityMonitor.endTransaction();
+			PolicyLogger.debug("testLocking1: As expected, transaction successful");
+		} catch (AdministrativeStateException e) {
+			PolicyLogger.error("testLocking1: Unexpectedly caught AdministrativeStateException, message=" + e.getMessage());
+			assertTrue(false);
+		} catch (StandbyStatusException e) {
+			PolicyLogger.error("testLocking1: Unexpectedly caught StandbyStatusException, message=" + e.getMessage());
+			assertTrue(false);
+		} catch (Exception e) {
+			PolicyLogger.error("testLocking1: Unexpectedly caught Exception, message=" + e.getMessage());
+			assertTrue(false);
+		}
+		
+		PolicyLogger.debug("testLocking1: Stopping policyManagementRunner");
+		policyManagementRunner.stopRunner();		
+
+		PolicyLogger.debug("\n\ntestLocking1: Exiting\n\n");
+		Thread.sleep(interruptRecoveryTime);
+
+	}
+	
+	/*
+	 * 1) Inserts and designates this PDP, then verifies that startTransaction
+	 * is successful.
+	 * 
+	 * 2) Inserts another PDP in hotstandby.
+	 * 
+	 * 3) Demotes this PDP, and verifies 1) that other PDP is not promoted (because one
+	 * PDP cannot promote another PDP) and 2) that this PDP is re-promoted.
+	 */
+	@Ignore
+	@Test
+	public void testLocking2() throws Exception {
+
+		PolicyLogger.debug("\n\ntestLocking2: Entering\n\n");
+		
+		PolicyLogger.debug("testLocking2: Reading IntegrityMonitorProperties");
+		Properties integrityMonitorProperties = new Properties();
+		integrityMonitorProperties.load(new FileInputStream(new File(
+				"src/test/server/config/IntegrityMonitor.properties")));
+		IntegrityMonitorProperties.initProperties(integrityMonitorProperties);
+		String thisPdpId = IntegrityMonitorProperties
+				.getProperty(IntegrityMonitorProperties.PDP_INSTANCE_ID);
+
+		PolicyLogger.debug("testLocking2: Reading xacmlPersistenceProperties");
+		Properties xacmlPersistenceProperties = new Properties();
+		xacmlPersistenceProperties.load(new FileInputStream(new File(
+				"src/test/server/config/xacmlPersistence.properties")));
+		XacmlPersistenceProperties.initProperties(xacmlPersistenceProperties);
+		
+		PolicyLogger.debug("testLocking2: Creating emfXacml");
+		EntityManagerFactory emfXacml = Persistence.createEntityManagerFactory(
+				"junitXacmlPU", xacmlPersistenceProperties);
+		
+		PolicyLogger.debug("testLocking2: Reading droolsPersistenceProperties");
+		Properties droolsPersistenceProperties = new Properties();
+		droolsPersistenceProperties.load(new FileInputStream(new File(
+				"src/test/server/config/droolsPersistence.properties")));
+		DroolsPersistenceProperties.initProperties(droolsPersistenceProperties);
+
+		PolicyLogger.debug("testLocking2: Creating emfDrools");
+		EntityManagerFactory emfDrools = Persistence.createEntityManagerFactory(
+				"junitDroolsPU", droolsPersistenceProperties);
+		
+		DroolsPdpsConnector conn = new JpaDroolsPdpsConnector(emfDrools);
+		
+		PolicyLogger.debug("testLocking2: Cleaning up tables");
+		conn.deleteAllSessions();
+		conn.deleteAllPdps();
+		
+		/*
+		 * Insert this PDP as designated.  Initial standby state will be 
+		 * either null or cold standby.   Demoting should transit state to
+		 * hot standby.
+		 */
+		PolicyLogger.debug("testLocking2: Inserting PDP=" + thisPdpId + " as designated");
+		DroolsPdpImpl pdp = new DroolsPdpImpl(thisPdpId, true, 3, new Date());
+		conn.insertPdp(pdp);
+		DroolsPdpEntity droolsPdpEntity = conn.getPdp(thisPdpId);
+		PolicyLogger.debug("testLocking2: After insertion, PDP=" + thisPdpId + " has DESIGNATED="
+				+ droolsPdpEntity.isDesignated());
+		assertTrue(droolsPdpEntity.isDesignated() == true);
+		
+		PolicyLogger.debug("testLocking2: Instantiating stateManagement object and promoting PDP=" + thisPdpId);
+		StateManagement sm = new StateManagement(emfXacml, "dummy");
+		sm.deleteAllStateManagementEntities();
+		sm = new StateManagement(emfXacml, thisPdpId);
+		PMStandbyStateChangeNotifier pmStandbyStateChangeNotifier = new PMStandbyStateChangeNotifier();
+		sm.addObserver(pmStandbyStateChangeNotifier);
+				
+		/*
+		 * Insert another PDP as not designated.  Initial standby state will be 
+		 * either null or cold standby.   Demoting should transit state to
+		 * hot standby.
+		 */
+		String standbyPdpId = "pdp2";
+		PolicyLogger.debug("testLocking2: Inserting PDP=" + standbyPdpId + " as not designated");
+		Date yesterday = DateUtils.addDays(new Date(), -1);
+		pdp = new DroolsPdpImpl(standbyPdpId, false, 4, yesterday);
+		conn.insertPdp(pdp);
+		droolsPdpEntity = conn.getPdp(standbyPdpId);
+		PolicyLogger.debug("testLocking2: After insertion, PDP=" + standbyPdpId + " has DESIGNATED="
+				+ droolsPdpEntity.isDesignated());
+		assertTrue(droolsPdpEntity.isDesignated() == false);
+		
+		PolicyLogger.debug("testLocking2: Demoting PDP=" + standbyPdpId);
+		StateManagement sm2 = new StateManagement(emfXacml, standbyPdpId);
+		sm2.addObserver(pmStandbyStateChangeNotifier);
+				
+		PolicyLogger.debug("testLocking2: Running policy-management.Main class");
+		PolicyManagementRunner policyManagementRunner = new PolicyManagementRunner();
+		policyManagementRunner.start();
+		
+		PolicyLogger.debug("testLocking2: Runner started; Sleeping "
+				+ interruptRecoveryTime + "ms before promoting/demoting");
+		Thread.sleep(interruptRecoveryTime);
+
+		PolicyLogger.debug("testLocking2: Promoting PDP=" + thisPdpId);
+		sm.promote();
+
+		// demoting PDP should ensure that state transits to hotstandby
+		PolicyLogger.debug("testLocking2: Demoting PDP=" + standbyPdpId);
+		sm2.demote();
+		
+		PolicyLogger.debug("testLocking2: Sleeping "
+				+ sleepTime
+				+ "ms, to allow time for policy-management.Main class to come up");
+		Thread.sleep(sleepTime);
+		
+		PolicyLogger.debug("testLocking2: Waking up and invoking startTransaction on active PDP="
+				+ thisPdpId
+				+ ", designated="
+				+ conn.getPdp(thisPdpId).isDesignated());
+		DroolsPDPIntegrityMonitor droolsPdpIntegrityMonitor = (DroolsPDPIntegrityMonitor) IntegrityMonitor
+				.getInstance();
+		try {
+			droolsPdpIntegrityMonitor.startTransaction();
+			droolsPdpIntegrityMonitor.endTransaction();
+			PolicyLogger.debug("testLocking2: As expected, transaction successful");
+		} catch (AdministrativeStateException e) {
+			PolicyLogger.error("testLocking2: Unexpectedly caught AdministrativeStateException, message=" + e.getMessage());
+			assertTrue(false);
+		} catch (StandbyStatusException e) {
+			PolicyLogger.error("testLocking2: Unexpectedly caught StandbyStatusException, message=" + e.getMessage());
+			assertTrue(false);
+		} catch (Exception e) {
+			PolicyLogger.error("testLocking2: Unexpectedly caught Exception, message=" + e.getMessage());
+			assertTrue(false);
+		}
+		
+		// demoting should cause state to transit to hotstandby followed by re-promotion.
+		PolicyLogger.debug("testLocking2: demoting PDP=" + thisPdpId);
+		sm = droolsPdpIntegrityMonitor.getStateManager();
+		sm.demote();
+		
+		PolicyLogger.debug("testLocking2: sleeping" + electionWaitSleepTime
+				+ " to allow election handler to re-promote PDP=" + thisPdpId);
+		Thread.sleep(electionWaitSleepTime);
+		
+		PolicyLogger.debug("testLocking2: Waking up and invoking startTransaction on re-promoted PDP="
+				+ thisPdpId + ", designated="
+				+ conn.getPdp(thisPdpId).isDesignated());
+		try {
+			droolsPdpIntegrityMonitor.startTransaction();
+			droolsPdpIntegrityMonitor.endTransaction();
+			PolicyLogger.debug("testLocking2: As expected, transaction successful");
+		} catch (AdministrativeStateException e) {
+			PolicyLogger.error("testLocking2: Unexpectedly caught AdministrativeStateException, message=" + e.getMessage());
+			assertTrue(false);
+		} catch (StandbyStatusException e) {
+			PolicyLogger.error("testLocking2: Unexpectedly caught StandbyStatusException, message=" + e.getMessage());
+			assertTrue(false);
+		} catch (Exception e) {
+			PolicyLogger.error("testLocking2: Unexpectedly caught Exception, message=" + e.getMessage());
+			assertTrue(false);
+		}
+		
+		PolicyLogger.debug("testLocking2: Verifying designated status for PDP="
+				+ standbyPdpId);
+		boolean standbyPdpDesignated = conn.getPdp(standbyPdpId).isDesignated();
+		assertTrue(standbyPdpDesignated == false);
+		
+		PolicyLogger.debug("testLocking2: Stopping policyManagementRunner");
+		policyManagementRunner.stopRunner();		
+
+		PolicyLogger.debug("\n\ntestLocking2: Exiting\n\n");
+		Thread.sleep(interruptRecoveryTime);
+
+	}
+	
+	private class PolicyManagementRunner extends Thread {
+
+		public void run() {
+			PolicyLogger.debug("PolicyManagementRunner.run: Entering");
+			String args[] = { "src/main/server/config" };
+			try {
+				Main.main(args);
+			} catch (Exception e) {
+				PolicyLogger
+						.debug("PolicyManagementRunner.run: Exception thrown from Main.main(), message="
+								+ e.getMessage());
+			}
+			PolicyLogger.debug("PolicyManagementRunner.run: Exiting");
+		}
+		
+		public void stopRunner() {
+			PolicyEngine.manager.shutdown();
+		}
+
+	}
+	
+}
diff --git a/policy-persistence/src/test/java/org/openecomp/policy/drools/controller/test/StandbyStateManagementTest.java b/policy-persistence/src/test/java/org/openecomp/policy/drools/controller/test/StandbyStateManagementTest.java
new file mode 100644
index 0000000..af64986
--- /dev/null
+++ b/policy-persistence/src/test/java/org/openecomp/policy/drools/controller/test/StandbyStateManagementTest.java
@@ -0,0 +1,887 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * policy-persistence
+ * ================================================================================
+ * 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.openecomp.policy.drools.controller.test;
+
+import static org.junit.Assert.assertTrue;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.util.Date;
+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.Ignore;
+import org.junit.Test;
+
+import org.openecomp.policy.common.logging.eelf.PolicyLogger;
+import org.openecomp.policy.common.im.AdministrativeStateException;
+import org.openecomp.policy.common.im.IntegrityMonitor;
+import org.openecomp.policy.common.im.StandbyStatusException;
+import org.openecomp.policy.common.im.StateManagement;
+import org.openecomp.policy.drools.core.DroolsPDPIntegrityMonitor;
+import org.openecomp.policy.drools.core.IntegrityMonitorProperties;
+import org.openecomp.policy.drools.core.PolicyContainer;
+import org.openecomp.policy.drools.im.PMStandbyStateChangeNotifier;
+import org.openecomp.policy.drools.persistence.DroolsPdp;
+import org.openecomp.policy.drools.persistence.DroolsPdpEntity;
+import org.openecomp.policy.drools.persistence.DroolsPdpImpl;
+import org.openecomp.policy.drools.persistence.DroolsPdpsConnector;
+import org.openecomp.policy.drools.persistence.JpaDroolsPdpsConnector;
+import org.openecomp.policy.drools.persistence.DroolsPersistenceProperties;
+import org.openecomp.policy.drools.persistence.XacmlPersistenceProperties;
+import org.openecomp.policy.drools.system.Main;
+import org.openecomp.policy.drools.system.PolicyEngine;
+
+import org.apache.commons.lang3.time.DateUtils;
+
+/*
+ * Cloned from StandbyStateManagement.java in support of US673632.
+ * See MultiSite_v1-10.ppt, slide 38
+ */
+public class StandbyStateManagementTest {
+			
+	/*
+	 * Currently, the DroolsPdpsElectionHandler.DesignationWaiter is invoked every ten seconds, starting 
+	 * at ten seconds after the minute boundary (e.g. 13:05:10). So, an 80 second sleep should be 
+	 * sufficient to ensure that we wait for the DesignationWaiter to do its job, before 
+	 * checking the results. 
+	 */
+	long sleepTime = 80000;
+	
+	/*
+	 * DroolsPdpsElectionHandler runs every ten seconds, so a 15 second sleep should be 
+	 * plenty to ensure it has time to re-promote this PDP.
+	 */
+	long electionWaitSleepTime = 15000;
+	
+	/*
+	 * Sleep 5 seconds after each test to allow interrupt (shutdown) recovery.
+	 */
+	long interruptRecoveryTime = 5000;
+
+	/*
+	 * See the IntegrityMonitor.getJmxUrl() method for the rationale behind this jmx related processing.
+	 */
+	@BeforeClass
+	public static void setUpClass() throws Exception {
+		
+		String userDir = System.getProperty("user.dir");
+		PolicyLogger.debug("setUpClass: userDir=" + userDir);
+		System.setProperty("com.sun.management.jmxremote.port", "9980");
+		System.setProperty("com.sun.management.jmxremote.authenticate","false");
+				
+		// Make sure path to config directory is set correctly in PolicyContainer.main
+		// Also make sure we ignore HTTP server failures resulting from port conflicts.
+		PolicyContainer.isUnitTesting = true;
+		
+	}
+
+	@AfterClass
+	public static void tearDownClass() throws Exception {
+	}
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+				
+	}
+
+	@Ignore
+	@Test
+	public void testColdStandby() throws Exception {
+
+		PolicyLogger.debug("\n\ntestColdStandby: Entering\n\n");
+
+		PolicyLogger.debug("testColdStandby: Reading IntegrityMonitorProperties");
+		Properties integrityMonitorProperties = new Properties();
+		integrityMonitorProperties.load(new FileInputStream(new File(
+				"src/test/server/config/IntegrityMonitor.properties")));
+		IntegrityMonitorProperties.initProperties(integrityMonitorProperties);
+		String thisPdpId = IntegrityMonitorProperties
+				.getProperty(IntegrityMonitorProperties.PDP_INSTANCE_ID);
+
+		PolicyLogger.debug("testColdStandby: Reading xacmlPersistenceProperties");
+		Properties xacmlPersistenceProperties = new Properties();
+		xacmlPersistenceProperties.load(new FileInputStream(new File(
+				"src/test/server/config/xacmlPersistence.properties")));
+		XacmlPersistenceProperties.initProperties(xacmlPersistenceProperties);
+		
+		PolicyLogger.debug("testColdStandby: Creating emfXacml");
+		EntityManagerFactory emfXacml = Persistence.createEntityManagerFactory(
+				"junitXacmlPU", xacmlPersistenceProperties);
+		
+		PolicyLogger.debug("testColdStandby: Reading droolsPersistenceProperties");
+		Properties droolsPersistenceProperties = new Properties();
+		droolsPersistenceProperties.load(new FileInputStream(new File(
+				"src/test/server/config/droolsPersistence.properties")));
+		DroolsPersistenceProperties.initProperties(droolsPersistenceProperties);
+
+		PolicyLogger.debug("testColdStandby: Creating emfDrools");
+		EntityManagerFactory emfDrools = Persistence.createEntityManagerFactory(
+				"junitDroolsPU", droolsPersistenceProperties);
+		
+		DroolsPdpsConnector conn = new JpaDroolsPdpsConnector(emfDrools);
+		
+		PolicyLogger.debug("testColdStandby: Cleaning up tables");
+		conn.deleteAllSessions();
+		conn.deleteAllPdps();
+	
+		PolicyLogger.debug("testColdStandby: Inserting PDP=" + thisPdpId + " as designated");
+		DroolsPdp pdp = new DroolsPdpImpl(thisPdpId, true, 4, new Date());
+		conn.insertPdp(pdp);
+		DroolsPdpEntity droolsPdpEntity = conn.getPdp(thisPdpId);
+		PolicyLogger.debug("testColdStandby: After insertion, DESIGNATED="
+				+ droolsPdpEntity.isDesignated() + " for PDP=" + thisPdpId);
+		assertTrue(droolsPdpEntity.isDesignated() == true);
+
+		/*
+		 * When the Standby Status changes (from providingservice) to hotstandby
+		 * or coldstandby,the Active/Standby selection algorithm must stand down
+		 * if thePDP-D is currently the lead/active node and allow another PDP-D
+		 * to take over.
+		 * 
+		 * It must also call lock on all engines in the engine management.
+		 * 
+		 * Yes, this is kludgy, but we have a chicken and egg problem here: we
+		 * need a StateManagement object to invoke the
+		 * deleteAllStateManagementEntities method.
+		 */
+		PolicyLogger.debug("testColdStandby: Instantiating stateManagement object");
+		StateManagement sm = new StateManagement(emfXacml, "dummy");
+		sm.deleteAllStateManagementEntities();
+		sm = new StateManagement(emfXacml, thisPdpId);
+		PMStandbyStateChangeNotifier pmStandbyStateChangeNotifier = new PMStandbyStateChangeNotifier();
+		sm.addObserver(pmStandbyStateChangeNotifier);
+		
+		// Artificially putting a PDP into service is really a two step process, 1)
+		// inserting it as designated and 2) promoting it so that its standbyStatus
+		// is providing service.
+		
+		PolicyLogger.debug("testColdStandby: Running policy-management.Main class");
+		PolicyManagementRunner policyManagementRunner = new PolicyManagementRunner();
+		policyManagementRunner.start();
+		
+		PolicyLogger.debug("testColdStandby: Runner started; Sleeping "
+				+ interruptRecoveryTime + "ms before promoting PDP="
+				+ thisPdpId);
+		Thread.sleep(interruptRecoveryTime);
+
+		PolicyLogger.debug("testColdStandby: Promoting PDP=" + thisPdpId);
+		sm.promote();		
+		
+		String standbyStatus = sm.getStandbyStatus(thisPdpId);
+		PolicyLogger.debug("testColdStandby: Before locking, PDP=" + thisPdpId + " has standbyStatus="
+				+ standbyStatus);
+		
+		PolicyLogger.debug("testColdStandby: Locking sm");
+		sm.lock();
+		
+		Thread.sleep(interruptRecoveryTime);
+		/*
+		 * Verify that the PDP is no longer designated.
+		 */
+		droolsPdpEntity = conn.getPdp(thisPdpId);
+		PolicyLogger.debug("testColdStandby: After lock sm.lock() invoked, DESIGNATED="
+				+ droolsPdpEntity.isDesignated() + " for PDP=" + thisPdpId);
+		assertTrue(droolsPdpEntity.isDesignated() == false);
+		
+		PolicyLogger.debug("testColdStandby: Stopping policyManagementRunner");
+		policyManagementRunner.stopRunner();
+	
+		PolicyLogger.debug("\n\ntestColdStandby: Exiting\n\n");
+		Thread.sleep(interruptRecoveryTime);
+
+	}
+	
+	/*
+	 * Tests hot standby when there is only one PDP.
+	 */
+	@Ignore
+	@Test
+	public void testHotStandby1() throws Exception {
+	
+		PolicyLogger.debug("\n\ntestHotStandby1: Entering\n\n");
+		
+		PolicyLogger.debug("testHotStandby1: Reading IntegrityMonitorProperties");
+		Properties integrityMonitorProperties = new Properties();
+		integrityMonitorProperties.load(new FileInputStream(new File(
+				"src/test/server/config/IntegrityMonitor.properties")));
+		IntegrityMonitorProperties.initProperties(integrityMonitorProperties);
+		String thisPdpId = IntegrityMonitorProperties
+				.getProperty(IntegrityMonitorProperties.PDP_INSTANCE_ID);
+		
+		PolicyLogger.debug("testHotStandby1: Reading xacmlPersistenceProperties");
+		Properties xacmlPersistenceProperties = new Properties();
+		xacmlPersistenceProperties.load(new FileInputStream(new File(
+				"src/test/server/config/xacmlPersistence.properties")));
+		XacmlPersistenceProperties.initProperties(xacmlPersistenceProperties);
+		
+		PolicyLogger.debug("testHotStandby1: Creating emfXacml");
+		EntityManagerFactory emfXacml = Persistence.createEntityManagerFactory(
+				"junitXacmlPU", xacmlPersistenceProperties);
+		
+		PolicyLogger.debug("testHotStandby1: Reading droolsPersistenceProperties");
+		Properties droolsPersistenceProperties = new Properties();
+		droolsPersistenceProperties.load(new FileInputStream(new File(
+				"src/test/server/config/droolsPersistence.properties")));
+		DroolsPersistenceProperties.initProperties(droolsPersistenceProperties);
+
+		PolicyLogger.debug("testHotStandby1: Creating emfDrools");
+		EntityManagerFactory emfDrools = Persistence.createEntityManagerFactory(
+				"junitDroolsPU", droolsPersistenceProperties);
+		
+		DroolsPdpsConnector conn = new JpaDroolsPdpsConnector(emfDrools);
+		
+		PolicyLogger.debug("testHotStandby1: Cleaning up tables");
+		conn.deleteAllSessions();
+		conn.deleteAllPdps();
+					
+		/*
+		 * Insert this PDP as not designated.  Initial standby state will be 
+		 * either null or cold standby.   Demoting should transit state to
+		 * hot standby.
+		 */
+		PolicyLogger.debug("testHotStandby1: Inserting PDP=" + thisPdpId + " as not designated");
+		Date yesterday = DateUtils.addDays(new Date(), -1);
+		DroolsPdpImpl pdp = new DroolsPdpImpl(thisPdpId, false, 4, yesterday);
+		conn.insertPdp(pdp);
+		DroolsPdpEntity droolsPdpEntity = conn.getPdp(thisPdpId);
+		PolicyLogger.debug("testHotStandby1: After insertion, PDP=" + thisPdpId + " has DESIGNATED="
+				+ droolsPdpEntity.isDesignated());
+		assertTrue(droolsPdpEntity.isDesignated() == false);
+		
+		PolicyLogger.debug("testHotStandby1: Instantiating stateManagement object");
+		StateManagement sm = new StateManagement(emfXacml, "dummy");
+		sm.deleteAllStateManagementEntities();
+		sm = new StateManagement(emfXacml, thisPdpId);
+		PMStandbyStateChangeNotifier pmStandbyStateChangeNotifier = new PMStandbyStateChangeNotifier();
+		sm.addObserver(pmStandbyStateChangeNotifier);
+
+		PolicyLogger.debug("testHotStandby1: Demoting PDP=" + thisPdpId);
+		// demoting should cause state to transit to hotstandby
+		sm.demote();
+		
+		PolicyLogger.debug("testHotStandby1: Running policy-management.Main class");
+		PolicyManagementRunner policyManagementRunner = new PolicyManagementRunner();
+		policyManagementRunner.start();
+				
+		PolicyLogger.debug("testHotStandby1: Sleeping "
+				+ sleepTime
+				+ "ms, to allow JpaDroolsPdpsConnector time to check droolspdpentity table");
+		Thread.sleep(sleepTime);
+		
+		/*
+		 * Verify that this formerly un-designated PDP in HOT_STANDBY is now designated and providing service.
+		 */
+		droolsPdpEntity = conn.getPdp(thisPdpId);
+		PolicyLogger.debug("testHotStandby1: After sm.demote() invoked, DESIGNATED="
+				+ droolsPdpEntity.isDesignated() + " for PDP=" + thisPdpId);
+		assertTrue(droolsPdpEntity.isDesignated() == true);
+		String standbyStatus = sm.getStandbyStatus(thisPdpId);
+		PolicyLogger.debug("testHotStandby1: After demotion, PDP=" + thisPdpId + " has standbyStatus="
+				+ standbyStatus);
+		assertTrue(standbyStatus != null  &&  standbyStatus.equals(StateManagement.PROVIDING_SERVICE));
+				
+		PolicyLogger.debug("testHotStandby1: Stopping policyManagementRunner");
+		policyManagementRunner.stopRunner();		
+	
+		PolicyLogger.debug("\n\ntestHotStandby1: Exiting\n\n");
+		Thread.sleep(interruptRecoveryTime);
+
+	}
+
+	/*
+	 * Tests hot standby when two PDPs are involved.
+	 */
+	@Ignore
+	@Test
+	public void testHotStandby2() throws Exception {
+
+		PolicyLogger.info("\n\ntestHotStandby2: Entering\n\n");
+		
+		PolicyLogger.info("testHotStandby2: Reading IntegrityMonitorProperties");
+		Properties integrityMonitorProperties = new Properties();
+		integrityMonitorProperties.load(new FileInputStream(new File(
+				"src/test/server/config/IntegrityMonitor.properties")));
+		IntegrityMonitorProperties.initProperties(integrityMonitorProperties);
+		String thisPdpId = IntegrityMonitorProperties
+				.getProperty(IntegrityMonitorProperties.PDP_INSTANCE_ID);
+		
+		PolicyLogger.info("testHotStandby2: Reading xacmlPersistenceProperties");
+		Properties xacmlPersistenceProperties = new Properties();
+		xacmlPersistenceProperties.load(new FileInputStream(new File(
+				"src/test/server/config/xacmlPersistence.properties")));
+		XacmlPersistenceProperties.initProperties(xacmlPersistenceProperties);
+		
+		PolicyLogger.info("testHotStandby2: Creating emfXacml");
+		EntityManagerFactory emfXacml = Persistence.createEntityManagerFactory(
+				"junitXacmlPU", xacmlPersistenceProperties);
+		
+		PolicyLogger.info("testHotStandby2: Reading droolsPersistenceProperties");
+		Properties droolsPersistenceProperties = new Properties();
+		droolsPersistenceProperties.load(new FileInputStream(new File(
+				"src/test/server/config/droolsPersistence.properties")));
+		DroolsPersistenceProperties.initProperties(droolsPersistenceProperties);
+
+		PolicyLogger.info("testHotStandby2: Creating emfDrools");
+		EntityManagerFactory emfDrools = Persistence.createEntityManagerFactory(
+				"junitDroolsPU", droolsPersistenceProperties);
+		
+		DroolsPdpsConnector conn = new JpaDroolsPdpsConnector(emfDrools);
+		
+		PolicyLogger.info("testHotStandby2: Cleaning up tables");
+		conn.deleteAllSessions();
+		conn.deleteAllPdps();
+		
+		/*
+		 * Insert a PDP that's designated but not current.
+		 */
+		String activePdpId = "pdp2";
+		PolicyLogger.info("testHotStandby2: Inserting PDP=" + activePdpId + " as stale, designated PDP");
+		Date yesterday = DateUtils.addDays(new Date(), -1);
+		DroolsPdp pdp = new DroolsPdpImpl(activePdpId, true, 4, yesterday);
+		conn.insertPdp(pdp);
+		DroolsPdpEntity droolsPdpEntity = conn.getPdp(activePdpId);
+		PolicyLogger.info("testHotStandby2: After insertion, PDP=" + activePdpId + ", which is not current, has DESIGNATED="
+				+ droolsPdpEntity.isDesignated());
+		assertTrue(droolsPdpEntity.isDesignated() == true);
+		
+		/*
+		 * Promote the designated PDP.
+		 * 
+		 * We have a chicken and egg problem here: we need a StateManagement
+		 * object to invoke the deleteAllStateManagementEntities method.
+		 */
+		PolicyLogger.info("testHotStandy2: Promoting PDP=" + activePdpId);
+		StateManagement sm = new StateManagement(emfXacml, "dummy");
+		sm.deleteAllStateManagementEntities();
+		sm = new StateManagement(emfXacml, activePdpId);//pdp2
+		PMStandbyStateChangeNotifier pmStandbyStateChangeNotifier = new PMStandbyStateChangeNotifier();
+		sm.addObserver(pmStandbyStateChangeNotifier);
+		
+		// Artificially putting a PDP into service is really a two step process, 1)
+		// inserting it as designated and 2) promoting it so that its standbyStatus
+		// is providing service.
+				
+		/*
+		 * Insert this PDP as not designated.  Initial standby state will be 
+		 * either null or cold standby.   Demoting should transit state to
+		 * hot standby.
+		 */
+		PolicyLogger.info("testHotStandby2: Inserting PDP=" + thisPdpId + " as not designated");
+		pdp = new DroolsPdpImpl(thisPdpId, false, 4, yesterday);
+		conn.insertPdp(pdp);
+		droolsPdpEntity = conn.getPdp(thisPdpId);
+		PolicyLogger.info("testHotStandby2: After insertion, PDP=" + thisPdpId + " has DESIGNATED="
+				+ droolsPdpEntity.isDesignated());
+		assertTrue(droolsPdpEntity.isDesignated() == false);
+		
+		PolicyLogger.info("testHotStandby2: Demoting PDP=" + thisPdpId);//pdp1
+		StateManagement sm2 = new StateManagement(emfXacml, thisPdpId);
+		sm2.addObserver(pmStandbyStateChangeNotifier);
+		
+		PolicyLogger.info("testHotStandby2: Running policy-management.Main class");
+		PolicyManagementRunner policyManagementRunner = new PolicyManagementRunner(); //pdp1
+		policyManagementRunner.start();
+		
+		PolicyLogger.info("testHotStandby2: Runner started; Sleeping "
+				+ interruptRecoveryTime + "ms before promoting/demoting");
+		Thread.sleep(interruptRecoveryTime);
+
+		PolicyLogger.info("testHotStandby2: Runner started; promoting PDP=" + activePdpId);//pdpd2xs
+		//at this point, the newly created pdp will have set the state to disabled/failed/cold standby
+		//because it is stale. So, it cannot be promoted.  We need to call sm.enableNotFailed() so we
+		//can promote it and demote the other pdp - else the other pdp will just spring back to providingservice
+		sm.enableNotFailed();//pdp1
+		sm.promote();
+		String standbyStatus = sm.getStandbyStatus(activePdpId);
+		PolicyLogger.info("testHotStandby2: After promoting, PDP=" + activePdpId + " has standbyStatus="
+				+ standbyStatus);
+		
+		// demoting PDP should ensure that state transits to hotstandby
+		PolicyLogger.info("testHotStandby2: Runner started; demoting PDP=" + thisPdpId);
+		sm2.demote();//pdp1
+		standbyStatus = sm.getStandbyStatus(thisPdpId);
+		PolicyLogger.info("testHotStandby2: After demoting, PDP=" + thisPdpId + " has standbyStatus="
+				+ standbyStatus);
+		
+		PolicyLogger.info("testHotStandby2: Sleeping "
+				+ sleepTime
+				+ "ms, to allow JpaDroolsPdpsConnector time to check droolspdpentity table");
+		Thread.sleep(sleepTime);
+		
+		/*
+		 * Verify that this PDP, demoted to HOT_STANDBY, is now
+		 * re-designated and providing service.
+		 */
+		droolsPdpEntity = conn.getPdp(thisPdpId);
+		PolicyLogger.info("testHotStandby2: After demoting PDP=" + activePdpId
+				+ ", DESIGNATED=" + droolsPdpEntity.isDesignated()
+				+ " for PDP=" + thisPdpId);
+		assertTrue(droolsPdpEntity.isDesignated() == true);
+		standbyStatus = sm2.getStandbyStatus(thisPdpId);
+		PolicyLogger.info("testHotStandby2: After demoting PDP=" + activePdpId
+				+ ", PDP=" + thisPdpId + " has standbyStatus=" + standbyStatus);
+		assertTrue(standbyStatus != null
+				&& standbyStatus.equals(StateManagement.PROVIDING_SERVICE));
+				
+		PolicyLogger.info("testHotStandby2: Stopping policyManagementRunner");
+		policyManagementRunner.stopRunner();		
+
+		PolicyLogger.info("\n\ntestHotStandby2: Exiting\n\n");
+		Thread.sleep(interruptRecoveryTime);
+
+	}
+	
+	/*
+	 * 1) Inserts and designates this PDP, then verifies that startTransaction
+	 * is successful.
+	 * 
+	 * 2) Demotes PDP, and verifies that because there is only one PDP, it will
+	 * be immediately re-promoted, thus allowing startTransaction to be
+	 * successful.
+	 * 
+	 * 3) Locks PDP and verifies that startTransaction results in
+	 * AdministrativeStateException.
+	 * 
+	 * 4) Unlocks PDP and verifies that startTransaction results in
+	 * StandbyStatusException.
+	 * 
+	 * 5) Promotes PDP and verifies that startTransaction is once again
+	 * successful.
+	 */
+	@Ignore
+	@Test
+	public void testLocking1() throws Exception {
+				
+		PolicyLogger.debug("testLocking1: Reading IntegrityMonitorProperties");
+		Properties integrityMonitorProperties = new Properties();
+		integrityMonitorProperties.load(new FileInputStream(new File(
+				"src/test/server/config/IntegrityMonitor.properties")));
+		IntegrityMonitorProperties.initProperties(integrityMonitorProperties);
+		String thisPdpId = IntegrityMonitorProperties
+				.getProperty(IntegrityMonitorProperties.PDP_INSTANCE_ID);
+
+		PolicyLogger.debug("testLocking1: Reading xacmlPersistenceProperties");
+		Properties xacmlPersistenceProperties = new Properties();
+		xacmlPersistenceProperties.load(new FileInputStream(new File(
+				"src/test/server/config/xacmlPersistence.properties")));
+		XacmlPersistenceProperties.initProperties(xacmlPersistenceProperties);
+		
+		PolicyLogger.debug("testLocking1: Creating emfXacml");
+		EntityManagerFactory emfXacml = Persistence.createEntityManagerFactory(
+				"junitXacmlPU", xacmlPersistenceProperties);
+		
+		PolicyLogger.debug("testLocking1: Reading droolsPersistenceProperties");
+		Properties droolsPersistenceProperties = new Properties();
+		droolsPersistenceProperties.load(new FileInputStream(new File(
+				"src/test/server/config/droolsPersistence.properties")));
+		DroolsPersistenceProperties.initProperties(droolsPersistenceProperties);
+
+		PolicyLogger.debug("testLocking1: Creating emfDrools");
+		EntityManagerFactory emfDrools = Persistence.createEntityManagerFactory(
+				"junitDroolsPU", droolsPersistenceProperties);
+		
+		DroolsPdpsConnector conn = new JpaDroolsPdpsConnector(emfDrools);
+		
+		PolicyLogger.debug("testLocking1: Cleaning up tables");
+		conn.deleteAllSessions();
+		conn.deleteAllPdps();
+		
+		/*
+		 * Insert this PDP as designated.  Initial standby state will be 
+		 * either null or cold standby.   
+		 */
+		PolicyLogger.debug("testLocking1: Inserting PDP=" + thisPdpId + " as designated");
+		DroolsPdpImpl pdp = new DroolsPdpImpl(thisPdpId, true, 4, new Date());
+		conn.insertPdp(pdp);
+		DroolsPdpEntity droolsPdpEntity = conn.getPdp(thisPdpId);
+		PolicyLogger.debug("testLocking1: After insertion, PDP=" + thisPdpId + " has DESIGNATED="
+				+ droolsPdpEntity.isDesignated());
+		assertTrue(droolsPdpEntity.isDesignated() == true);
+		
+		PolicyLogger.debug("testLocking1: Instantiating stateManagement object");
+		StateManagement sm = new StateManagement(emfXacml, "dummy");
+		sm.deleteAllStateManagementEntities();
+		sm = new StateManagement(emfXacml, thisPdpId);
+		PMStandbyStateChangeNotifier pmStandbyStateChangeNotifier = new PMStandbyStateChangeNotifier();
+		sm.addObserver(pmStandbyStateChangeNotifier);
+				
+		PolicyLogger.debug("testLocking1: Running policy-management.Main class, designated="
+				+ conn.getPdp(thisPdpId).isDesignated());
+		PolicyManagementRunner policyManagementRunner = new PolicyManagementRunner();
+		policyManagementRunner.start();
+		
+		PolicyLogger.debug("testLocking1: Runner started; Sleeping "
+				+ interruptRecoveryTime + "ms before promoting PDP="
+				+ thisPdpId);
+		Thread.sleep(interruptRecoveryTime);
+
+		PolicyLogger.debug("testLocking1: Promoting PDP=" + thisPdpId);
+		sm.promote();
+
+		PolicyLogger.debug("testLocking1: Sleeping "
+				+ sleepTime
+				+ "ms, to allow time for policy-management.Main class to come up, designated="
+				+ conn.getPdp(thisPdpId).isDesignated());
+		Thread.sleep(sleepTime);
+		
+		PolicyLogger.debug("testLocking1: Waking up and invoking startTransaction on active PDP="
+				+ thisPdpId
+				+ ", designated="
+				+ conn.getPdp(thisPdpId).isDesignated());
+		DroolsPDPIntegrityMonitor droolsPdpIntegrityMonitor = (DroolsPDPIntegrityMonitor) IntegrityMonitor
+				.getInstance();
+		try {
+			droolsPdpIntegrityMonitor.startTransaction();
+			droolsPdpIntegrityMonitor.endTransaction();
+			PolicyLogger.debug("testLocking1: As expected, transaction successful");
+		} catch (AdministrativeStateException e) {
+			PolicyLogger.error("testLocking1: Unexpectedly caught AdministrativeStateException, message=" + e.getMessage());
+			assertTrue(false);
+		} catch (StandbyStatusException e) {
+			PolicyLogger.error("testLocking1: Unexpectedly caught StandbyStatusException, message=" + e.getMessage());
+			assertTrue(false);
+		} catch (Exception e) {
+			PolicyLogger.error("testLocking1: Unexpectedly caught Exception, message=" + e.getMessage());
+			assertTrue(false);
+		}
+		
+		// demoting should cause state to transit to hotstandby, followed by re-promotion,
+		// since there is only one PDP.
+		PolicyLogger.debug("testLocking1: demoting PDP=" + thisPdpId);
+		sm = droolsPdpIntegrityMonitor.getStateManager();
+		sm.demote();
+		
+		PolicyLogger.debug("testLocking1: sleeping" + electionWaitSleepTime
+				+ " to allow election handler to re-promote PDP=" + thisPdpId);
+		Thread.sleep(electionWaitSleepTime);
+								
+		PolicyLogger.debug("testLocking1: Invoking startTransaction on re-promoted PDP="
+				+ thisPdpId
+				+ ", designated="
+				+ conn.getPdp(thisPdpId).isDesignated());
+		try {
+			droolsPdpIntegrityMonitor.startTransaction();
+			droolsPdpIntegrityMonitor.endTransaction();
+			PolicyLogger.debug("testLocking1: As expected, transaction successful");
+		} catch (AdministrativeStateException e) {
+			PolicyLogger.error("testLocking1: Unexpectedly caught AdministrativeStateException, message=" + e.getMessage());
+			assertTrue(false);
+		} catch (StandbyStatusException e) {
+			PolicyLogger.error("testLocking1: Unexpectedly caught StandbyStatusException, message=" + e.getMessage());
+			assertTrue(false);
+		} catch (Exception e) {
+			PolicyLogger.error("testLocking1: Unexpectedly caught Exception, message=" + e.getMessage());
+			assertTrue(false);
+		}
+		
+		// locking should cause state to transit to cold standby
+		PolicyLogger.debug("testLocking1: locking PDP=" + thisPdpId);
+		sm.lock();
+		
+		// Just to avoid any race conditions, sleep a little after locking
+		PolicyLogger.debug("testLocking1: Sleeping a few millis after locking, to avoid race condition");
+		Thread.sleep(100);
+		
+		PolicyLogger.debug("testLocking1: Invoking startTransaction on locked PDP="
+				+ thisPdpId
+				+ ", designated="
+				+ conn.getPdp(thisPdpId).isDesignated());
+		try {
+			droolsPdpIntegrityMonitor.startTransaction();
+			PolicyLogger.error("testLocking1: startTransaction unexpectedly successful");
+			assertTrue(false);
+		} catch (AdministrativeStateException e) {
+			PolicyLogger.debug("testLocking1: As expected, caught AdministrativeStateException, message=" + e.getMessage());
+		} catch (StandbyStatusException e) {
+			PolicyLogger.error("testLocking1: Unexpectedly caught StandbyStatusException, message=" + e.getMessage());
+			assertTrue(false);
+		} catch (Exception e) {
+			PolicyLogger.error("testLocking1: Unexpectedly caught Exception, message=" + e.getMessage());
+			assertTrue(false);
+		} finally {
+			droolsPdpIntegrityMonitor.endTransaction();
+		}		
+		
+		// unlocking should cause state to transit to hot standby
+		PolicyLogger.debug("testLocking1: unlocking PDP=" + thisPdpId);
+		sm.unlock();
+		
+		// Just to avoid any race conditions, sleep a little after locking
+		PolicyLogger.debug("testLocking1: Sleeping a few millis after unlocking, to avoid race condition");
+		Thread.sleep(100);
+		
+		PolicyLogger.debug("testLocking1: Invoking startTransaction on unlocked PDP="
+				+ thisPdpId
+				+ ", designated="
+				+ conn.getPdp(thisPdpId).isDesignated());
+		try {
+			droolsPdpIntegrityMonitor.startTransaction();
+			PolicyLogger.error("testLocking1: startTransaction unexpectedly successful");
+			assertTrue(false);
+		} catch (AdministrativeStateException e) {
+			PolicyLogger.error("testLocking1: Unexpectedly caught AdministrativeStateException, message=" + e.getMessage());
+			assertTrue(false);
+		} catch (StandbyStatusException e) {
+			PolicyLogger.debug("testLocking1: As expected, caught StandbyStatusException, message=" + e.getMessage());
+		} catch (Exception e) {
+			PolicyLogger.error("testLocking1: Unexpectedly caught Exception, message=" + e.getMessage());
+			assertTrue(false);
+		} finally {
+			droolsPdpIntegrityMonitor.endTransaction();
+		}
+		
+		// promoting should cause state to transit to providing service
+		PolicyLogger.debug("testLocking1: promoting PDP=" + thisPdpId);
+		sm.promote();
+		
+		// Just to avoid any race conditions, sleep a little after promoting
+		PolicyLogger.debug("testLocking1: Sleeping a few millis after promoting, to avoid race condition");
+		Thread.sleep(100);
+		
+		PolicyLogger.debug("testLocking1: Invoking startTransaction on promoted PDP="
+				+ thisPdpId
+				+ ", designated="
+				+ conn.getPdp(thisPdpId).isDesignated());
+		try {
+			droolsPdpIntegrityMonitor.startTransaction();
+			droolsPdpIntegrityMonitor.endTransaction();
+			PolicyLogger.debug("testLocking1: As expected, transaction successful");
+		} catch (AdministrativeStateException e) {
+			PolicyLogger.error("testLocking1: Unexpectedly caught AdministrativeStateException, message=" + e.getMessage());
+			assertTrue(false);
+		} catch (StandbyStatusException e) {
+			PolicyLogger.error("testLocking1: Unexpectedly caught StandbyStatusException, message=" + e.getMessage());
+			assertTrue(false);
+		} catch (Exception e) {
+			PolicyLogger.error("testLocking1: Unexpectedly caught Exception, message=" + e.getMessage());
+			assertTrue(false);
+		}
+		
+		PolicyLogger.debug("testLocking1: Stopping policyManagementRunner");
+		policyManagementRunner.stopRunner();		
+
+		PolicyLogger.debug("\n\ntestLocking1: Exiting\n\n");
+		Thread.sleep(interruptRecoveryTime);
+
+	}
+	
+	/*
+	 * 1) Inserts and designates this PDP, then verifies that startTransaction
+	 * is successful.
+	 * 
+	 * 2) Inserts another PDP in hotstandby.
+	 * 
+	 * 3) Demotes this PDP, and verifies 1) that other PDP is not promoted (because one
+	 * PDP cannot promote another PDP) and 2) that this PDP is re-promoted.
+	 */
+	@Ignore
+	@Test
+	public void testLocking2() throws Exception {
+
+		PolicyLogger.debug("\n\ntestLocking2: Entering\n\n");
+		
+		PolicyLogger.debug("testLocking2: Reading IntegrityMonitorProperties");
+		Properties integrityMonitorProperties = new Properties();
+		integrityMonitorProperties.load(new FileInputStream(new File(
+				"src/test/server/config/IntegrityMonitor.properties")));
+		IntegrityMonitorProperties.initProperties(integrityMonitorProperties);
+		String thisPdpId = IntegrityMonitorProperties
+				.getProperty(IntegrityMonitorProperties.PDP_INSTANCE_ID);
+
+		PolicyLogger.debug("testLocking2: Reading xacmlPersistenceProperties");
+		Properties xacmlPersistenceProperties = new Properties();
+		xacmlPersistenceProperties.load(new FileInputStream(new File(
+				"src/test/server/config/xacmlPersistence.properties")));
+		XacmlPersistenceProperties.initProperties(xacmlPersistenceProperties);
+		
+		PolicyLogger.debug("testLocking2: Creating emfXacml");
+		EntityManagerFactory emfXacml = Persistence.createEntityManagerFactory(
+				"junitXacmlPU", xacmlPersistenceProperties);
+		
+		PolicyLogger.debug("testLocking2: Reading droolsPersistenceProperties");
+		Properties droolsPersistenceProperties = new Properties();
+		droolsPersistenceProperties.load(new FileInputStream(new File(
+				"src/test/server/config/droolsPersistence.properties")));
+		DroolsPersistenceProperties.initProperties(droolsPersistenceProperties);
+
+		PolicyLogger.debug("testLocking2: Creating emfDrools");
+		EntityManagerFactory emfDrools = Persistence.createEntityManagerFactory(
+				"junitDroolsPU", droolsPersistenceProperties);
+		
+		DroolsPdpsConnector conn = new JpaDroolsPdpsConnector(emfDrools);
+		
+		PolicyLogger.debug("testLocking2: Cleaning up tables");
+		conn.deleteAllSessions();
+		conn.deleteAllPdps();
+		
+		/*
+		 * Insert this PDP as designated.  Initial standby state will be 
+		 * either null or cold standby.   Demoting should transit state to
+		 * hot standby.
+		 */
+		PolicyLogger.debug("testLocking2: Inserting PDP=" + thisPdpId + " as designated");
+		DroolsPdpImpl pdp = new DroolsPdpImpl(thisPdpId, true, 3, new Date());
+		conn.insertPdp(pdp);
+		DroolsPdpEntity droolsPdpEntity = conn.getPdp(thisPdpId);
+		PolicyLogger.debug("testLocking2: After insertion, PDP=" + thisPdpId + " has DESIGNATED="
+				+ droolsPdpEntity.isDesignated());
+		assertTrue(droolsPdpEntity.isDesignated() == true);
+		
+		PolicyLogger.debug("testLocking2: Instantiating stateManagement object and promoting PDP=" + thisPdpId);
+		StateManagement sm = new StateManagement(emfXacml, "dummy");
+		sm.deleteAllStateManagementEntities();
+		sm = new StateManagement(emfXacml, thisPdpId);
+		PMStandbyStateChangeNotifier pmStandbyStateChangeNotifier = new PMStandbyStateChangeNotifier();
+		sm.addObserver(pmStandbyStateChangeNotifier);
+				
+		/*
+		 * Insert another PDP as not designated.  Initial standby state will be 
+		 * either null or cold standby.   Demoting should transit state to
+		 * hot standby.
+		 */
+		String standbyPdpId = "pdp2";
+		PolicyLogger.debug("testLocking2: Inserting PDP=" + standbyPdpId + " as not designated");
+		Date yesterday = DateUtils.addDays(new Date(), -1);
+		pdp = new DroolsPdpImpl(standbyPdpId, false, 4, yesterday);
+		conn.insertPdp(pdp);
+		droolsPdpEntity = conn.getPdp(standbyPdpId);
+		PolicyLogger.debug("testLocking2: After insertion, PDP=" + standbyPdpId + " has DESIGNATED="
+				+ droolsPdpEntity.isDesignated());
+		assertTrue(droolsPdpEntity.isDesignated() == false);
+		
+		PolicyLogger.debug("testLocking2: Demoting PDP=" + standbyPdpId);
+		StateManagement sm2 = new StateManagement(emfXacml, standbyPdpId);
+		sm2.addObserver(pmStandbyStateChangeNotifier);
+				
+		PolicyLogger.debug("testLocking2: Running policy-management.Main class");
+		PolicyManagementRunner policyManagementRunner = new PolicyManagementRunner();
+		policyManagementRunner.start();
+		
+		PolicyLogger.debug("testLocking2: Runner started; Sleeping "
+				+ interruptRecoveryTime + "ms before promoting/demoting");
+		Thread.sleep(interruptRecoveryTime);
+
+		PolicyLogger.debug("testLocking2: Promoting PDP=" + thisPdpId);
+		sm.promote();
+
+		// demoting PDP should ensure that state transits to hotstandby
+		PolicyLogger.debug("testLocking2: Demoting PDP=" + standbyPdpId);
+		sm2.demote();
+		
+		PolicyLogger.debug("testLocking2: Sleeping "
+				+ sleepTime
+				+ "ms, to allow time for policy-management.Main class to come up");
+		Thread.sleep(sleepTime);
+		
+		PolicyLogger.debug("testLocking2: Waking up and invoking startTransaction on active PDP="
+				+ thisPdpId
+				+ ", designated="
+				+ conn.getPdp(thisPdpId).isDesignated());
+		DroolsPDPIntegrityMonitor droolsPdpIntegrityMonitor = (DroolsPDPIntegrityMonitor) IntegrityMonitor
+				.getInstance();
+		try {
+			droolsPdpIntegrityMonitor.startTransaction();
+			droolsPdpIntegrityMonitor.endTransaction();
+			PolicyLogger.debug("testLocking2: As expected, transaction successful");
+		} catch (AdministrativeStateException e) {
+			PolicyLogger.error("testLocking2: Unexpectedly caught AdministrativeStateException, message=" + e.getMessage());
+			assertTrue(false);
+		} catch (StandbyStatusException e) {
+			PolicyLogger.error("testLocking2: Unexpectedly caught StandbyStatusException, message=" + e.getMessage());
+			assertTrue(false);
+		} catch (Exception e) {
+			PolicyLogger.error("testLocking2: Unexpectedly caught Exception, message=" + e.getMessage());
+			assertTrue(false);
+		}
+		
+		// demoting should cause state to transit to hotstandby followed by re-promotion.
+		PolicyLogger.debug("testLocking2: demoting PDP=" + thisPdpId);
+		sm = droolsPdpIntegrityMonitor.getStateManager();
+		sm.demote();
+		
+		PolicyLogger.debug("testLocking2: sleeping" + electionWaitSleepTime
+				+ " to allow election handler to re-promote PDP=" + thisPdpId);
+		Thread.sleep(electionWaitSleepTime);
+		
+		PolicyLogger.debug("testLocking2: Waking up and invoking startTransaction on re-promoted PDP="
+				+ thisPdpId + ", designated="
+				+ conn.getPdp(thisPdpId).isDesignated());
+		try {
+			droolsPdpIntegrityMonitor.startTransaction();
+			droolsPdpIntegrityMonitor.endTransaction();
+			PolicyLogger.debug("testLocking2: As expected, transaction successful");
+		} catch (AdministrativeStateException e) {
+			PolicyLogger.error("testLocking2: Unexpectedly caught AdministrativeStateException, message=" + e.getMessage());
+			assertTrue(false);
+		} catch (StandbyStatusException e) {
+			PolicyLogger.error("testLocking2: Unexpectedly caught StandbyStatusException, message=" + e.getMessage());
+			assertTrue(false);
+		} catch (Exception e) {
+			PolicyLogger.error("testLocking2: Unexpectedly caught Exception, message=" + e.getMessage());
+			assertTrue(false);
+		}
+		
+		PolicyLogger.debug("testLocking2: Verifying designated status for PDP="
+				+ standbyPdpId);
+		boolean standbyPdpDesignated = conn.getPdp(standbyPdpId).isDesignated();
+		assertTrue(standbyPdpDesignated == false);
+		
+		PolicyLogger.debug("testLocking2: Stopping policyManagementRunner");
+		policyManagementRunner.stopRunner();		
+
+		PolicyLogger.debug("\n\ntestLocking2: Exiting\n\n");
+		Thread.sleep(interruptRecoveryTime);
+
+	}
+	
+	private class PolicyManagementRunner extends Thread {
+
+		public void run() {
+			PolicyLogger.info("PolicyManagementRunner.run: Entering");
+			String args[] = { "src/main/server/config" };
+			try {
+				Main.main(args);
+			} catch (Exception e) {
+				PolicyLogger
+						.info("PolicyManagementRunner.run: Exception thrown from Main.main(), message="
+								+ e.getMessage());
+			}
+			PolicyLogger.info("PolicyManagementRunner.run: Exiting");
+		}
+		
+		public void stopRunner() {
+			PolicyEngine.manager.shutdown();
+		}
+
+	}
+	
+}
diff --git a/policy-persistence/src/test/resources/IntegrityMonitor.properties b/policy-persistence/src/test/resources/IntegrityMonitor.properties
new file mode 100644
index 0000000..0ab3628
--- /dev/null
+++ b/policy-persistence/src/test/resources/IntegrityMonitor.properties
@@ -0,0 +1,67 @@
+###
+# ============LICENSE_START=======================================================
+# policy-persistence
+# ================================================================================
+# 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=========================================================
+###
+
+#hostPort = ${{host_port}}
+hostPort = 0.0.0.0:9981
+
+# The following were added as part of US673632
+#
+# Forward Progress Monitor update interval seconds
+fp_monitor_interval = 30
+# Failed counter threshold before failover 
+failed_counter_threshold = 3
+# Interval between test transactions when no traffic seconds
+test_trans_interval = 10
+# Interval between writes of the FPC to the DB seconds 
+write_fpc_interval = 5
+# Name of the site in which this node is hosted 
+site_name = pdp_1
+# Node type
+# Note: Make sure you don't leave any trailing spaces, or you'll get an 'invalid node type' error! 
+node_type = pdp_drools
+# Dependency groups are groups of resources upon which a node operational state is dependent upon. 
+# Each group is a comma-separated list of resource names and groups are separated by a semicolon.  For example:
+#dependency_groups=site_1.astra_1,site_1.astra_2;site_1.brms_1,site_1.brms_2;site_1.logparser_1;site_1.pypdp_1
+#dependency_groups=${{dependency_groups}}
+dependency_groups=""
+# When set to true, dependent health checks are performed by using JMX to invoke test() on the dependent.
+# The default false is to use state checks for health.
+#test_via_jmx=${{test_via_jmx}}
+# This is the max number of seconds beyond which a non incrementing FPC is considered a failure
+#max_fpc_update_interval=${{max_fpc_update_interval}}
+
+# Needed by DroolsPdpsElectionHandler
+pdp.checkInterval=1500
+pdp.updateInterval=1000
+#pdp.timeout=3000
+# Need long timeout, because testTransaction is only run every 10 seconds.
+pdp.timeout=15000
+#how long do we wait for the pdp table to populate on initial startup
+pdp.initialWait=20000
+
+# Known as the PDPID in the droolpdpentity table.
+resource.name=pdp1
+#resource.name=${{resource_name}}
+
+
+
+
+
+
diff --git a/policy-persistence/src/test/resources/META-INF/persistence.xml b/policy-persistence/src/test/resources/META-INF/persistence.xml
new file mode 100644
index 0000000..51ec161
--- /dev/null
+++ b/policy-persistence/src/test/resources/META-INF/persistence.xml
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ============LICENSE_START=======================================================
+  policy-persistence
+  ================================================================================
+  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=========================================================
+  -->
+
+<persistence version="2.1"
+	xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
+
+	<persistence-unit name="junitDroolsPU" transaction-type="RESOURCE_LOCAL">
+		<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
+		<class>org.openecomp.policy.drools.persistence.DroolsPdpEntity</class>
+		<class>org.openecomp.policy.drools.persistence.DroolsSessionEntity</class>
+		<class>org.openecomp.policy.drools.persistence.LastSiteEntity</class>
+		<class>org.drools.persistence.info.SessionInfo</class>
+		<class>org.drools.persistence.info.WorkItemInfo</class>
+		<class>org.openecomp.policy.common.ia.jpa.IntegrityAuditEntity</class>
+		<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/generatedCreateDrools.ddl"/>
+            <property name="javax.persistence.schema-generation.scripts.drop-target" value="./sql/generatedDropDrools.ddl"/>
+        </properties>
+	</persistence-unit>
+	
+	<persistence-unit name="junitXacmlPU" transaction-type="RESOURCE_LOCAL">
+		<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
+		<class>org.openecomp.policy.common.im.jpa.StateManagementEntity</class>
+		<class>org.openecomp.policy.common.im.jpa.ForwardProgressEntity</class>
+		<class>org.openecomp.policy.common.im.jpa.ResourceRegistrationEntity</class>
+		<class>org.openecomp.policy.common.ia.jpa.IntegrityAuditEntity</class>
+		<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/generatedCreateXacml.ddl"/>
+            <property name="javax.persistence.schema-generation.scripts.drop-target" value="./sql/generatedDropXacml.ddl"/>
+        </properties>
+	</persistence-unit>
+
+</persistence>
diff --git a/policy-persistence/src/test/resources/droolsPersistence.properties b/policy-persistence/src/test/resources/droolsPersistence.properties
new file mode 100644
index 0000000..544e1c2
--- /dev/null
+++ b/policy-persistence/src/test/resources/droolsPersistence.properties
@@ -0,0 +1,51 @@
+###
+# ============LICENSE_START=======================================================
+# policy-persistence
+# ================================================================================
+# 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=========================================================
+###
+
+javax.persistence.jdbc.driver = org.h2.Driver
+javax.persistence.jdbc.url  = jdbc:h2:file:./sql/drools
+javax.persistence.jdbc.user = sa
+javax.persistence.jdbc.password =
+
+#javax.persistence.jdbc.driver=org.mariadb.jdbc.Driver
+#javax.persistence.jdbc.url=jdbc:mariadb://localhost:3306/drools
+#javax.persistence.jdbc.user=root
+#javax.persistence.jdbc.password=policy
+
+#javax.persistence.jdbc.driver = ${{JDBC_DRIVER}}
+#javax.persistence.jdbc.url  = ${{JDBC_DROOLS_URL}}
+#javax.persistence.jdbc.user = ${{JDBC_USER}}
+#javax.persistence.jdbc.password = ${{JDBC_PASSWORD}}
+
+# Needed?
+#javax.persistence.jdbc.driver = org.h2.Driver
+#javax.persistence.jdbc.url  = jdbc:h2:file:./sql/ncomp
+#javax.persistence.jdbc.user = sa
+#javax.persistence.jdbc.password =
+#persistenceDisabled=false
+#javax.persistence.jdbc.driver=org.mariadb.jdbc.Driver
+#javax.persistence.jdbc.url=jdbc:mariadb://192.168.56.30:3306/drools
+#javax.persistence.jdbc.user=patb
+#javax.persistence.jdbc.password=policy
+
+hibernate.dataSource=org.mariadb.jdbc.MySQLDataSource
+
+# For testing purposes, it may be convenient to disable persistence
+persistenceDisabled=false
+
diff --git a/policy-persistence/src/test/resources/log4j.properties b/policy-persistence/src/test/resources/log4j.properties
new file mode 100644
index 0000000..746d59a
--- /dev/null
+++ b/policy-persistence/src/test/resources/log4j.properties
@@ -0,0 +1,31 @@
+###
+# ============LICENSE_START=======================================================
+# policy-persistence
+# ================================================================================
+# 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=========================================================
+###
+
+log4j.rootLogger=DEBUG, out
+log4j.logger.com.att=DEBUG
+log4j.logger.org.openecomp.policy.drools.system=DEBUG
+log4j.logger.org.openecomp.policy.drools.im=DEBUG
+log4j.logger.org.openecomp.policy.common.im=DEBUG
+log4j.logger.org.openecomp.policy.drools.event.comm=DEBUG
+
+# CONSOLE appender not used by default
+log4j.appender.out=org.apache.log4j.ConsoleAppender
+log4j.appender.out.layout=org.apache.log4j.PatternLayout
+log4j.appender.out.layout.ConversionPattern=%d %-5p %-30.30c{1} %4L - %m%n
diff --git a/policy-persistence/src/test/resources/logback.xml b/policy-persistence/src/test/resources/logback.xml
new file mode 100644
index 0000000..9fd83e8
--- /dev/null
+++ b/policy-persistence/src/test/resources/logback.xml
@@ -0,0 +1,209 @@
+<!--
+  ============LICENSE_START=======================================================
+  policy-persistence
+  ================================================================================
+  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=========================================================
+  -->
+
+<!-- Controls the output of logs for JUnit tests -->
+
+<configuration scan="true" scanPeriod="3 seconds" debug="true">
+  <!--<jmxConfigurator /> -->
+  <!-- directory path for all other type logs -->
+  <property name="logDir" value="testingLogs" />
+  
+  <!-- directory path for debugging type logs -->
+  <property name="debugDir" value="testingLogs" />
+  
+  <!--  specify the component name 
+    <ECOMP-component-name>::= "MSO" | "DCAE" | "ASDC " | "AAI" |"Policy" | "SDNC" | "AC"  -->
+  <property name="componentName" value="drools-pdp"></property>
+  <property name="subComponentName" value="policy-management"></property>
+  
+  <!--  log file names -->
+  <property name="errorLogName" value="error" />
+  <property name="metricsLogName" value="metrics" />
+  <property name="auditLogName" value="audit" />
+  <property name="debugLogName" value="debug" />
+  
+   <property name="defaultPattern" value="%d{&quot;yyyy-MM-dd'T'HH:mm:ss.SSSXXX&quot;, UTC}|%X{requestId}|%X{serviceInstanceId}|%t|%X{serverName}|%X{serviceName}|%X{instanceUuid}|%p|%X{severity}|%X{serverIpAddress}|%X{server}|%X{clientIpAddress}|%c||%msg%n" />
+   <!--  <property name="defaultPattern" value="%d{&quot;yyyy-MM-dd'T'HH:mm:ss.SSSXXX&quot;, UTC}|%X{RequestId}|%X{ServiceInstanceId}|%thread||%X{ServiceName}|%X{InstanceUUID}|%.-5level|%X{AlertSeverity}|%X{ServerIPAddress}|%X{ServerFQDN}|%X{RemoteHost}||%X{Timer}|%msg%n" />  -->
+  <property name="logDirectory" value="${logDir}/${componentName}/${subComponentName}" />
+  <property name="debugLogDirectory" value="${debugDir}/${componentName}/${subComponentName}" />
+   <!--
+  <property name="logDirectory" value="${logDir}/${componentName}/${subComponentName}" />
+  <property name="debugLogDirectory" value="${debugDir}/${componentName}/${subComponentName}" />
+  -->
+  <!-- example from old log4j.properties:  ${catalina.base}/logs/pdp-rest.log  -->  
+
+  <!-- Example evaluator filter applied against console appender -->
+  <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+    <encoder>
+      <pattern>${defaultPattern}</pattern>
+    </encoder>
+  </appender>
+
+  <!-- ============================================================================ -->
+  <!-- EELF Appenders -->
+  <!-- ============================================================================ -->
+
+  <!-- The EELFAppender is used to record events to the general application 
+    log -->
+    
+    
+
+  
+  <!-- EELF Audit Appender. This appender is used to record audit engine 
+    related logging events. The audit logger and appender are specializations 
+    of the EELF application root logger and appender. This can be used to segregate 
+    Policy engine events from other components, or it can be eliminated to record 
+    these events as part of the application root log. -->
+    
+  <appender name="EELFAudit"
+    class="ch.qos.logback.core.rolling.RollingFileAppender">
+    <file>${logDirectory}/${auditLogName}.log</file>
+    <rollingPolicy
+      class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
+      <fileNamePattern>${logDirectory}/${auditLogName}.%i.log.zip
+      </fileNamePattern>
+      <minIndex>1</minIndex>
+      <maxIndex>9</maxIndex>
+    </rollingPolicy>
+    <triggeringPolicy
+      class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
+      <maxFileSize>5MB</maxFileSize>
+    </triggeringPolicy>
+    <encoder>
+         <pattern>${defaultPattern}</pattern>
+    </encoder>
+  </appender>
+  <appender name="asyncEELFAudit" class="ch.qos.logback.classic.AsyncAppender">
+    <queueSize>256</queueSize>
+    <appender-ref ref="EELFAudit" />
+  </appender>
+
+<appender name="EELFMetrics"
+    class="ch.qos.logback.core.rolling.RollingFileAppender">
+    <file>${logDirectory}/${metricsLogName}.log</file>
+    <rollingPolicy
+      class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
+      <fileNamePattern>${logDirectory}/${metricsLogName}.%i.log.zip
+      </fileNamePattern>
+      <minIndex>1</minIndex>
+      <maxIndex>9</maxIndex>
+    </rollingPolicy>
+    <triggeringPolicy
+      class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
+      <maxFileSize>5MB</maxFileSize>
+    </triggeringPolicy>
+    <encoder>
+      <!-- <pattern>"%d{HH:mm:ss.SSS} [%thread] %-5level %logger{1024} - 
+        %msg%n"</pattern> -->
+      <pattern>${defaultPattern}</pattern>
+    </encoder>
+  </appender>
+  
+  
+  <appender name="asyncEELFMetrics" class="ch.qos.logback.classic.AsyncAppender">
+    <queueSize>256</queueSize>
+    <appender-ref ref="EELFMetrics"/>
+  </appender>
+   
+  <appender name="EELFError"
+    class="ch.qos.logback.core.rolling.RollingFileAppender">
+    <file>${logDirectory}/${errorLogName}.log</file>
+    <rollingPolicy
+      class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
+      <fileNamePattern>${logDirectory}/${errorLogName}.%i.log.zip
+      </fileNamePattern>
+      <minIndex>1</minIndex>
+      <maxIndex>9</maxIndex>
+    </rollingPolicy>
+    <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
+     <level>ERROR</level>
+     </filter>
+    <triggeringPolicy
+      class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
+      <maxFileSize>5MB</maxFileSize>
+    </triggeringPolicy>
+    <encoder>
+      <pattern>${defaultPattern}</pattern>
+    </encoder>
+  </appender>
+  
+  <appender name="asyncEELFError" class="ch.qos.logback.classic.AsyncAppender">
+    <queueSize>256</queueSize>
+    <appender-ref ref="EELFError"/>
+  </appender>
+  
+   <appender name="EELFDebug"
+    class="ch.qos.logback.core.rolling.RollingFileAppender">
+    <file>${debugLogDirectory}/${debugLogName}.log</file>
+    <rollingPolicy
+      class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
+      <fileNamePattern>${debugLogDirectory}/${debugLogName}.%i.log.zip
+      </fileNamePattern>
+      <minIndex>1</minIndex>
+      <maxIndex>9</maxIndex>
+    </rollingPolicy>
+    <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
+     <!-- <level>INFO</level> -->
+     <level>DEBUG</level>
+     </filter>
+    <triggeringPolicy
+      class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
+      <maxFileSize>5MB</maxFileSize>
+    </triggeringPolicy>
+    <encoder>
+      <pattern>${defaultPattern}</pattern>
+    </encoder>
+  </appender>
+  
+  <appender name="asyncEELFDebug" class="ch.qos.logback.classic.AsyncAppender">
+    <queueSize>256</queueSize>
+    <appender-ref ref="EELFDebug" />
+    <includeCallerData>true</includeCallerData>
+  </appender>
+ 
+  
+  <!-- ============================================================================ -->
+  <!--  EELF loggers -->
+  <!-- ============================================================================ -->
+ 
+  <logger name="com.att.eelf.audit" level="info" additivity="false">
+    <appender-ref ref="asyncEELFAudit" />
+  </logger>
+  
+  <logger name="com.att.eelf.metrics" level="info" additivity="false">
+        <appender-ref ref="asyncEELFMetrics" />
+  </logger>
+ 
+    <logger name="com.att.eelf.error" level="error" additivity="false">
+  <appender-ref ref="asyncEELFError" />
+  </logger>
+  
+   <!-- <logger name="com.att.eelf.debug" level="info" additivity="false"> -->
+   <logger name="com.att.eelf.debug" level="debug" additivity="false">
+        <appender-ref ref="asyncEELFDebug" />
+  </logger>
+  
+  <!-- <root level="INFO"> -->
+  <root level="DEBUG">
+        <appender-ref ref="asyncEELFDebug" />
+        <appender-ref ref="asyncEELFError" />
+  </root>
+
+</configuration>
diff --git a/policy-persistence/src/test/resources/xacmlPersistence.properties b/policy-persistence/src/test/resources/xacmlPersistence.properties
new file mode 100644
index 0000000..284e87d
--- /dev/null
+++ b/policy-persistence/src/test/resources/xacmlPersistence.properties
@@ -0,0 +1,43 @@
+###
+# ============LICENSE_START=======================================================
+# policy-persistence
+# ================================================================================
+# 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=========================================================
+###
+
+javax.persistence.jdbc.driver = org.h2.Driver
+javax.persistence.jdbc.url  = jdbc:h2:file:./sql/xacml
+javax.persistence.jdbc.user = sa
+javax.persistence.jdbc.password =
+
+#javax.persistence.jdbc.driver=org.mariadb.jdbc.Driver
+#javax.persistence.jdbc.url=jdbc:mariadb://127.0.0.1:3306/xacml
+#javax.persistence.jdbc.user=root
+#javax.persistence.jdbc.password=policy
+
+#javax.persistence.jdbc.driver = ${{JDBC_DRIVER}}
+#javax.persistence.jdbc.url  = ${{JDBC_URL}}
+#javax.persistence.jdbc.user = ${{JDBC_USER}}
+#javax.persistence.jdbc.password = ${{JDBC_PASSWORD}}
+
+# Needed?
+hibernate.dataSource=org.mariadb.jdbc.MySQLDataSource
+
+# For testing purposes, it may be convenient to disable persistence
+persistenceDisabled=false
+
+
+ 
diff --git a/policy-persistence/src/test/server/config/IntegrityMonitor.properties b/policy-persistence/src/test/server/config/IntegrityMonitor.properties
new file mode 100644
index 0000000..b16beda
--- /dev/null
+++ b/policy-persistence/src/test/server/config/IntegrityMonitor.properties
@@ -0,0 +1,62 @@
+###
+# ============LICENSE_START=======================================================
+# policy-persistence
+# ================================================================================
+# 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=========================================================
+###
+
+# port 9981 fails on Jenkins, so try another.
+hostPort = 0.0.0.0:57692
+
+# The following were added as part of US673632
+#
+# Forward Progress Monitor update interval seconds
+fp_monitor_interval = 30
+# Failed counter threshold before failover 
+failed_counter_threshold = 3
+# Interval between test transactions when no traffic seconds
+test_trans_interval = 10
+# Interval between writes of the FPC to the DB seconds 
+write_fpc_interval = 5
+# Name of the site in which this node is hosted 
+site_name = pdp_1
+# Node type. Can take values of: pdp-xacml, pdp-drools, pap, pap-admin, logparser, brms-gateway, 
+# astra-gateway, elk-server and pypdpNode type
+# Note: Make sure you don't leave any trailing spaces, or you'll get an 'invalid node type' error! 
+node_type = pdp_drools
+# Dependency groups are groups of resources upon which a node operational state is dependent upon. 
+# Each group is a comma-separated list of resource names and groups are separated by a semicolon.  For example:
+#For JUnit testing this must be empty since none of the other components exist 
+#dependency_groups=site_1.astra_1,site_1.astra_2;site_1.brms_1,site_1.brms_2;site_1.logparser_1;site_1.pypdp_1
+dependency_groups=
+
+# Needed by DroolsPdpsElectionHandler
+pdp.checkInterval=1500
+pdp.updateInterval=1000
+#pdp.timeout=3000
+# Need long timeout, because testTransaction is only run every 10 seconds.
+pdp.timeout=15000
+#how long do we wait for the pdp table to populate on initial startup
+pdp.initialWait=20000
+
+# Known as the PDPID in the droolpdpentity table.
+resource.name=pdp1
+
+# The amount of this a resource (entity) should sleep between audit executions.
+# If not specified, defaults to five seconds.
+# -1 turns off audit
+# zero forces audit to run continuously
+integrity_audit_period_seconds=60
diff --git a/policy-persistence/src/test/server/config/droolsPersistence.properties b/policy-persistence/src/test/server/config/droolsPersistence.properties
new file mode 100644
index 0000000..8cdaf6a
--- /dev/null
+++ b/policy-persistence/src/test/server/config/droolsPersistence.properties
@@ -0,0 +1,35 @@
+###
+# ============LICENSE_START=======================================================
+# policy-persistence
+# ================================================================================
+# 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=========================================================
+###
+
+javax.persistence.jdbc.driver = org.h2.Driver
+javax.persistence.jdbc.url  = jdbc:h2:file:./sql/drools
+javax.persistence.jdbc.user = sa
+javax.persistence.jdbc.password =
+
+#javax.persistence.jdbc.driver=org.mariadb.jdbc.Driver
+#javax.persistence.jdbc.url=jdbc:mariadb://localhost:3306/drools
+#javax.persistence.jdbc.user=root
+#javax.persistence.jdbc.password=policy
+
+# Needed?
+hibernate.dataSource=org.mariadb.jdbc.MySQLDataSource
+
+# For testing purposes, it may be convenient to disable persistence
+persistenceDisabled=false
diff --git a/policy-persistence/src/test/server/config/policyLogger.properties b/policy-persistence/src/test/server/config/policyLogger.properties
new file mode 100644
index 0000000..6ee66fd
--- /dev/null
+++ b/policy-persistence/src/test/server/config/policyLogger.properties
@@ -0,0 +1,44 @@
+###
+# ============LICENSE_START=======================================================
+# policy-persistence
+# ================================================================================
+# 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=========================================================
+###
+
+################################### Set concurrentHashMap and timer info  #######################
+#Timer initial delay and the delay between in milliseconds before task is to be execute.
+timer.delay.time=1000
+#Timer scheduleAtFixedRate period - time in milliseconds between successive task executions.
+check.interval= 30000
+#Longest time an event info can be stored in the concurrentHashMap for logging - in seconds. 
+event.expired.time=86400
+#Size of the concurrentHashMap which stores the event starting time, etc - when its size reaches this limit, the Timer gets executed 
+#to remove all expired records from this concurrentHashMap.
+concurrentHashMap.limit=5000
+#Size of the concurrentHashMap - when its size drops to this point, stop the Timer
+stop.check.point=2500
+################################### Set logging format #############################################
+# set EELF for EELF logging format, set LOG4J for using log4j, set SYSTEMOUT for using system.out.println
+logger.type=EELF
+#################################### Set level for EELF or SYSTEMOUT logging ##################################
+# Set level for debug file. Set DEBUG to enable .info, .warn and .debug; set INFO for enable .info and .warn; set OFF to disable all 
+debugLogger.level=INFO
+# Set level for metrics file. Set OFF to disable; set ON to enable
+metricsLogger.level=ON
+# Set level for error file. Set OFF to disable; set ON to enable
+error.level=ON
+# Set level for audit file. Set OFF to disable; set ON to enable
+audit.level=ON
diff --git a/policy-persistence/src/test/server/config/xacmlPersistence.properties b/policy-persistence/src/test/server/config/xacmlPersistence.properties
new file mode 100644
index 0000000..149aa55
--- /dev/null
+++ b/policy-persistence/src/test/server/config/xacmlPersistence.properties
@@ -0,0 +1,38 @@
+###
+# ============LICENSE_START=======================================================
+# policy-persistence
+# ================================================================================
+# 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=========================================================
+###
+
+javax.persistence.jdbc.driver = org.h2.Driver
+javax.persistence.jdbc.url  = jdbc:h2:file:./sql/xacml
+javax.persistence.jdbc.user = sa
+javax.persistence.jdbc.password =
+
+#javax.persistence.jdbc.driver=org.mariadb.jdbc.Driver
+#javax.persistence.jdbc.url=jdbc:mariadb://127.0.0.1:3306/xacml
+#javax.persistence.jdbc.user=root
+#javax.persistence.jdbc.password=policy
+
+# Needed?
+hibernate.dataSource=org.mariadb.jdbc.MySQLDataSource
+
+# For testing purposes, it may be convenient to disable persistence
+persistenceDisabled=false
+
+
+ 
