summaryrefslogtreecommitdiffstats
path: root/integrity-audit/src/main/java
diff options
context:
space:
mode:
authorPamela Dragosh <pdragosh@research.att.com>2018-02-02 09:25:14 -0500
committerPamela Dragosh <pdragosh@research.att.com>2018-02-02 09:34:58 -0500
commit4aadab035016ebc675698961f410583eee86ebc7 (patch)
treea96b13db115d15eb6260e708542b2794d3d95175 /integrity-audit/src/main/java
parentc23099a762c165ca8d1fd064902e91191952f678 (diff)
Removed commented code and add JUnit tests
* Useless assignments * Commented out code * Unused imports * Add simple JUnit for exception classes Issue-ID: POLICY-456 Change-Id: I012c2b6bdaf1b5803b2f1c37fd4d9514055e4ef0 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
Diffstat (limited to 'integrity-audit/src/main/java')
-rw-r--r--integrity-audit/src/main/java/org/onap/policy/common/ia/AuditThread.java4
-rw-r--r--integrity-audit/src/main/java/org/onap/policy/common/ia/IntegrityAudit.java22
2 files changed, 12 insertions, 14 deletions
diff --git a/integrity-audit/src/main/java/org/onap/policy/common/ia/AuditThread.java b/integrity-audit/src/main/java/org/onap/policy/common/ia/AuditThread.java
index e3cada9d..78ff4d3a 100644
--- a/integrity-audit/src/main/java/org/onap/policy/common/ia/AuditThread.java
+++ b/integrity-audit/src/main/java/org/onap/policy/common/ia/AuditThread.java
@@ -20,17 +20,15 @@
package org.onap.policy.common.ia;
-import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.List;
import java.util.Properties;
-
import org.onap.policy.common.ia.jpa.IntegrityAuditEntity;
import org.onap.policy.common.logging.eelf.MessageCodes;
-import org.onap.policy.common.logging.flexlogger.FlexLogger;
+import org.onap.policy.common.logging.flexlogger.FlexLogger;
import org.onap.policy.common.logging.flexlogger.Logger;
/**
diff --git a/integrity-audit/src/main/java/org/onap/policy/common/ia/IntegrityAudit.java b/integrity-audit/src/main/java/org/onap/policy/common/ia/IntegrityAudit.java
index 424e603d..4f7a15af 100644
--- a/integrity-audit/src/main/java/org/onap/policy/common/ia/IntegrityAudit.java
+++ b/integrity-audit/src/main/java/org/onap/policy/common/ia/IntegrityAudit.java
@@ -122,53 +122,53 @@ public class IntegrityAudit {
boolean parmsAreBad = false;
if(resourceName == null || resourceName.isEmpty()){
- badparams = badparams.append("resourceName ");
+ badparams.append("resourceName ");
parmsAreBad = true;
}
if(persistenceUnit == null || persistenceUnit.isEmpty()){
- badparams = badparams.append("persistenceUnit ");
+ badparams.append("persistenceUnit ");
parmsAreBad = true;
}
if(properties == null || properties.isEmpty()){
- badparams = badparams.append("properties ");
+ badparams.append("properties ");
parmsAreBad = true;
}
else{
String dbDriver = properties.getProperty(IntegrityAuditProperties.DB_DRIVER);
if(dbDriver == null || dbDriver.isEmpty()){
- badparams = badparams.append("dbDriver ");
+ badparams.append("dbDriver ");
parmsAreBad = true;
}
String dbUrl = properties.getProperty(IntegrityAuditProperties.DB_URL);
if(dbUrl == null || dbUrl.isEmpty()){
- badparams = badparams.append("dbUrl ");
+ badparams.append("dbUrl ");
parmsAreBad = true;
}
String dbUser = properties.getProperty(IntegrityAuditProperties.DB_USER);
if(dbUser == null || dbUser.isEmpty()){
- badparams = badparams.append("dbUser ");
+ badparams.append("dbUser ");
parmsAreBad = true;
}
String dbPwd = properties.getProperty(IntegrityAuditProperties.DB_PWD);
if(dbPwd == null){ //may be empty
- badparams = badparams.append("dbPwd ");
+ badparams.append("dbPwd ");
parmsAreBad = true;
}
String siteName = properties.getProperty(IntegrityAuditProperties.SITE_NAME);
if(siteName == null || siteName.isEmpty()){
- badparams = badparams.append("siteName ");
+ badparams.append("siteName ");
parmsAreBad = true;
}
String nodeType = properties.getProperty(IntegrityAuditProperties.NODE_TYPE);
if(nodeType == null || nodeType.isEmpty()){
- badparams = badparams.append("nodeType ");
+ badparams.append("nodeType ");
parmsAreBad = true;
} else {
nodeType = nodeType.trim();
@@ -177,7 +177,7 @@ public class IntegrityAudit {
for (NodeTypeEnum n : NodeTypeEnum.values()) {
nodetypes = nodetypes.concat(n.toString() + " ");
}
- badparams = badparams.append(nodetypes + "] ");
+ badparams.append(nodetypes + "] ");
parmsAreBad = true;
}
}
@@ -185,7 +185,7 @@ public class IntegrityAudit {
try{
Integer.parseInt(properties.getProperty(IntegrityAuditProperties.AUDIT_PERIOD_SECONDS).trim());
}catch(NumberFormatException nfe){
- badparams = badparams.append(", auditPeriodSeconds="
+ badparams.append(", auditPeriodSeconds="
+ properties.getProperty(IntegrityAuditProperties.AUDIT_PERIOD_SECONDS).trim());
parmsAreBad = true;
}