summaryrefslogtreecommitdiffstats
path: root/examples/examples-adaptive
diff options
context:
space:
mode:
Diffstat (limited to 'examples/examples-adaptive')
-rw-r--r--examples/examples-adaptive/src/main/java/org/onap/policy/apex/examples/adaptive/model/java/AnomalyDetectionPolicyDecideTaskSelectionLogic.java2
-rw-r--r--examples/examples-adaptive/src/main/java/org/onap/policy/apex/examples/adaptive/model/java/AutoLearnPolicyDecideTaskSelectionLogic.java1
-rw-r--r--examples/examples-adaptive/src/test/java/org/onap/policy/apex/examples/adaptive/AnomalyDetectionConceptTest.java23
-rw-r--r--examples/examples-adaptive/src/test/java/org/onap/policy/apex/examples/adaptive/AnomalyDetectionTslUseCaseTest.java1
-rw-r--r--examples/examples-adaptive/src/test/java/org/onap/policy/apex/examples/adaptive/AutoLearnTslUseCaseTest.java1
-rw-r--r--examples/examples-adaptive/src/test/java/org/onap/policy/apex/examples/adaptive/TestApexActionListener.java1
6 files changed, 13 insertions, 16 deletions
diff --git a/examples/examples-adaptive/src/main/java/org/onap/policy/apex/examples/adaptive/model/java/AnomalyDetectionPolicyDecideTaskSelectionLogic.java b/examples/examples-adaptive/src/main/java/org/onap/policy/apex/examples/adaptive/model/java/AnomalyDetectionPolicyDecideTaskSelectionLogic.java
index 99dd28dd8..6c1998108 100644
--- a/examples/examples-adaptive/src/main/java/org/onap/policy/apex/examples/adaptive/model/java/AnomalyDetectionPolicyDecideTaskSelectionLogic.java
+++ b/examples/examples-adaptive/src/main/java/org/onap/policy/apex/examples/adaptive/model/java/AnomalyDetectionPolicyDecideTaskSelectionLogic.java
@@ -26,13 +26,11 @@ import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
-
import org.apache.commons.math3.distribution.TDistribution;
import org.apache.commons.math3.util.FastMath;
import org.onap.policy.apex.core.engine.executor.context.TaskSelectionExecutionContext;
import org.onap.policy.apex.examples.adaptive.concepts.AnomalyDetection;
import org.onap.policy.apex.model.basicmodel.concepts.ApexException;
-import org.slf4j.Logger;
/**
* The Class AnomalyDetectionPolicyDecideTaskSelectionLogic.
diff --git a/examples/examples-adaptive/src/main/java/org/onap/policy/apex/examples/adaptive/model/java/AutoLearnPolicyDecideTaskSelectionLogic.java b/examples/examples-adaptive/src/main/java/org/onap/policy/apex/examples/adaptive/model/java/AutoLearnPolicyDecideTaskSelectionLogic.java
index ef697b077..c0aa620ac 100644
--- a/examples/examples-adaptive/src/main/java/org/onap/policy/apex/examples/adaptive/model/java/AutoLearnPolicyDecideTaskSelectionLogic.java
+++ b/examples/examples-adaptive/src/main/java/org/onap/policy/apex/examples/adaptive/model/java/AutoLearnPolicyDecideTaskSelectionLogic.java
@@ -23,7 +23,6 @@ package org.onap.policy.apex.examples.adaptive.model.java;
import java.util.Arrays;
import java.util.List;
import java.util.Random;
-
import org.onap.policy.apex.context.ContextException;
import org.onap.policy.apex.core.engine.executor.context.TaskSelectionExecutionContext;
import org.onap.policy.apex.examples.adaptive.concepts.AutoLearn;
diff --git a/examples/examples-adaptive/src/test/java/org/onap/policy/apex/examples/adaptive/AnomalyDetectionConceptTest.java b/examples/examples-adaptive/src/test/java/org/onap/policy/apex/examples/adaptive/AnomalyDetectionConceptTest.java
index 623588267..f1c8d7dca 100644
--- a/examples/examples-adaptive/src/test/java/org/onap/policy/apex/examples/adaptive/AnomalyDetectionConceptTest.java
+++ b/examples/examples-adaptive/src/test/java/org/onap/policy/apex/examples/adaptive/AnomalyDetectionConceptTest.java
@@ -20,18 +20,20 @@
package org.onap.policy.apex.examples.adaptive;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotEquals;
+import static org.junit.Assert.assertTrue;
import java.util.LinkedList;
import java.util.List;
-
import org.junit.Test;
import org.onap.policy.apex.examples.adaptive.concepts.AnomalyDetection;
public class AnomalyDetectionConceptTest {
@Test
- public void testToString(){
+ public void testToString() {
AnomalyDetection anomalyDetection = new AnomalyDetection();
List<Double> newAnomalyScores = new LinkedList<>();
newAnomalyScores.add((double) 55);
@@ -39,13 +41,14 @@ public class AnomalyDetectionConceptTest {
anomalyDetection.setFrequency(55);
assertEquals(newAnomalyScores, anomalyDetection.getAnomalyScores());
assertTrue(anomalyDetection.checkSetAnomalyScores());
- assertEquals(55,anomalyDetection.getFrequency());
- assertEquals(true,anomalyDetection.getFirstRound());
- assertEquals("AnomalyDetection [firstRound=true, frequency=55, anomalyScores=[55.0], frequencyForecasted=null]", anomalyDetection.toString());
+ assertEquals(55, anomalyDetection.getFrequency());
+ assertEquals(true, anomalyDetection.getFirstRound());
+ assertEquals("AnomalyDetection [firstRound=true, frequency=55, anomalyScores=[55.0], frequencyForecasted=null]",
+ anomalyDetection.toString());
}
@Test
- public void testHashCode(){
+ public void testHashCode() {
AnomalyDetection detection = new AnomalyDetection();
AnomalyDetection compareDetection = new AnomalyDetection();
assertEquals(detection.hashCode(), compareDetection.hashCode());
@@ -99,13 +102,13 @@ public class AnomalyDetectionConceptTest {
}
@Test
- public void testCheckSets(){
+ public void testCheckSets() {
AnomalyDetection anomalyDetection = new AnomalyDetection();
assertFalse(anomalyDetection.checkSetAnomalyScores());
List<Double> anomalyScores = new LinkedList<>();
anomalyDetection.setAnomalyScores(anomalyScores);
assertFalse(anomalyDetection.checkSetAnomalyScores());
- anomalyScores.add((double)2);
+ anomalyScores.add((double) 2);
anomalyDetection.setAnomalyScores(anomalyScores);
assertTrue(anomalyDetection.checkSetAnomalyScores());
anomalyDetection.unsetAnomalyScores();
@@ -115,7 +118,7 @@ public class AnomalyDetectionConceptTest {
List<Double> frequencyForecasted = new LinkedList<>();
anomalyDetection.setFrequencyForecasted(frequencyForecasted);
assertFalse(anomalyDetection.checkSetFrequencyForecasted());
- frequencyForecasted.add((double)2);
+ frequencyForecasted.add((double) 2);
anomalyDetection.setFrequencyForecasted(frequencyForecasted);
assertTrue(anomalyDetection.checkSetFrequencyForecasted());
anomalyDetection.unsetFrequencyForecasted();
diff --git a/examples/examples-adaptive/src/test/java/org/onap/policy/apex/examples/adaptive/AnomalyDetectionTslUseCaseTest.java b/examples/examples-adaptive/src/test/java/org/onap/policy/apex/examples/adaptive/AnomalyDetectionTslUseCaseTest.java
index d1b2aaae7..5beab7724 100644
--- a/examples/examples-adaptive/src/test/java/org/onap/policy/apex/examples/adaptive/AnomalyDetectionTslUseCaseTest.java
+++ b/examples/examples-adaptive/src/test/java/org/onap/policy/apex/examples/adaptive/AnomalyDetectionTslUseCaseTest.java
@@ -29,7 +29,6 @@ import static org.junit.Assert.assertTrue;
import java.io.IOException;
import java.util.Random;
import java.util.concurrent.TimeUnit;
-
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
diff --git a/examples/examples-adaptive/src/test/java/org/onap/policy/apex/examples/adaptive/AutoLearnTslUseCaseTest.java b/examples/examples-adaptive/src/test/java/org/onap/policy/apex/examples/adaptive/AutoLearnTslUseCaseTest.java
index ab0bf303f..52d1b7ff8 100644
--- a/examples/examples-adaptive/src/test/java/org/onap/policy/apex/examples/adaptive/AutoLearnTslUseCaseTest.java
+++ b/examples/examples-adaptive/src/test/java/org/onap/policy/apex/examples/adaptive/AutoLearnTslUseCaseTest.java
@@ -29,7 +29,6 @@ import static org.junit.Assert.assertTrue;
import java.io.IOException;
import java.util.Random;
import java.util.concurrent.TimeUnit;
-
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
diff --git a/examples/examples-adaptive/src/test/java/org/onap/policy/apex/examples/adaptive/TestApexActionListener.java b/examples/examples-adaptive/src/test/java/org/onap/policy/apex/examples/adaptive/TestApexActionListener.java
index b06908da2..702b050fd 100644
--- a/examples/examples-adaptive/src/test/java/org/onap/policy/apex/examples/adaptive/TestApexActionListener.java
+++ b/examples/examples-adaptive/src/test/java/org/onap/policy/apex/examples/adaptive/TestApexActionListener.java
@@ -26,7 +26,6 @@ import static org.awaitility.Awaitility.await;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;
-
import org.onap.policy.apex.core.engine.engine.EnEventListener;
import org.onap.policy.apex.core.engine.event.EnEvent;