summaryrefslogtreecommitdiffstats
path: root/examples/examples-adaptive/src/test/java/org
diff options
context:
space:
mode:
Diffstat (limited to 'examples/examples-adaptive/src/test/java/org')
-rw-r--r--examples/examples-adaptive/src/test/java/org/onap/policy/apex/examples/adaptive/TestAnomalyDetectionTslUseCase.java27
-rw-r--r--examples/examples-adaptive/src/test/java/org/onap/policy/apex/examples/adaptive/TestAutoLearnTslUseCase.java28
2 files changed, 49 insertions, 6 deletions
diff --git a/examples/examples-adaptive/src/test/java/org/onap/policy/apex/examples/adaptive/TestAnomalyDetectionTslUseCase.java b/examples/examples-adaptive/src/test/java/org/onap/policy/apex/examples/adaptive/TestAnomalyDetectionTslUseCase.java
index 4b66eb116..cb7e3c824 100644
--- a/examples/examples-adaptive/src/test/java/org/onap/policy/apex/examples/adaptive/TestAnomalyDetectionTslUseCase.java
+++ b/examples/examples-adaptive/src/test/java/org/onap/policy/apex/examples/adaptive/TestAnomalyDetectionTslUseCase.java
@@ -44,7 +44,7 @@ import org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey;
import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult;
import org.onap.policy.apex.model.policymodel.concepts.AxPolicyModel;
import org.onap.policy.apex.plugins.executor.java.JavaExecutorParameters;
-import org.onap.policy.apex.plugins.executor.mvel.MVELExecutorParameters;
+import org.onap.policy.apex.plugins.executor.mvel.MvelExecutorParameters;
import org.onap.policy.common.parameters.ParameterService;
import org.slf4j.ext.XLogger;
import org.slf4j.ext.XLoggerFactory;
@@ -66,6 +66,9 @@ public class TestAnomalyDetectionTslUseCase {
private ContextParameters contextParameters;
private EngineParameters engineParameters;
+ /**
+ * Before test.
+ */
@Before
public void beforeTest() {
schemaParameters = new SchemaParameters();
@@ -88,11 +91,14 @@ public class TestAnomalyDetectionTslUseCase {
ParameterService.register(contextParameters.getPersistorParameters());
engineParameters = new EngineParameters();
- engineParameters.getExecutorParameterMap().put("MVEL", new MVELExecutorParameters());
+ engineParameters.getExecutorParameterMap().put("MVEL", new MvelExecutorParameters());
engineParameters.getExecutorParameterMap().put("JAVA", new JavaExecutorParameters());
ParameterService.register(engineParameters);
}
+ /**
+ * After test.
+ */
@After
public void afterTest() {
ParameterService.deregister(engineParameters);
@@ -105,6 +111,13 @@ public class TestAnomalyDetectionTslUseCase {
ParameterService.deregister(schemaParameters);
}
+ /**
+ * Test anomaly detection tsl.
+ *
+ * @throws ApexException the apex exception
+ * @throws InterruptedException the interrupted exception
+ * @throws IOException Signals that an I/O exception has occurred.
+ */
@Test
// once through the long running test below
public void testAnomalyDetectionTsl() throws ApexException, InterruptedException, IOException {
@@ -170,7 +183,7 @@ public class TestAnomalyDetectionTslUseCase {
final AxArtifactKey key = new AxArtifactKey("AnomalyTSLApexEngine", "0.0.1");
final EngineParameters parameters = new EngineParameters();
- parameters.getExecutorParameterMap().put("MVEL", new MVELExecutorParameters());
+ parameters.getExecutorParameterMap().put("MVEL", new MvelExecutorParameters());
parameters.getExecutorParameterMap().put("JAVA", new JavaExecutorParameters());
final ApexEngine apexEngine1 = new ApexEngineFactory().createApexEngine(key);
@@ -205,6 +218,14 @@ public class TestAnomalyDetectionTslUseCase {
Thread.sleep(1000);
}
+ /**
+ * The main method.
+ *
+ * @param args the arguments
+ * @throws ApexException the apex exception
+ * @throws InterruptedException the interrupted exception
+ * @throws IOException Signals that an I/O exception has occurred.
+ */
public static void main(final String[] args) throws ApexException, InterruptedException, IOException {
new TestAnomalyDetectionTslUseCase().testAnomalyDetectionTslmain();
}
diff --git a/examples/examples-adaptive/src/test/java/org/onap/policy/apex/examples/adaptive/TestAutoLearnTslUseCase.java b/examples/examples-adaptive/src/test/java/org/onap/policy/apex/examples/adaptive/TestAutoLearnTslUseCase.java
index 632ae623e..3052c31a7 100644
--- a/examples/examples-adaptive/src/test/java/org/onap/policy/apex/examples/adaptive/TestAutoLearnTslUseCase.java
+++ b/examples/examples-adaptive/src/test/java/org/onap/policy/apex/examples/adaptive/TestAutoLearnTslUseCase.java
@@ -44,11 +44,12 @@ import org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey;
import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult;
import org.onap.policy.apex.model.policymodel.concepts.AxPolicyModel;
import org.onap.policy.apex.plugins.executor.java.JavaExecutorParameters;
-import org.onap.policy.apex.plugins.executor.mvel.MVELExecutorParameters;
+import org.onap.policy.apex.plugins.executor.mvel.MvelExecutorParameters;
import org.onap.policy.common.parameters.ParameterService;
import org.slf4j.ext.XLogger;
import org.slf4j.ext.XLoggerFactory;
+// TODO: Auto-generated Javadoc
/**
* Test Auto learning in TSL.
*
@@ -64,6 +65,9 @@ public class TestAutoLearnTslUseCase {
private ContextParameters contextParameters;
private EngineParameters engineParameters;
+ /**
+ * Before test.
+ */
@Before
public void beforeTest() {
schemaParameters = new SchemaParameters();
@@ -86,11 +90,14 @@ public class TestAutoLearnTslUseCase {
ParameterService.register(contextParameters.getPersistorParameters());
engineParameters = new EngineParameters();
- engineParameters.getExecutorParameterMap().put("MVEL", new MVELExecutorParameters());
+ engineParameters.getExecutorParameterMap().put("MVEL", new MvelExecutorParameters());
engineParameters.getExecutorParameterMap().put("JAVA", new JavaExecutorParameters());
ParameterService.register(engineParameters);
}
+ /**
+ * After test.
+ */
@After
public void afterTest() {
ParameterService.deregister(engineParameters);
@@ -103,6 +110,13 @@ public class TestAutoLearnTslUseCase {
ParameterService.deregister(schemaParameters);
}
+ /**
+ * Test auto learn tsl.
+ *
+ * @throws ApexException the apex exception
+ * @throws InterruptedException the interrupted exception
+ * @throws IOException Signals that an I/O exception has occurred.
+ */
@Test
// once through the long running test below
public void testAutoLearnTsl() throws ApexException, InterruptedException, IOException {
@@ -167,7 +181,7 @@ public class TestAutoLearnTslUseCase {
final AxArtifactKey key = new AxArtifactKey("AADMApexEngine", "0.0.1");
final EngineParameters parameters = new EngineParameters();
- parameters.getExecutorParameterMap().put("MVEL", new MVELExecutorParameters());
+ parameters.getExecutorParameterMap().put("MVEL", new MvelExecutorParameters());
parameters.getExecutorParameterMap().put("JAVA", new JavaExecutorParameters());
final ApexEngine apexEngine1 = new ApexEngineFactory().createApexEngine(key);
@@ -228,6 +242,14 @@ public class TestAutoLearnTslUseCase {
}
+ /**
+ * The main method.
+ *
+ * @param args the arguments
+ * @throws ApexException the apex exception
+ * @throws InterruptedException the interrupted exception
+ * @throws IOException Signals that an I/O exception has occurred.
+ */
public static void main(final String[] args) throws ApexException, InterruptedException, IOException {
new TestAutoLearnTslUseCase().testAutoLearnTslMain();
}