aboutsummaryrefslogtreecommitdiffstats
path: root/feature-state-management/src/main
diff options
context:
space:
mode:
authorJorge Hernandez <jh1730@att.com>2017-09-25 19:28:23 +0000
committerGerrit Code Review <gerrit@onap.org>2017-09-25 19:28:23 +0000
commit857e086044637992fe7ba69e8bd423805c329ad7 (patch)
tree551168c7b3b6e81182c57e9dfd15732dcaf4c20d /feature-state-management/src/main
parent872ca20525796cb1de950f78f573cda92073a694 (diff)
parent2b2d21fd2761ceab9faa50f224b1d136f3b36d34 (diff)
Merge "Incr State Mgmt Code Coverage"
Diffstat (limited to 'feature-state-management/src/main')
-rw-r--r--feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/DbAudit.java7
-rw-r--r--feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/RepositoryAudit.java2
2 files changed, 7 insertions, 2 deletions
diff --git a/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/DbAudit.java b/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/DbAudit.java
index efecf887..cde6e4e4 100644
--- a/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/DbAudit.java
+++ b/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/DbAudit.java
@@ -43,6 +43,8 @@ public class DbAudit extends DroolsPDPIntegrityMonitor.AuditBase
// This indicates if 'CREATE TABLE IF NOT EXISTS Audit ...' should be
// invoked -- doing this avoids the need to create the table in advance.
static private boolean createTableNeeded = true;
+
+ static public boolean isJunit = false;
synchronized private static void setCreateTableNeeded(boolean b) {
DbAudit.createTableNeeded = b;
@@ -50,7 +52,7 @@ public class DbAudit extends DroolsPDPIntegrityMonitor.AuditBase
/**
* @return the single 'DbAudit' instance
*/
- static DroolsPDPIntegrityMonitor.AuditBase getInstance()
+ public static DroolsPDPIntegrityMonitor.AuditBase getInstance()
{
return(instance);
}
@@ -74,6 +76,9 @@ public class DbAudit extends DroolsPDPIntegrityMonitor.AuditBase
if(logger.isDebugEnabled()){
logger.debug("Running 'DbAudit.invoke'");
}
+ if(isJunit){
+ createTableNeeded = false;
+ }
boolean isActive = true;
String dbAuditIsActive = StateManagementProperties.getProperty("db.audit.is.active");
if(logger.isDebugEnabled()){
diff --git a/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/RepositoryAudit.java b/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/RepositoryAudit.java
index 7eed736e..b36c1657 100644
--- a/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/RepositoryAudit.java
+++ b/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/RepositoryAudit.java
@@ -51,7 +51,7 @@ public class RepositoryAudit extends DroolsPDPIntegrityMonitor.AuditBase
/**
* @return the single 'RepositoryAudit' instance
*/
- static DroolsPDPIntegrityMonitor.AuditBase getInstance()
+ public static DroolsPDPIntegrityMonitor.AuditBase getInstance()
{
return instance;
}