diff options
author | jhh <jorge.hernandez-herrero@att.com> | 2020-02-20 18:19:36 -0600 |
---|---|---|
committer | jhh <jorge.hernandez-herrero@att.com> | 2020-02-21 12:01:01 -0600 |
commit | 43c1e8c7c820bc8004725355a4a5eb0ad519e680 (patch) | |
tree | 01efdd23c6fa7395c07e6786c103d41c83cf2ac5 /controlloop/common/controller-usecases/src/test/java | |
parent | 5cdc0da265e1488321f88c38d9e0fb9d3626f54d (diff) |
Tosca compliant vFirewall
Issue-ID: POLICY-2376
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
Change-Id: I362ebbd941c400a6ffc3e952e66ca2d624afbfdd
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
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.java | 42 |
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 |