diff options
Diffstat (limited to 'integrity-audit/src/test/java')
6 files changed, 149 insertions, 122 deletions
diff --git a/integrity-audit/src/test/java/org/onap/policy/common/ia/test/AuditPeriodTest.java b/integrity-audit/src/test/java/org/onap/policy/common/ia/test/AuditPeriodTest.java index 54b50b0d..68ab42d9 100644 --- a/integrity-audit/src/test/java/org/onap/policy/common/ia/test/AuditPeriodTest.java +++ b/integrity-audit/src/test/java/org/onap/policy/common/ia/test/AuditPeriodTest.java @@ -80,10 +80,10 @@ public class AuditPeriodTest { IntegrityAudit.setUnitTesting(true); properties = new Properties(); - properties.put(IntegrityAuditProperties.DB_DRIVER, IntegrityAuditProperties.DEFAULT_DB_DRIVER); - properties.put(IntegrityAuditProperties.DB_URL, IntegrityAuditProperties.DEFAULT_DB_URL); - properties.put(IntegrityAuditProperties.DB_USER, IntegrityAuditProperties.DEFAULT_DB_USER); - properties.put(IntegrityAuditProperties.DB_PWD, IntegrityAuditProperties.DEFAULT_DB_PWD); + properties.put(IntegrityAuditProperties.DB_DRIVER, TestUtils.DEFAULT_DB_DRIVER); + properties.put(IntegrityAuditProperties.DB_URL, TestUtils.DEFAULT_DB_URL); + properties.put(IntegrityAuditProperties.DB_USER, TestUtils.DEFAULT_DB_USER); + properties.put(IntegrityAuditProperties.DB_PWD, TestUtils.DEFAULT_DB_PWD); properties.put(IntegrityAuditProperties.SITE_NAME, "SiteA"); properties.put(IntegrityAuditProperties.NODE_TYPE, "pdp_xacml"); @@ -277,10 +277,10 @@ public class AuditPeriodTest { * Start audit for pdp2. */ Properties properties2 = new Properties(); - properties2.put(IntegrityAuditProperties.DB_DRIVER, IntegrityAuditProperties.DEFAULT_DB_DRIVER); - properties2.put(IntegrityAuditProperties.DB_URL, IntegrityAuditProperties.DEFAULT_DB_URL); - properties2.put(IntegrityAuditProperties.DB_USER, IntegrityAuditProperties.DEFAULT_DB_USER); - properties2.put(IntegrityAuditProperties.DB_PWD, IntegrityAuditProperties.DEFAULT_DB_PWD); + properties2.put(IntegrityAuditProperties.DB_DRIVER, TestUtils.DEFAULT_DB_DRIVER); + properties2.put(IntegrityAuditProperties.DB_URL, TestUtils.DEFAULT_DB_URL); + properties2.put(IntegrityAuditProperties.DB_USER, TestUtils.DEFAULT_DB_USER); + properties2.put(IntegrityAuditProperties.DB_PWD, TestUtils.DEFAULT_DB_PWD); properties2.put(IntegrityAuditProperties.SITE_NAME, "SiteA"); properties2.put(IntegrityAuditProperties.NODE_TYPE, "pdp_xacml"); properties2.put(IntegrityAuditProperties.AUDIT_PERIOD_SECONDS, "300"); @@ -293,10 +293,10 @@ public class AuditPeriodTest { * Start audit for pdp3. */ Properties properties3 = new Properties(); - properties3.put(IntegrityAuditProperties.DB_DRIVER, IntegrityAuditProperties.DEFAULT_DB_DRIVER); - properties3.put(IntegrityAuditProperties.DB_URL, IntegrityAuditProperties.DEFAULT_DB_URL); - properties3.put(IntegrityAuditProperties.DB_USER, IntegrityAuditProperties.DEFAULT_DB_USER); - properties3.put(IntegrityAuditProperties.DB_PWD, IntegrityAuditProperties.DEFAULT_DB_PWD); + properties3.put(IntegrityAuditProperties.DB_DRIVER, TestUtils.DEFAULT_DB_DRIVER); + properties3.put(IntegrityAuditProperties.DB_URL, TestUtils.DEFAULT_DB_URL); + properties3.put(IntegrityAuditProperties.DB_USER, TestUtils.DEFAULT_DB_USER); + properties3.put(IntegrityAuditProperties.DB_PWD, TestUtils.DEFAULT_DB_PWD); properties3.put(IntegrityAuditProperties.SITE_NAME, "SiteA"); properties3.put(IntegrityAuditProperties.NODE_TYPE, "pdp_xacml"); properties3.put(IntegrityAuditProperties.AUDIT_PERIOD_SECONDS, "300"); @@ -393,10 +393,10 @@ public class AuditPeriodTest { * Start audit for pdp2. */ Properties properties2 = new Properties(); - properties2.put(IntegrityAuditProperties.DB_DRIVER, IntegrityAuditProperties.DEFAULT_DB_DRIVER); - properties2.put(IntegrityAuditProperties.DB_URL, IntegrityAuditProperties.DEFAULT_DB_URL); - properties2.put(IntegrityAuditProperties.DB_USER, IntegrityAuditProperties.DEFAULT_DB_USER); - properties2.put(IntegrityAuditProperties.DB_PWD, IntegrityAuditProperties.DEFAULT_DB_PWD); + properties2.put(IntegrityAuditProperties.DB_DRIVER, TestUtils.DEFAULT_DB_DRIVER); + properties2.put(IntegrityAuditProperties.DB_URL, TestUtils.DEFAULT_DB_URL); + properties2.put(IntegrityAuditProperties.DB_USER, TestUtils.DEFAULT_DB_USER); + properties2.put(IntegrityAuditProperties.DB_PWD, TestUtils.DEFAULT_DB_PWD); properties2.put(IntegrityAuditProperties.SITE_NAME, "SiteA"); properties2.put(IntegrityAuditProperties.NODE_TYPE, "pdp_xacml"); properties2.put(IntegrityAuditProperties.AUDIT_PERIOD_SECONDS, "20"); @@ -409,10 +409,10 @@ public class AuditPeriodTest { * Start audit for pdp3. */ Properties properties3 = new Properties(); - properties3.put(IntegrityAuditProperties.DB_DRIVER, IntegrityAuditProperties.DEFAULT_DB_DRIVER); - properties3.put(IntegrityAuditProperties.DB_URL, IntegrityAuditProperties.DEFAULT_DB_URL); - properties3.put(IntegrityAuditProperties.DB_USER, IntegrityAuditProperties.DEFAULT_DB_USER); - properties3.put(IntegrityAuditProperties.DB_PWD, IntegrityAuditProperties.DEFAULT_DB_PWD); + properties3.put(IntegrityAuditProperties.DB_DRIVER, TestUtils.DEFAULT_DB_DRIVER); + properties3.put(IntegrityAuditProperties.DB_URL, TestUtils.DEFAULT_DB_URL); + properties3.put(IntegrityAuditProperties.DB_USER, TestUtils.DEFAULT_DB_USER); + properties3.put(IntegrityAuditProperties.DB_PWD, TestUtils.DEFAULT_DB_PWD); properties3.put(IntegrityAuditProperties.SITE_NAME, "SiteA"); properties3.put(IntegrityAuditProperties.NODE_TYPE, "pdp_xacml"); properties3.put(IntegrityAuditProperties.AUDIT_PERIOD_SECONDS, "20"); diff --git a/integrity-audit/src/test/java/org/onap/policy/common/ia/test/DbAuditCompareEntriesTest.java b/integrity-audit/src/test/java/org/onap/policy/common/ia/test/DbAuditCompareEntriesTest.java index a625d751..d8388c58 100644 --- a/integrity-audit/src/test/java/org/onap/policy/common/ia/test/DbAuditCompareEntriesTest.java +++ b/integrity-audit/src/test/java/org/onap/policy/common/ia/test/DbAuditCompareEntriesTest.java @@ -86,17 +86,17 @@ public class DbAuditCompareEntriesTest { IntegrityAudit.setUnitTesting(true); properties = new Properties(); - properties.put(IntegrityAuditProperties.DB_DRIVER, IntegrityAuditProperties.DEFAULT_DB_DRIVER); - properties.put(IntegrityAuditProperties.DB_URL, IntegrityAuditProperties.DEFAULT_DB_URL); - properties.put(IntegrityAuditProperties.DB_USER, IntegrityAuditProperties.DEFAULT_DB_USER); - properties.put(IntegrityAuditProperties.DB_PWD, IntegrityAuditProperties.DEFAULT_DB_PWD); + properties.put(IntegrityAuditProperties.DB_DRIVER, TestUtils.DEFAULT_DB_DRIVER); + properties.put(IntegrityAuditProperties.DB_URL, TestUtils.DEFAULT_DB_URL); + properties.put(IntegrityAuditProperties.DB_USER, TestUtils.DEFAULT_DB_USER); + properties.put(IntegrityAuditProperties.DB_PWD, TestUtils.DEFAULT_DB_PWD); properties.put(IntegrityAuditProperties.SITE_NAME, "SiteA"); properties.put(IntegrityAuditProperties.NODE_TYPE, "pdp_xacml"); - dbDriver = IntegrityAuditProperties.DEFAULT_DB_DRIVER; - dbUrl = IntegrityAuditProperties.DEFAULT_DB_URL; - dbUser = IntegrityAuditProperties.DEFAULT_DB_USER; - dbPwd = IntegrityAuditProperties.DEFAULT_DB_PWD; + dbDriver = TestUtils.DEFAULT_DB_DRIVER; + dbUrl = TestUtils.DEFAULT_DB_URL; + dbUser = TestUtils.DEFAULT_DB_USER; + dbPwd = TestUtils.DEFAULT_DB_PWD; siteName = "SiteA"; nodeType = "pdp_xacml"; persistenceUnit = "testPU"; @@ -452,25 +452,25 @@ public class DbAuditCompareEntriesTest { IntegrityAudit.setUnitTesting(true); properties = new Properties(); - properties.put(IntegrityAuditProperties.DB_DRIVER, IntegrityAuditProperties.DEFAULT_DB_DRIVER); - properties.put(IntegrityAuditProperties.DB_URL, IntegrityAuditProperties.DEFAULT_DB_URL); - properties.put(IntegrityAuditProperties.DB_USER, IntegrityAuditProperties.DEFAULT_DB_USER); - properties.put(IntegrityAuditProperties.DB_PWD, IntegrityAuditProperties.DEFAULT_DB_PWD); + properties.put(IntegrityAuditProperties.DB_DRIVER, TestUtils.DEFAULT_DB_DRIVER); + properties.put(IntegrityAuditProperties.DB_URL, TestUtils.DEFAULT_DB_URL); + properties.put(IntegrityAuditProperties.DB_USER, TestUtils.DEFAULT_DB_USER); + properties.put(IntegrityAuditProperties.DB_PWD, TestUtils.DEFAULT_DB_PWD); properties.put(IntegrityAuditProperties.SITE_NAME, "SiteA"); properties.put(IntegrityAuditProperties.NODE_TYPE, "pdp_xacml"); Properties properties2 = new Properties(); - properties2.put(IntegrityAuditProperties.DB_DRIVER, IntegrityAuditProperties.DEFAULT_DB_DRIVER); + properties2.put(IntegrityAuditProperties.DB_DRIVER, TestUtils.DEFAULT_DB_DRIVER); properties2.put(IntegrityAuditProperties.DB_URL, "jdbc:h2:file:./sql/iaTest2"); - properties2.put(IntegrityAuditProperties.DB_USER, IntegrityAuditProperties.DEFAULT_DB_USER); - properties2.put(IntegrityAuditProperties.DB_PWD, IntegrityAuditProperties.DEFAULT_DB_PWD); + properties2.put(IntegrityAuditProperties.DB_USER, TestUtils.DEFAULT_DB_USER); + properties2.put(IntegrityAuditProperties.DB_PWD, TestUtils.DEFAULT_DB_PWD); properties2.put(IntegrityAuditProperties.SITE_NAME, "SiteA"); properties2.put(IntegrityAuditProperties.NODE_TYPE, "pdp_xacml"); - dbDriver = IntegrityAuditProperties.DEFAULT_DB_DRIVER; - dbUrl = IntegrityAuditProperties.DEFAULT_DB_URL; - dbUser = IntegrityAuditProperties.DEFAULT_DB_USER; - dbPwd = IntegrityAuditProperties.DEFAULT_DB_PWD; + dbDriver = TestUtils.DEFAULT_DB_DRIVER; + dbUrl = TestUtils.DEFAULT_DB_URL; + dbUser = TestUtils.DEFAULT_DB_USER; + dbPwd = TestUtils.DEFAULT_DB_PWD; siteName = "SiteA"; nodeType = "pdp_xacml"; persistenceUnit = "testPU"; diff --git a/integrity-audit/src/test/java/org/onap/policy/common/ia/test/DbAuditTest.java b/integrity-audit/src/test/java/org/onap/policy/common/ia/test/DbAuditTest.java index 0ee0a72e..ecf75eef 100644 --- a/integrity-audit/src/test/java/org/onap/policy/common/ia/test/DbAuditTest.java +++ b/integrity-audit/src/test/java/org/onap/policy/common/ia/test/DbAuditTest.java @@ -119,17 +119,17 @@ public class DbAuditTest { IntegrityAuditEntity.setUnitTesting(true); properties = new Properties(); - properties.put(IntegrityAuditProperties.DB_DRIVER, IntegrityAuditProperties.DEFAULT_DB_DRIVER); - properties.put(IntegrityAuditProperties.DB_URL, IntegrityAuditProperties.DEFAULT_DB_URL); - properties.put(IntegrityAuditProperties.DB_USER, IntegrityAuditProperties.DEFAULT_DB_USER); - properties.put(IntegrityAuditProperties.DB_PWD, IntegrityAuditProperties.DEFAULT_DB_PWD); + properties.put(IntegrityAuditProperties.DB_DRIVER, TestUtils.DEFAULT_DB_DRIVER); + properties.put(IntegrityAuditProperties.DB_URL, TestUtils.DEFAULT_DB_URL); + properties.put(IntegrityAuditProperties.DB_USER, TestUtils.DEFAULT_DB_USER); + properties.put(IntegrityAuditProperties.DB_PWD, TestUtils.DEFAULT_DB_PWD); properties.put(IntegrityAuditProperties.SITE_NAME, "SiteA"); properties.put(IntegrityAuditProperties.NODE_TYPE, "pdp_xacml"); - dbDriver = IntegrityAuditProperties.DEFAULT_DB_DRIVER; - dbUrl = IntegrityAuditProperties.DEFAULT_DB_URL; - dbUser = IntegrityAuditProperties.DEFAULT_DB_USER; - dbPwd = IntegrityAuditProperties.DEFAULT_DB_PWD; + dbDriver = TestUtils.DEFAULT_DB_DRIVER; + dbUrl = TestUtils.DEFAULT_DB_URL; + dbUser = TestUtils.DEFAULT_DB_USER; + dbPwd = TestUtils.DEFAULT_DB_PWD; siteName = "SiteA"; nodeType = "pdp_xacml"; persistenceUnit = "testPU"; @@ -247,10 +247,10 @@ public class DbAuditTest { // Properties for DB2 Properties properties2 = new Properties(); - properties2.put(IntegrityAuditProperties.DB_DRIVER, IntegrityAuditProperties.DEFAULT_DB_DRIVER); + properties2.put(IntegrityAuditProperties.DB_DRIVER, TestUtils.DEFAULT_DB_DRIVER); properties2.put(IntegrityAuditProperties.DB_URL, "jdbc:h2:file:./sql/iaTest2"); - properties2.put(IntegrityAuditProperties.DB_USER, IntegrityAuditProperties.DEFAULT_DB_USER); - properties2.put(IntegrityAuditProperties.DB_PWD, IntegrityAuditProperties.DEFAULT_DB_PWD); + properties2.put(IntegrityAuditProperties.DB_USER, TestUtils.DEFAULT_DB_USER); + properties2.put(IntegrityAuditProperties.DB_PWD, TestUtils.DEFAULT_DB_PWD); properties2.put(IntegrityAuditProperties.SITE_NAME, "SiteA"); properties2.put(IntegrityAuditProperties.NODE_TYPE, "pdp_xacml"); diff --git a/integrity-audit/src/test/java/org/onap/policy/common/ia/test/DbDAOTest.java b/integrity-audit/src/test/java/org/onap/policy/common/ia/test/DbDAOTest.java index 326ada59..4fd51f6e 100644 --- a/integrity-audit/src/test/java/org/onap/policy/common/ia/test/DbDAOTest.java +++ b/integrity-audit/src/test/java/org/onap/policy/common/ia/test/DbDAOTest.java @@ -71,10 +71,10 @@ public class DbDAOTest { @Before public void setUp() throws Exception { properties = new Properties(); - properties.put(IntegrityAuditProperties.DB_DRIVER, IntegrityAuditProperties.DEFAULT_DB_DRIVER); - properties.put(IntegrityAuditProperties.DB_URL, IntegrityAuditProperties.DEFAULT_DB_URL); - properties.put(IntegrityAuditProperties.DB_USER, IntegrityAuditProperties.DEFAULT_DB_USER); - properties.put(IntegrityAuditProperties.DB_PWD, IntegrityAuditProperties.DEFAULT_DB_PWD); + properties.put(IntegrityAuditProperties.DB_DRIVER, TestUtils.DEFAULT_DB_DRIVER); + properties.put(IntegrityAuditProperties.DB_URL, TestUtils.DEFAULT_DB_URL); + properties.put(IntegrityAuditProperties.DB_USER, TestUtils.DEFAULT_DB_USER); + properties.put(IntegrityAuditProperties.DB_PWD, TestUtils.DEFAULT_DB_PWD); properties.put(IntegrityAuditProperties.SITE_NAME, "SiteA"); properties.put(IntegrityAuditProperties.NODE_TYPE, "pdp_xacml"); diff --git a/integrity-audit/src/test/java/org/onap/policy/common/ia/test/IntegrityAuditDesignationTest.java b/integrity-audit/src/test/java/org/onap/policy/common/ia/test/IntegrityAuditDesignationTest.java index 021f3368..5c593123 100644 --- a/integrity-audit/src/test/java/org/onap/policy/common/ia/test/IntegrityAuditDesignationTest.java +++ b/integrity-audit/src/test/java/org/onap/policy/common/ia/test/IntegrityAuditDesignationTest.java @@ -85,10 +85,10 @@ public class IntegrityAuditDesignationTest { IntegrityAudit.setUnitTesting(true); properties = new Properties(); - properties.put(IntegrityAuditProperties.DB_DRIVER, IntegrityAuditProperties.DEFAULT_DB_DRIVER); - properties.put(IntegrityAuditProperties.DB_URL, IntegrityAuditProperties.DEFAULT_DB_URL); - properties.put(IntegrityAuditProperties.DB_USER, IntegrityAuditProperties.DEFAULT_DB_USER); - properties.put(IntegrityAuditProperties.DB_PWD, IntegrityAuditProperties.DEFAULT_DB_PWD); + properties.put(IntegrityAuditProperties.DB_DRIVER, TestUtils.DEFAULT_DB_DRIVER); + properties.put(IntegrityAuditProperties.DB_URL, TestUtils.DEFAULT_DB_URL); + properties.put(IntegrityAuditProperties.DB_USER, TestUtils.DEFAULT_DB_USER); + properties.put(IntegrityAuditProperties.DB_PWD, TestUtils.DEFAULT_DB_PWD); properties.put(IntegrityAuditProperties.SITE_NAME, "SiteA"); properties.put(IntegrityAuditProperties.NODE_TYPE, "pdp_xacml"); @@ -256,10 +256,10 @@ public class IntegrityAuditDesignationTest { * Start audit for pdp2. */ Properties properties2 = new Properties(); - properties2.put(IntegrityAuditProperties.DB_DRIVER, IntegrityAuditProperties.DEFAULT_DB_DRIVER); - properties2.put(IntegrityAuditProperties.DB_URL, IntegrityAuditProperties.DEFAULT_DB_URL); - properties2.put(IntegrityAuditProperties.DB_USER, IntegrityAuditProperties.DEFAULT_DB_USER); - properties2.put(IntegrityAuditProperties.DB_PWD, IntegrityAuditProperties.DEFAULT_DB_PWD); + properties2.put(IntegrityAuditProperties.DB_DRIVER, TestUtils.DEFAULT_DB_DRIVER); + properties2.put(IntegrityAuditProperties.DB_URL, TestUtils.DEFAULT_DB_URL); + properties2.put(IntegrityAuditProperties.DB_USER, TestUtils.DEFAULT_DB_USER); + properties2.put(IntegrityAuditProperties.DB_PWD, TestUtils.DEFAULT_DB_PWD); properties2.put(IntegrityAuditProperties.SITE_NAME, "SiteA"); properties2.put(IntegrityAuditProperties.NODE_TYPE, "pdp_xacml"); properties2.put(IntegrityAuditProperties.AUDIT_PERIOD_SECONDS, "5"); @@ -347,10 +347,10 @@ public class IntegrityAuditDesignationTest { * Start audit for pdp2. */ Properties properties2 = new Properties(); - properties2.put(IntegrityAuditProperties.DB_DRIVER, IntegrityAuditProperties.DEFAULT_DB_DRIVER); - properties2.put(IntegrityAuditProperties.DB_URL, IntegrityAuditProperties.DEFAULT_DB_URL); - properties2.put(IntegrityAuditProperties.DB_USER, IntegrityAuditProperties.DEFAULT_DB_USER); - properties2.put(IntegrityAuditProperties.DB_PWD, IntegrityAuditProperties.DEFAULT_DB_PWD); + properties2.put(IntegrityAuditProperties.DB_DRIVER, TestUtils.DEFAULT_DB_DRIVER); + properties2.put(IntegrityAuditProperties.DB_URL, TestUtils.DEFAULT_DB_URL); + properties2.put(IntegrityAuditProperties.DB_USER, TestUtils.DEFAULT_DB_USER); + properties2.put(IntegrityAuditProperties.DB_PWD, TestUtils.DEFAULT_DB_PWD); properties2.put(IntegrityAuditProperties.SITE_NAME, "SiteA"); properties2.put(IntegrityAuditProperties.NODE_TYPE, "pdp_xacml"); properties2.put(IntegrityAuditProperties.AUDIT_PERIOD_SECONDS, "5"); @@ -441,10 +441,10 @@ public class IntegrityAuditDesignationTest { * Populate DB for pdp2, which will simulate it having registered but then having died. */ Properties properties2 = new Properties(); - properties2.put(IntegrityAuditProperties.DB_DRIVER, IntegrityAuditProperties.DEFAULT_DB_DRIVER); - properties2.put(IntegrityAuditProperties.DB_URL, IntegrityAuditProperties.DEFAULT_DB_URL); - properties2.put(IntegrityAuditProperties.DB_USER, IntegrityAuditProperties.DEFAULT_DB_USER); - properties2.put(IntegrityAuditProperties.DB_PWD, IntegrityAuditProperties.DEFAULT_DB_PWD); + properties2.put(IntegrityAuditProperties.DB_DRIVER, TestUtils.DEFAULT_DB_DRIVER); + properties2.put(IntegrityAuditProperties.DB_URL, TestUtils.DEFAULT_DB_URL); + properties2.put(IntegrityAuditProperties.DB_USER, TestUtils.DEFAULT_DB_USER); + properties2.put(IntegrityAuditProperties.DB_PWD, TestUtils.DEFAULT_DB_PWD); properties2.put(IntegrityAuditProperties.SITE_NAME, "SiteA"); properties2.put(IntegrityAuditProperties.NODE_TYPE, "pdp_xacml"); properties2.put(IntegrityAuditProperties.AUDIT_PERIOD_SECONDS, "5"); @@ -523,10 +523,10 @@ public class IntegrityAuditDesignationTest { * Start audit for pdp2. */ Properties properties2 = new Properties(); - properties2.put(IntegrityAuditProperties.DB_DRIVER, IntegrityAuditProperties.DEFAULT_DB_DRIVER); - properties2.put(IntegrityAuditProperties.DB_URL, IntegrityAuditProperties.DEFAULT_DB_URL); - properties2.put(IntegrityAuditProperties.DB_USER, IntegrityAuditProperties.DEFAULT_DB_USER); - properties2.put(IntegrityAuditProperties.DB_PWD, IntegrityAuditProperties.DEFAULT_DB_PWD); + properties2.put(IntegrityAuditProperties.DB_DRIVER, TestUtils.DEFAULT_DB_DRIVER); + properties2.put(IntegrityAuditProperties.DB_URL, TestUtils.DEFAULT_DB_URL); + properties2.put(IntegrityAuditProperties.DB_USER, TestUtils.DEFAULT_DB_USER); + properties2.put(IntegrityAuditProperties.DB_PWD, TestUtils.DEFAULT_DB_PWD); properties2.put(IntegrityAuditProperties.SITE_NAME, "SiteA"); properties2.put(IntegrityAuditProperties.NODE_TYPE, "pdp_xacml"); properties2.put(IntegrityAuditProperties.AUDIT_PERIOD_SECONDS, "5"); @@ -539,10 +539,10 @@ public class IntegrityAuditDesignationTest { * Start audit for pdp3. */ Properties properties3 = new Properties(); - properties3.put(IntegrityAuditProperties.DB_DRIVER, IntegrityAuditProperties.DEFAULT_DB_DRIVER); - properties3.put(IntegrityAuditProperties.DB_URL, IntegrityAuditProperties.DEFAULT_DB_URL); - properties3.put(IntegrityAuditProperties.DB_USER, IntegrityAuditProperties.DEFAULT_DB_USER); - properties3.put(IntegrityAuditProperties.DB_PWD, IntegrityAuditProperties.DEFAULT_DB_PWD); + properties3.put(IntegrityAuditProperties.DB_DRIVER, TestUtils.DEFAULT_DB_DRIVER); + properties3.put(IntegrityAuditProperties.DB_URL, TestUtils.DEFAULT_DB_URL); + properties3.put(IntegrityAuditProperties.DB_USER, TestUtils.DEFAULT_DB_USER); + properties3.put(IntegrityAuditProperties.DB_PWD, TestUtils.DEFAULT_DB_PWD); properties3.put(IntegrityAuditProperties.SITE_NAME, "SiteA"); properties3.put(IntegrityAuditProperties.NODE_TYPE, "pdp_xacml"); properties3.put(IntegrityAuditProperties.AUDIT_PERIOD_SECONDS, "5"); @@ -636,10 +636,10 @@ public class IntegrityAuditDesignationTest { * Start audit for pdp2, integrityAuditPU. */ Properties properties2 = new Properties(); - properties2.put(IntegrityAuditProperties.DB_DRIVER, IntegrityAuditProperties.DEFAULT_DB_DRIVER); - properties2.put(IntegrityAuditProperties.DB_URL, IntegrityAuditProperties.DEFAULT_DB_URL); - properties2.put(IntegrityAuditProperties.DB_USER, IntegrityAuditProperties.DEFAULT_DB_USER); - properties2.put(IntegrityAuditProperties.DB_PWD, IntegrityAuditProperties.DEFAULT_DB_PWD); + properties2.put(IntegrityAuditProperties.DB_DRIVER, TestUtils.DEFAULT_DB_DRIVER); + properties2.put(IntegrityAuditProperties.DB_URL, TestUtils.DEFAULT_DB_URL); + properties2.put(IntegrityAuditProperties.DB_USER, TestUtils.DEFAULT_DB_USER); + properties2.put(IntegrityAuditProperties.DB_PWD, TestUtils.DEFAULT_DB_PWD); properties2.put(IntegrityAuditProperties.SITE_NAME, "SiteA"); properties2.put(IntegrityAuditProperties.NODE_TYPE, "pdp_xacml"); properties2.put(IntegrityAuditProperties.AUDIT_PERIOD_SECONDS, "5"); @@ -652,10 +652,10 @@ public class IntegrityAuditDesignationTest { * Start audit for pdp3, testPU. */ Properties properties3 = new Properties(); - properties3.put(IntegrityAuditProperties.DB_DRIVER, IntegrityAuditProperties.DEFAULT_DB_DRIVER); - properties3.put(IntegrityAuditProperties.DB_URL, IntegrityAuditProperties.DEFAULT_DB_URL); - properties3.put(IntegrityAuditProperties.DB_USER, IntegrityAuditProperties.DEFAULT_DB_USER); - properties3.put(IntegrityAuditProperties.DB_PWD, IntegrityAuditProperties.DEFAULT_DB_PWD); + properties3.put(IntegrityAuditProperties.DB_DRIVER, TestUtils.DEFAULT_DB_DRIVER); + properties3.put(IntegrityAuditProperties.DB_URL, TestUtils.DEFAULT_DB_URL); + properties3.put(IntegrityAuditProperties.DB_USER, TestUtils.DEFAULT_DB_USER); + properties3.put(IntegrityAuditProperties.DB_PWD, TestUtils.DEFAULT_DB_PWD); properties3.put(IntegrityAuditProperties.SITE_NAME, "SiteA"); properties3.put(IntegrityAuditProperties.NODE_TYPE, "pdp_xacml"); properties3.put(IntegrityAuditProperties.AUDIT_PERIOD_SECONDS, "5"); @@ -668,10 +668,10 @@ public class IntegrityAuditDesignationTest { * Start audit for pdp4, integrityAuditPU. */ Properties properties4 = new Properties(); - properties4.put(IntegrityAuditProperties.DB_DRIVER, IntegrityAuditProperties.DEFAULT_DB_DRIVER); - properties4.put(IntegrityAuditProperties.DB_URL, IntegrityAuditProperties.DEFAULT_DB_URL); - properties4.put(IntegrityAuditProperties.DB_USER, IntegrityAuditProperties.DEFAULT_DB_USER); - properties4.put(IntegrityAuditProperties.DB_PWD, IntegrityAuditProperties.DEFAULT_DB_PWD); + properties4.put(IntegrityAuditProperties.DB_DRIVER, TestUtils.DEFAULT_DB_DRIVER); + properties4.put(IntegrityAuditProperties.DB_URL, TestUtils.DEFAULT_DB_URL); + properties4.put(IntegrityAuditProperties.DB_USER, TestUtils.DEFAULT_DB_USER); + properties4.put(IntegrityAuditProperties.DB_PWD, TestUtils.DEFAULT_DB_PWD); properties4.put(IntegrityAuditProperties.SITE_NAME, "SiteA"); properties4.put(IntegrityAuditProperties.NODE_TYPE, "pdp_xacml"); properties4.put(IntegrityAuditProperties.AUDIT_PERIOD_SECONDS, "5"); @@ -763,10 +763,10 @@ public class IntegrityAuditDesignationTest { * Start audit for pdp2. */ Properties properties2 = new Properties(); - properties2.put(IntegrityAuditProperties.DB_DRIVER, IntegrityAuditProperties.DEFAULT_DB_DRIVER); - properties2.put(IntegrityAuditProperties.DB_URL, IntegrityAuditProperties.DEFAULT_DB_URL); - properties2.put(IntegrityAuditProperties.DB_USER, IntegrityAuditProperties.DEFAULT_DB_USER); - properties2.put(IntegrityAuditProperties.DB_PWD, IntegrityAuditProperties.DEFAULT_DB_PWD); + properties2.put(IntegrityAuditProperties.DB_DRIVER, TestUtils.DEFAULT_DB_DRIVER); + properties2.put(IntegrityAuditProperties.DB_URL, TestUtils.DEFAULT_DB_URL); + properties2.put(IntegrityAuditProperties.DB_USER, TestUtils.DEFAULT_DB_USER); + properties2.put(IntegrityAuditProperties.DB_PWD, TestUtils.DEFAULT_DB_PWD); properties2.put(IntegrityAuditProperties.SITE_NAME, "SiteA"); properties2.put(IntegrityAuditProperties.NODE_TYPE, "pdp_xacml"); properties2.put(IntegrityAuditProperties.AUDIT_PERIOD_SECONDS, "5"); @@ -779,10 +779,10 @@ public class IntegrityAuditDesignationTest { * Populate DB for pdp3, which will simulate it having registered but then having died. */ Properties properties3 = new Properties(); - properties3.put(IntegrityAuditProperties.DB_DRIVER, IntegrityAuditProperties.DEFAULT_DB_DRIVER); - properties3.put(IntegrityAuditProperties.DB_URL, IntegrityAuditProperties.DEFAULT_DB_URL); - properties3.put(IntegrityAuditProperties.DB_USER, IntegrityAuditProperties.DEFAULT_DB_USER); - properties3.put(IntegrityAuditProperties.DB_PWD, IntegrityAuditProperties.DEFAULT_DB_PWD); + properties3.put(IntegrityAuditProperties.DB_DRIVER, TestUtils.DEFAULT_DB_DRIVER); + properties3.put(IntegrityAuditProperties.DB_URL, TestUtils.DEFAULT_DB_URL); + properties3.put(IntegrityAuditProperties.DB_USER, TestUtils.DEFAULT_DB_USER); + properties3.put(IntegrityAuditProperties.DB_PWD, TestUtils.DEFAULT_DB_PWD); properties3.put(IntegrityAuditProperties.SITE_NAME, "SiteA"); properties3.put(IntegrityAuditProperties.NODE_TYPE, "pdp_xacml"); properties3.put(IntegrityAuditProperties.AUDIT_PERIOD_SECONDS, "5"); @@ -794,10 +794,10 @@ public class IntegrityAuditDesignationTest { * Start audit for pdp4. */ Properties properties4 = new Properties(); - properties4.put(IntegrityAuditProperties.DB_DRIVER, IntegrityAuditProperties.DEFAULT_DB_DRIVER); - properties4.put(IntegrityAuditProperties.DB_URL, IntegrityAuditProperties.DEFAULT_DB_URL); - properties4.put(IntegrityAuditProperties.DB_USER, IntegrityAuditProperties.DEFAULT_DB_USER); - properties4.put(IntegrityAuditProperties.DB_PWD, IntegrityAuditProperties.DEFAULT_DB_PWD); + properties4.put(IntegrityAuditProperties.DB_DRIVER, TestUtils.DEFAULT_DB_DRIVER); + properties4.put(IntegrityAuditProperties.DB_URL, TestUtils.DEFAULT_DB_URL); + properties4.put(IntegrityAuditProperties.DB_USER, TestUtils.DEFAULT_DB_USER); + properties4.put(IntegrityAuditProperties.DB_PWD, TestUtils.DEFAULT_DB_PWD); properties4.put(IntegrityAuditProperties.SITE_NAME, "SiteA"); properties4.put(IntegrityAuditProperties.NODE_TYPE, "pdp_xacml"); properties4.put(IntegrityAuditProperties.AUDIT_PERIOD_SECONDS, "5"); @@ -895,10 +895,10 @@ public class IntegrityAuditDesignationTest { * Populate DB for pdp2, which will simulate it having registered but then having died. */ Properties properties2 = new Properties(); - properties2.put(IntegrityAuditProperties.DB_DRIVER, IntegrityAuditProperties.DEFAULT_DB_DRIVER); - properties2.put(IntegrityAuditProperties.DB_URL, IntegrityAuditProperties.DEFAULT_DB_URL); - properties2.put(IntegrityAuditProperties.DB_USER, IntegrityAuditProperties.DEFAULT_DB_USER); - properties2.put(IntegrityAuditProperties.DB_PWD, IntegrityAuditProperties.DEFAULT_DB_PWD); + properties2.put(IntegrityAuditProperties.DB_DRIVER, TestUtils.DEFAULT_DB_DRIVER); + properties2.put(IntegrityAuditProperties.DB_URL, TestUtils.DEFAULT_DB_URL); + properties2.put(IntegrityAuditProperties.DB_USER, TestUtils.DEFAULT_DB_USER); + properties2.put(IntegrityAuditProperties.DB_PWD, TestUtils.DEFAULT_DB_PWD); properties2.put(IntegrityAuditProperties.SITE_NAME, "SiteA"); properties2.put(IntegrityAuditProperties.NODE_TYPE, "pdp_xacml"); properties2.put(IntegrityAuditProperties.AUDIT_PERIOD_SECONDS, "5"); @@ -910,10 +910,10 @@ public class IntegrityAuditDesignationTest { * Start audit for pdp3. */ Properties properties3 = new Properties(); - properties3.put(IntegrityAuditProperties.DB_DRIVER, IntegrityAuditProperties.DEFAULT_DB_DRIVER); - properties3.put(IntegrityAuditProperties.DB_URL, IntegrityAuditProperties.DEFAULT_DB_URL); - properties3.put(IntegrityAuditProperties.DB_USER, IntegrityAuditProperties.DEFAULT_DB_USER); - properties3.put(IntegrityAuditProperties.DB_PWD, IntegrityAuditProperties.DEFAULT_DB_PWD); + properties3.put(IntegrityAuditProperties.DB_DRIVER, TestUtils.DEFAULT_DB_DRIVER); + properties3.put(IntegrityAuditProperties.DB_URL, TestUtils.DEFAULT_DB_URL); + properties3.put(IntegrityAuditProperties.DB_USER, TestUtils.DEFAULT_DB_USER); + properties3.put(IntegrityAuditProperties.DB_PWD, TestUtils.DEFAULT_DB_PWD); properties3.put(IntegrityAuditProperties.SITE_NAME, "SiteA"); properties3.put(IntegrityAuditProperties.NODE_TYPE, "pdp_xacml"); properties3.put(IntegrityAuditProperties.AUDIT_PERIOD_SECONDS, "5"); @@ -926,10 +926,10 @@ public class IntegrityAuditDesignationTest { * Populate DB for pdp4, which will simulate it having registered but then having died. */ Properties properties4 = new Properties(); - properties4.put(IntegrityAuditProperties.DB_DRIVER, IntegrityAuditProperties.DEFAULT_DB_DRIVER); - properties4.put(IntegrityAuditProperties.DB_URL, IntegrityAuditProperties.DEFAULT_DB_URL); - properties4.put(IntegrityAuditProperties.DB_USER, IntegrityAuditProperties.DEFAULT_DB_USER); - properties4.put(IntegrityAuditProperties.DB_PWD, IntegrityAuditProperties.DEFAULT_DB_PWD); + properties4.put(IntegrityAuditProperties.DB_DRIVER, TestUtils.DEFAULT_DB_DRIVER); + properties4.put(IntegrityAuditProperties.DB_URL, TestUtils.DEFAULT_DB_URL); + properties4.put(IntegrityAuditProperties.DB_USER, TestUtils.DEFAULT_DB_USER); + properties4.put(IntegrityAuditProperties.DB_PWD, TestUtils.DEFAULT_DB_PWD); properties4.put(IntegrityAuditProperties.SITE_NAME, "SiteA"); properties4.put(IntegrityAuditProperties.NODE_TYPE, "pdp_xacml"); properties4.put(IntegrityAuditProperties.AUDIT_PERIOD_SECONDS, "5"); @@ -1009,10 +1009,10 @@ public class IntegrityAuditDesignationTest { * Start audit for pdp2. */ Properties properties2 = new Properties(); - properties2.put(IntegrityAuditProperties.DB_DRIVER, IntegrityAuditProperties.DEFAULT_DB_DRIVER); - properties2.put(IntegrityAuditProperties.DB_URL, IntegrityAuditProperties.DEFAULT_DB_URL); - properties2.put(IntegrityAuditProperties.DB_USER, IntegrityAuditProperties.DEFAULT_DB_USER); - properties2.put(IntegrityAuditProperties.DB_PWD, IntegrityAuditProperties.DEFAULT_DB_PWD); + properties2.put(IntegrityAuditProperties.DB_DRIVER, TestUtils.DEFAULT_DB_DRIVER); + properties2.put(IntegrityAuditProperties.DB_URL, TestUtils.DEFAULT_DB_URL); + properties2.put(IntegrityAuditProperties.DB_USER, TestUtils.DEFAULT_DB_USER); + properties2.put(IntegrityAuditProperties.DB_PWD, TestUtils.DEFAULT_DB_PWD); properties2.put(IntegrityAuditProperties.SITE_NAME, "SiteA"); properties2.put(IntegrityAuditProperties.NODE_TYPE, "pdp_xacml"); properties2.put(IntegrityAuditProperties.AUDIT_PERIOD_SECONDS, "5"); @@ -1024,10 +1024,10 @@ public class IntegrityAuditDesignationTest { * Instantiate audit object for pdp3. */ Properties properties3 = new Properties(); - properties3.put(IntegrityAuditProperties.DB_DRIVER, IntegrityAuditProperties.DEFAULT_DB_DRIVER); - properties3.put(IntegrityAuditProperties.DB_URL, IntegrityAuditProperties.DEFAULT_DB_URL); - properties3.put(IntegrityAuditProperties.DB_USER, IntegrityAuditProperties.DEFAULT_DB_USER); - properties3.put(IntegrityAuditProperties.DB_PWD, IntegrityAuditProperties.DEFAULT_DB_PWD); + properties3.put(IntegrityAuditProperties.DB_DRIVER, TestUtils.DEFAULT_DB_DRIVER); + properties3.put(IntegrityAuditProperties.DB_URL, TestUtils.DEFAULT_DB_URL); + properties3.put(IntegrityAuditProperties.DB_USER, TestUtils.DEFAULT_DB_USER); + properties3.put(IntegrityAuditProperties.DB_PWD, TestUtils.DEFAULT_DB_PWD); properties3.put(IntegrityAuditProperties.SITE_NAME, "SiteA"); properties3.put(IntegrityAuditProperties.NODE_TYPE, "pdp_xacml"); properties3.put(IntegrityAuditProperties.AUDIT_PERIOD_SECONDS, "5"); diff --git a/integrity-audit/src/test/java/org/onap/policy/common/ia/test/TestUtils.java b/integrity-audit/src/test/java/org/onap/policy/common/ia/test/TestUtils.java new file mode 100644 index 00000000..58874d76 --- /dev/null +++ b/integrity-audit/src/test/java/org/onap/policy/common/ia/test/TestUtils.java @@ -0,0 +1,27 @@ +/*- + * ============LICENSE_START======================================================= + * Test Utils + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ +package org.onap.policy.common.ia.test; + +public class TestUtils { + public static final String DEFAULT_DB_DRIVER = "org.h2.Driver"; + public static final String DEFAULT_DB_URL = "jdbc:h2:file:./sql/iaTest"; + public static final String DEFAULT_DB_USER = "sa"; + public static final String DEFAULT_DB_PWD = ""; +} |