summaryrefslogtreecommitdiffstats
path: root/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java
diff options
context:
space:
mode:
authormojahidi <mojahidul.islam@amdocs.com>2017-11-22 18:28:21 +0530
committermojahidi <mojahidul.islam@amdocs.com>2017-11-22 18:30:14 +0530
commit8052ce0a3916c4fb6387af169205274a5e78d4ee (patch)
tree2e53c41b82d96e27805543b77bae8303a04b70eb /openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java
parent5650c6a9b50287d572e8e040085d0ce2100a82a1 (diff)
NeutronPortResourceValidator
This task is about updating error messages with error codes for NeutronPortResourceValidator Change-Id: I6070dfc4543727a29c3625078a947d0059c92fb7 Issue-ID: SDC-572 Signed-off-by: mojahidi <mojahidul.islam@amdocs.com>
Diffstat (limited to 'openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java')
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/heatresource/NeutronPortResourceValidatorTest.java41
1 files changed, 36 insertions, 5 deletions
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/heatresource/NeutronPortResourceValidatorTest.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/heatresource/NeutronPortResourceValidatorTest.java
index 359803f473..83e06ee5b7 100644
--- a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/heatresource/NeutronPortResourceValidatorTest.java
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/heatresource/NeutronPortResourceValidatorTest.java
@@ -18,18 +18,49 @@ public class NeutronPortResourceValidatorTest {
HeatResourceValidator baseValidator = new HeatResourceValidator();
NeutronPortResourceValidator resourceValidator = new NeutronPortResourceValidator();
+ private static final String PATH = "/org/openecomp/validation/validators/heat_validator/";
@Test
- public void testOnlyOneNovaPointsToOnePort() throws IOException {
+ public void testMoreThanOneBindFromNovaToPort() throws IOException {
Map<String, MessageContainer> messages = ValidationTestUtil.testValidator(baseValidator,
- resourceValidator, HeatResourcesTypes.NEUTRON_PORT_RESOURCE_TYPE.getHeatResource(),
- "/org/openecomp/validation/validators/heat_validator/one_nova_points_to_one_port/negative_test/input");
+ resourceValidator, HeatResourcesTypes.NEUTRON_PORT_RESOURCE_TYPE.getHeatResource(),
+ PATH + "one_nova_points_to_one_port/negative_test/input");
Assert.assertNotNull(messages);
Assert.assertEquals(messages.size(), 1);
Assert.assertEquals(messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().size(), 1);
Assert.assertEquals(
- messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().get(0).getMessage(),
- "ERROR: Resource Port oam1_int_port exceed allowed relations from NovaServer");
+ messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().get(0).getMessage(),
+ "ERROR: [HPR2]: Resource Port oam1_int_port exceed allowed relations from NovaServer");
+ }
+
+ @Test
+ public void testPortNotBindToAnyNovaServerHPR1() throws IOException {
+ Map<String, MessageContainer> messages = ValidationTestUtil.testValidator(baseValidator,
+ resourceValidator, HeatResourcesTypes.NOVA_SERVER_RESOURCE_TYPE.getHeatResource(),
+ PATH + "no_neutron_port/input");
+
+ Assert.assertNotNull(messages);
+ Assert.assertEquals(messages.size(), 1);
+
+ Assert.assertEquals(messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().size(), 1);
+ Assert.assertEquals(
+ messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().get(0).getMessage(),
+ "WARNING: [HPR1]: Port not bind to any NOVA Server, Resource Id [nova_server_1]");
+ }
+
+ @Test
+ public void testPortNotBindToAnyNovaServerHPR3() throws IOException {
+ Map<String, MessageContainer> messages = ValidationTestUtil.testValidator(baseValidator,
+ resourceValidator, HeatResourcesTypes.NOVA_SERVER_RESOURCE_TYPE.getHeatResource(),
+ PATH + "port_no_bind_to_any_nova_server/input");
+
+ Assert.assertNotNull(messages);
+ Assert.assertEquals(messages.size(), 1);
+
+ Assert.assertEquals(messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().size(), 1);
+ Assert.assertEquals(
+ messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().get(0).getMessage(),
+ "WARNING: [HPR3]: Port not bind to any NOVA Server, Resource Id [nova_server_1]");
}
}