summaryrefslogtreecommitdiffstats
path: root/controlloop/common/controller-usecases/src/test/java
diff options
context:
space:
mode:
Diffstat (limited to 'controlloop/common/controller-usecases/src/test/java')
-rw-r--r--controlloop/common/controller-usecases/src/test/java/org/onap/policy/controlloop/VfwTest.java42
1 files changed, 28 insertions, 14 deletions
diff --git a/controlloop/common/controller-usecases/src/test/java/org/onap/policy/controlloop/VfwTest.java b/controlloop/common/controller-usecases/src/test/java/org/onap/policy/controlloop/VfwTest.java
index 202bd3008..3796f0bfb 100644
--- a/controlloop/common/controller-usecases/src/test/java/org/onap/policy/controlloop/VfwTest.java
+++ b/controlloop/common/controller-usecases/src/test/java/org/onap/policy/controlloop/VfwTest.java
@@ -2,7 +2,7 @@
* ============LICENSE_START=======================================================
* ONAP
* ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -43,7 +43,8 @@ public class VfwTest extends UsecasesBase {
/**
* VFW Tosca Policy File.
*/
- private static final String TOSCA_POLICY_VFW = "src/test/resources/vfw/tosca-vfw.json";
+ private static final String TOSCA_LEGACY_POLICY_VFW = "src/test/resources/vfw/tosca-vfw.json";
+ private static final String TOSCA_COMPLIANT_POLICY_VFW = "src/test/resources/vfw/tosca-compliant-vfw.json";
/*
* VFW Use case Messages.
@@ -85,8 +86,7 @@ public class VfwTest extends UsecasesBase {
/**
* Sunny day scenario for the VFW use case.
*/
- @Test
- public void sunnyDay() throws IOException {
+ private void sunnyDay() throws IOException {
/* Inject an ONSET event over the DCAE topic */
injectOnTopic(DCAE_TOPIC, Paths.get(ONSET));
@@ -119,6 +119,30 @@ public class VfwTest extends UsecasesBase {
}
/**
+ * Sunny Day with Legacy Tosca Policy.
+ */
+ @Test
+ public void sunnyDayLegacy() throws InterruptedException, CoderException, IOException {
+ assertEquals(0, usecases.getDrools().factCount(USECASES));
+ policy = setupPolicy(TOSCA_LEGACY_POLICY_VFW);
+ assertEquals(2, usecases.getDrools().factCount(USECASES));
+
+ sunnyDay();
+ }
+
+ /**
+ * Sunny Day with Tosca Compliant Policy.
+ */
+ @Test
+ public void sunnyDayCompliant() throws InterruptedException, CoderException, IOException {
+ assertEquals(0, usecases.getDrools().factCount(USECASES));
+ policy = setupPolicy(TOSCA_COMPLIANT_POLICY_VFW);
+ assertEquals(2, usecases.getDrools().factCount(USECASES));
+
+ sunnyDay();
+ }
+
+ /**
* Observe Topics.
*/
@Before
@@ -147,16 +171,6 @@ public class VfwTest extends UsecasesBase {
}
/**
- * Install Policy.
- */
- @Before
- public void installPolicy() throws IOException, CoderException, InterruptedException {
- assertEquals(0, usecases.getDrools().factCount(USECASES));
- policy = setupPolicy(TOSCA_POLICY_VFW);
- assertEquals(2, usecases.getDrools().factCount(USECASES));
- }
-
- /**
* Uninstall Policy.
*/
@After