summaryrefslogtreecommitdiffstats
path: root/policy-persistence/src
diff options
context:
space:
mode:
authorJorge Hernandez <jh1730@att.com>2017-05-11 08:20:10 -0500
committerJorge Hernandez <jh1730@att.com>2017-05-11 08:48:27 -0500
commitf354096969e91aa2b3dcdc52adcc2bde1b3b0b74 (patch)
tree511e29b1bbafb0d3053b00a324fd3934786c8ccb /policy-persistence/src
parentb90795e142b490549db86a40007f3eab813bc67c (diff)
[POLICY-12] clean policy-persistence mod warnings
Takes care of the following warnings: --IntegrityAuditIntegrationTest.java import org.junit.Ignore is never used import org.openecomp.policy.common.im.AdministrativeStateException is never used import org.openecomp.policy.common.im.IntegrityMonitor is never used import org.openecomp.policy.common.im.StandbyStatusException is never used import org.openecomp.policy.drools.core.DroolsPDPIntegrityMonitor is never used import org.apache.commons.logging.Log is never used import org.apache.commons.logging.LogFactory is never used value of the field IntegrityAuditIntegrationTest.sleepTime is not used --IntegrityMonitorProperties.java import org.apache.commons.logging.Log is never used import org.apache.commons.logging.LogFactory is never used --StandbyStateManagementTest.java import org.openecomp.policy.drools.system.PolicyEngine is never --RepositoryAudit.java import java.nio.file.FileVisitor is never used import java.util.concurrent.Callable is never used --PMStandbyStateChangeNotifier.java import org.openecomp.policy.drools.controller.internal.MavenDroolsController is never used import org.openecomp.policy.drools.event.comm.TopicEndpoint is never used --DroolsSessionEntity.java The serializable class DroolsSessionEntity does not declare a static final serialVersionUID field of type long --DroolsPdpObject.java Comparable is a raw type. References to generic type Comparable<T> should be parameterized Comparable is a raw type. References to generic type Comparable<T> should be parameterized Type safety: The method compareTo(Object) belongs to the raw type Comparable. References to generic type Comparable<T> should be parameterized --DroolsPdpsElectionHandler.java The value of the local variable lowestPriorityPdp is not used Change-Id: Idd563d74c1d6521f7a3759c441f7fe0597011b67 Signed-off-by: Jorge Hernandez <jh1730@att.com>
Diffstat (limited to 'policy-persistence/src')
-rw-r--r--policy-persistence/src/main/java/org/openecomp/policy/drools/core/IntegrityMonitorProperties.java3
-rw-r--r--policy-persistence/src/main/java/org/openecomp/policy/drools/core/RepositoryAudit.java6
-rw-r--r--policy-persistence/src/main/java/org/openecomp/policy/drools/im/PMStandbyStateChangeNotifier.java4
-rw-r--r--policy-persistence/src/main/java/org/openecomp/policy/drools/persistence/DroolsPdpObject.java2
-rw-r--r--policy-persistence/src/main/java/org/openecomp/policy/drools/persistence/DroolsPdpsElectionHandler.java1
-rw-r--r--policy-persistence/src/main/java/org/openecomp/policy/drools/persistence/DroolsSessionEntity.java3
-rw-r--r--policy-persistence/src/test/java/org/openecomp/policy/drools/controller/test/IntegrityAuditIntegrationTest.java18
-rw-r--r--policy-persistence/src/test/java/org/openecomp/policy/drools/controller/test/StandbyStateManagementTest.java5
8 files changed, 9 insertions, 33 deletions
diff --git a/policy-persistence/src/main/java/org/openecomp/policy/drools/core/IntegrityMonitorProperties.java b/policy-persistence/src/main/java/org/openecomp/policy/drools/core/IntegrityMonitorProperties.java
index d1b1ad6d..e0df4e63 100644
--- a/policy-persistence/src/main/java/org/openecomp/policy/drools/core/IntegrityMonitorProperties.java
+++ b/policy-persistence/src/main/java/org/openecomp/policy/drools/core/IntegrityMonitorProperties.java
@@ -22,9 +22,6 @@ package org.openecomp.policy.drools.core;
import java.util.Properties;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
import org.openecomp.policy.common.logging.flexlogger.FlexLogger;
import org.openecomp.policy.common.logging.flexlogger.Logger;
diff --git a/policy-persistence/src/main/java/org/openecomp/policy/drools/core/RepositoryAudit.java b/policy-persistence/src/main/java/org/openecomp/policy/drools/core/RepositoryAudit.java
index c4301364..76dadd9e 100644
--- a/policy-persistence/src/main/java/org/openecomp/policy/drools/core/RepositoryAudit.java
+++ b/policy-persistence/src/main/java/org/openecomp/policy/drools/core/RepositoryAudit.java
@@ -24,15 +24,13 @@ import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
-import java.nio.file.attribute.BasicFileAttributes;
-import java.nio.file.Files;
-import java.nio.file.FileVisitor;
import java.nio.file.FileVisitResult;
+import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.SimpleFileVisitor;
+import java.nio.file.attribute.BasicFileAttributes;
import java.util.LinkedList;
import java.util.Properties;
-import java.util.concurrent.Callable;
import java.util.concurrent.TimeUnit;
import org.openecomp.policy.common.logging.flexlogger.FlexLogger;
diff --git a/policy-persistence/src/main/java/org/openecomp/policy/drools/im/PMStandbyStateChangeNotifier.java b/policy-persistence/src/main/java/org/openecomp/policy/drools/im/PMStandbyStateChangeNotifier.java
index 363e43c4..30877995 100644
--- a/policy-persistence/src/main/java/org/openecomp/policy/drools/im/PMStandbyStateChangeNotifier.java
+++ b/policy-persistence/src/main/java/org/openecomp/policy/drools/im/PMStandbyStateChangeNotifier.java
@@ -45,11 +45,9 @@ import java.util.TimerTask;
import org.openecomp.policy.common.im.StateChangeNotifier;
import org.openecomp.policy.common.im.StateManagement;
-import org.openecomp.policy.drools.controller.internal.MavenDroolsController;
-import org.openecomp.policy.drools.core.IntegrityMonitorProperties;
-import org.openecomp.policy.drools.event.comm.TopicEndpoint;
import org.openecomp.policy.common.logging.flexlogger.FlexLogger;
import org.openecomp.policy.common.logging.flexlogger.Logger;
+import org.openecomp.policy.drools.core.IntegrityMonitorProperties;
import org.openecomp.policy.drools.persistence.DroolsPdpsConnector;
import org.openecomp.policy.drools.persistence.PersistenceFeature;
import org.openecomp.policy.drools.system.PolicyEngine;
diff --git a/policy-persistence/src/main/java/org/openecomp/policy/drools/persistence/DroolsPdpObject.java b/policy-persistence/src/main/java/org/openecomp/policy/drools/persistence/DroolsPdpObject.java
index 7a219148..d9c2d48f 100644
--- a/policy-persistence/src/main/java/org/openecomp/policy/drools/persistence/DroolsPdpObject.java
+++ b/policy-persistence/src/main/java/org/openecomp/policy/drools/persistence/DroolsPdpObject.java
@@ -31,7 +31,7 @@ public abstract class DroolsPdpObject implements DroolsPdp{
return false;
}
}
- private int nullSafeCompare(Comparable one, Comparable two){
+ private int nullSafeCompare(String one, String two){
if(one != null && two != null){
return one.compareTo(two);
}
diff --git a/policy-persistence/src/main/java/org/openecomp/policy/drools/persistence/DroolsPdpsElectionHandler.java b/policy-persistence/src/main/java/org/openecomp/policy/drools/persistence/DroolsPdpsElectionHandler.java
index 40a8a56b..045c4c25 100644
--- a/policy-persistence/src/main/java/org/openecomp/policy/drools/persistence/DroolsPdpsElectionHandler.java
+++ b/policy-persistence/src/main/java/org/openecomp/policy/drools/persistence/DroolsPdpsElectionHandler.java
@@ -180,7 +180,6 @@ public class DroolsPdpsElectionHandler implements ThreadRunningChecker {
Collection<DroolsPdp> pdps = pdpsConnector.getDroolsPdps();
DroolsPdp designatedPdp = null;
- DroolsPdp lowestPriorityPdp = null;
logger.debug
//System.out.println
diff --git a/policy-persistence/src/main/java/org/openecomp/policy/drools/persistence/DroolsSessionEntity.java b/policy-persistence/src/main/java/org/openecomp/policy/drools/persistence/DroolsSessionEntity.java
index 89e310f0..247f9c81 100644
--- a/policy-persistence/src/main/java/org/openecomp/policy/drools/persistence/DroolsSessionEntity.java
+++ b/policy-persistence/src/main/java/org/openecomp/policy/drools/persistence/DroolsSessionEntity.java
@@ -28,6 +28,9 @@ import javax.persistence.Id;
import javax.persistence.ManyToOne;
@Entity
public class DroolsSessionEntity implements Serializable, DroolsSession {
+
+ private static final long serialVersionUID = -5495057038819948709L;
+
@Id
@Column(name="pdpId", nullable=false)
private String pdpId="-1";
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
index 6b654732..c57e3e97 100644
--- 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
@@ -36,24 +36,18 @@ 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.common.logging.eelf.PolicyLogger;
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.JpaDroolsPdpsConnector;
import org.openecomp.policy.drools.persistence.PersistenceFeature;
import org.openecomp.policy.drools.persistence.XacmlPersistenceProperties;
import org.openecomp.policy.drools.system.Main;
@@ -67,14 +61,6 @@ 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.
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
index d1e6336b..b7c3d55e 100644
--- 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
@@ -59,7 +59,6 @@ import org.openecomp.policy.drools.persistence.DroolsPersistenceProperties;
import org.openecomp.policy.drools.persistence.JpaDroolsPdpsConnector;
import org.openecomp.policy.drools.persistence.XacmlPersistenceProperties;
import org.openecomp.policy.drools.system.Main;
-import org.openecomp.policy.drools.system.PolicyEngine;
/*
* All JUnits are designed to run in the local development environment
@@ -1401,10 +1400,6 @@ public class StandbyStateManagementTest {
}
logger.info("PolicyManagementRunner.run: Exiting");
}
-
- public void stopRunner() {
- PolicyEngine.manager.shutdown();
- }
}