summaryrefslogtreecommitdiffstats
path: root/appc-dg/appc-dg-shared
diff options
context:
space:
mode:
authorLori Keighron <lk2924@att.com>2019-02-11 17:21:37 -0500
committerTakamune Cho <takamune.cho@att.com>2019-02-14 16:28:17 +0000
commitc751a9532c263b542f7f420071c545844fa56dc7 (patch)
tree3336fee3eef71604bf9b4e7740446e6dec094c3a /appc-dg/appc-dg-shared
parent796ca12ab0fba32db8b4a0dff4cc4e972652c35d (diff)
Check vm-capabilites on vnf-level OS requests
New per-vm capabilities checking is introduced for vnf-level OpenStack actions Additional changes per initial review. Additional changes in TestVnfc.java per second review. Change-Id: Idd1d834df076c1e525f596b788b69ed63ba9e66b Issue-ID: APPC-1380 Signed-off-by: Lori Keighron <lk2924@att.com>
Diffstat (limited to 'appc-dg/appc-dg-shared')
-rw-r--r--appc-dg/appc-dg-shared/appc-dg-domain-model-lib/src/main/java/org/onap/appc/domainmodel/Vnfc.java10
-rw-r--r--appc-dg/appc-dg-shared/appc-dg-domain-model-lib/src/test/java/org/onap/appc/domainmodel/TestVnfc.java27
2 files changed, 28 insertions, 9 deletions
diff --git a/appc-dg/appc-dg-shared/appc-dg-domain-model-lib/src/main/java/org/onap/appc/domainmodel/Vnfc.java b/appc-dg/appc-dg-shared/appc-dg-domain-model-lib/src/main/java/org/onap/appc/domainmodel/Vnfc.java
index f908286bd..d5e201b22 100644
--- a/appc-dg/appc-dg-shared/appc-dg-domain-model-lib/src/main/java/org/onap/appc/domainmodel/Vnfc.java
+++ b/appc-dg/appc-dg-shared/appc-dg-domain-model-lib/src/main/java/org/onap/appc/domainmodel/Vnfc.java
@@ -33,6 +33,7 @@ public class Vnfc {
private String resilienceType;
private boolean mandatory;
private String vnfcName;
+ private String vnfcFunctionCode;
private List<Vserver> vserverList;
public Vnfc(){
@@ -124,7 +125,16 @@ public class Vnfc {
public void setVnfcName(String vnfcName) {
this.vnfcName = vnfcName;
}
+
+ public String getVnfcFunctionCode() {
+ return vnfcFunctionCode;
+ }
+
+ public void setVnfcFunctionCode(String vnfcFunctionCode) {
+ this.vnfcFunctionCode = vnfcFunctionCode;
+ }
+
public List<Vserver> getVserverList() {
return vserverList;
}
diff --git a/appc-dg/appc-dg-shared/appc-dg-domain-model-lib/src/test/java/org/onap/appc/domainmodel/TestVnfc.java b/appc-dg/appc-dg-shared/appc-dg-domain-model-lib/src/test/java/org/onap/appc/domainmodel/TestVnfc.java
index 21936ac47..6069d47eb 100644
--- a/appc-dg/appc-dg-shared/appc-dg-domain-model-lib/src/test/java/org/onap/appc/domainmodel/TestVnfc.java
+++ b/appc-dg/appc-dg-shared/appc-dg-domain-model-lib/src/test/java/org/onap/appc/domainmodel/TestVnfc.java
@@ -45,21 +45,28 @@ public class TestVnfc {
public void testGetVnfcType() {
vnfc.setVnfcType("1");
assertNotNull(vnfc.getVnfcType());
- assertEquals(vnfc.getVnfcType(), "1");
+ assertEquals("1", vnfc.getVnfcType());
}
@Test
public void testGetResilienceType() {
vnfc.setResilienceType("resilienceType");
assertNotNull(vnfc.getResilienceType());
- assertEquals(vnfc.getResilienceType(), "resilienceType");
+ assertEquals("resilienceType", vnfc.getResilienceType());
}
@Test
public void testGetVnfcName() {
vnfc.setVnfcName("vnfcName");
assertNotNull(vnfc.getVnfcName());
- assertEquals(vnfc.getVnfcName(), "vnfcName");
+ assertEquals("vnfcName", vnfc.getVnfcName());
+ }
+
+ @Test
+ public void testGetVnfcFunctionCode() {
+ vnfc.setVnfcFunctionCode("vnfcFunctionCode");
+ assertNotNull(vnfc.getVnfcFunctionCode());
+ assertEquals("vnfcFunctionCode", vnfc.getVnfcFunctionCode());
}
@Test
@@ -67,14 +74,14 @@ public class TestVnfc {
List<Vserver> vserverList = new LinkedList<>();
vnfc.setVserverList(vserverList);
assertNotNull(vnfc.getVserverList());
- assertEquals(vnfc.getVserverList(), vserverList);
+ assertEquals(vserverList, vnfc.getVserverList());
}
@Test
public void testIsMandatory() {
vnfc.setMandatory(false);
assertNotNull(vnfc.isMandatory());
- assertEquals(vnfc.isMandatory(), false);
+ assertEquals(false, vnfc.isMandatory());
}
@Test
@@ -93,8 +100,9 @@ public class TestVnfc {
System.out.println("ok vnfc = " + vnfc.toString());
- assertEquals(vnfc.toString(),
- "Vnfc : vnfcType = B, vnfcName = A, resilienceType = null, mandatory = falseVserver : url = http://v1.net, tenantId = V1-T1, id = V1 ,relatedLink = V1-relatedlink , name = V1-Name, \n");
+ assertEquals(
+ "Vnfc : vnfcType = B, vnfcName = A, resilienceType = null, mandatory = falseVserver : url = http://v1.net, tenantId = V1-T1, id = V1 ,relatedLink = V1-relatedlink , name = V1-Name, \n",
+ vnfc.toString());
}
@Test
@@ -153,8 +161,9 @@ public class TestVnfc {
System.out.println("vnfc = " + vnfc.toString());
- assertEquals(vnfc.toString(),
- "Vnfc : vnfcType = B, vnfcName = A, resilienceType = null, mandatory = falseVserver : url = http://v1.net, tenantId = V1-T1, id = V1 ,relatedLink = V1-relatedlink , name = V1-Name, \n");
+ assertEquals(
+ "Vnfc : vnfcType = B, vnfcName = A, resilienceType = null, mandatory = falseVserver : url = http://v1.net, tenantId = V1-T1, id = V1 ,relatedLink = V1-relatedlink , name = V1-Name, \n",
+ vnfc.toString());
}
@Test