aboutsummaryrefslogtreecommitdiffstats
path: root/src/test/java
diff options
context:
space:
mode:
authorTait,Trevor(rt0435) <rtait@amdocs.com>2018-08-17 16:03:32 -0400
committerTait,Trevor(rt0435) <rtait@amdocs.com>2018-08-27 13:11:55 -0400
commitd26f38d193e2cee5b502c7418f282dc69a029a3c (patch)
treee07b494695d10c2d3121831bdeeb9a933998b5f5 /src/test/java
parentbabe600d76c8593c84f3d5fabfc4bff1a068bee1 (diff)
Version 1
Issue-ID: LOG-614 Change-Id: I894dd52b6592c9c09f10793a2f13a369081938a6 Signed-off-by: Tait,Trevor(rt0435) <rtait@amdocs.com>
Diffstat (limited to 'src/test/java')
-rw-r--r--src/test/java/org/onap/pomba/common/datatypes/AttributeTests.java43
-rw-r--r--src/test/java/org/onap/pomba/common/datatypes/DataQualityTests.java37
-rw-r--r--src/test/java/org/onap/pomba/common/datatypes/ModelContextTests.java20
-rw-r--r--src/test/java/org/onap/pomba/common/datatypes/ServiceTests.java21
-rw-r--r--src/test/java/org/onap/pomba/common/datatypes/VfModuleTests.java22
-rw-r--r--src/test/java/org/onap/pomba/common/datatypes/VfTests.java15
-rw-r--r--src/test/java/org/onap/pomba/common/datatypes/VnfcTests.java18
7 files changed, 170 insertions, 6 deletions
diff --git a/src/test/java/org/onap/pomba/common/datatypes/AttributeTests.java b/src/test/java/org/onap/pomba/common/datatypes/AttributeTests.java
new file mode 100644
index 0000000..2eb6a72
--- /dev/null
+++ b/src/test/java/org/onap/pomba/common/datatypes/AttributeTests.java
@@ -0,0 +1,43 @@
+/*
+ * ============LICENSE_START===================================================
+ * Copyright (c) 2018 Amdocs
+ * ============================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=====================================================
+ */
+
+package org.onap.pomba.common.datatypes;
+
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+import org.onap.pomba.common.datatypes.Attribute.Value;
+import org.onap.pomba.common.datatypes.DataQuality.Status;
+
+public class AttributeTests {
+ @Test
+ public void testAttribute() {
+ Attribute attribute = new Attribute();
+ attribute.setName("Attribute");
+ attribute.setValue(Value.adminState);
+ assertTrue("Attribute name doesn't match", attribute.getName().equals("Attribute"));
+ assertTrue("Attribute value doesn't match", attribute.getValue().equals(Value.adminState));
+ DataQuality dataQuality = new DataQuality();
+ dataQuality.setStatus(Status.error);
+ dataQuality.setErrorText("Test");
+ attribute.setDataQuality(dataQuality);
+ assertTrue("Attribute data quality status doesn't match", attribute.getDataQuality().getStatus().equals(Status.error));
+ assertTrue("Attribute data quality error text doesn't match", attribute.getDataQuality().getErrorText().equals("Test"));
+ }
+
+}
diff --git a/src/test/java/org/onap/pomba/common/datatypes/DataQualityTests.java b/src/test/java/org/onap/pomba/common/datatypes/DataQualityTests.java
new file mode 100644
index 0000000..3a71cd8
--- /dev/null
+++ b/src/test/java/org/onap/pomba/common/datatypes/DataQualityTests.java
@@ -0,0 +1,37 @@
+/*
+ * ============LICENSE_START===================================================
+ * Copyright (c) 2018 Amdocs
+ * ============================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=====================================================
+ */
+
+package org.onap.pomba.common.datatypes;
+
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+import org.onap.pomba.common.datatypes.DataQuality.Status;
+
+public class DataQualityTests {
+ @Test
+ public void testDataQuality() {
+ DataQuality dataQuality = new DataQuality();
+ dataQuality.setStatus(Status.ok);
+ assertTrue("DataQuality status doesn't match", dataQuality.getStatus().equals(Status.ok));
+ dataQuality.setStatus(Status.error);
+ dataQuality.setErrorText("Test");
+ assertTrue("DataQuality status doesn't match", dataQuality.getStatus().equals(Status.error));
+ assertTrue("DataQuality error text doesn't match", dataQuality.getErrorText().equals("Test"));
+ }
+}
diff --git a/src/test/java/org/onap/pomba/common/datatypes/ModelContextTests.java b/src/test/java/org/onap/pomba/common/datatypes/ModelContextTests.java
index bad0523..85dbfc7 100644
--- a/src/test/java/org/onap/pomba/common/datatypes/ModelContextTests.java
+++ b/src/test/java/org/onap/pomba/common/datatypes/ModelContextTests.java
@@ -15,6 +15,7 @@
* limitations under the License.
* ============LICENSE_END=====================================================
*/
+
package org.onap.pomba.common.datatypes;
import static org.junit.Assert.assertEquals;
@@ -24,9 +25,28 @@ import java.util.ArrayList;
import java.util.List;
import org.junit.Test;
+import org.onap.pomba.common.datatypes.DataQuality.Status;
public class ModelContextTests {
@Test
+ public void testModelContext() {
+ ModelContext modelContext = new ModelContext();
+ DataQuality dataQuality = new DataQuality();
+ dataQuality.setStatus(Status.error);
+ dataQuality.setErrorText("Test");
+ modelContext.setDataQuality(dataQuality);
+ assertTrue("ModelContext data quality status doesn't match", modelContext.getDataQuality().getStatus().equals(Status.error));
+ assertTrue("ModelContext data quality error text doesn't match", modelContext.getDataQuality().getErrorText().equals("Test"));
+ Attribute attribute = new Attribute();
+ attribute.setName("Attribute");
+ modelContext.addAttribute(attribute);
+ assertTrue("ModelContext attribute name doesn't match", modelContext.getAttribute().get(0).getName().equals("Attribute"));
+ List<Attribute> attributeList = modelContext.getAttribute();
+ modelContext.setAttribute(attributeList);
+ assertEquals(modelContext.getAttribute().size(), 1);
+ }
+
+ @Test
public void testSetService() {
ModelContext modelContext = new ModelContext();
Service aService = new Service();
diff --git a/src/test/java/org/onap/pomba/common/datatypes/ServiceTests.java b/src/test/java/org/onap/pomba/common/datatypes/ServiceTests.java
index 1f7ba50..a4ebc74 100644
--- a/src/test/java/org/onap/pomba/common/datatypes/ServiceTests.java
+++ b/src/test/java/org/onap/pomba/common/datatypes/ServiceTests.java
@@ -15,11 +15,14 @@
* limitations under the License.
* ============LICENSE_END=====================================================
*/
-package org.onap.pomba.common.datatypes;
-import org.junit.Test;
+package org.onap.pomba.common.datatypes;
+import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
+import java.util.List;
+import org.junit.Test;
+import org.onap.pomba.common.datatypes.DataQuality.Status;
public class ServiceTests {
@Test
@@ -28,9 +31,21 @@ public class ServiceTests {
aService.setName("new service");
aService.setInvariantUuid("Invariant Uuid");
aService.setUuid("Uuid");
-
+ DataQuality dataQuality = new DataQuality();
+ dataQuality.setStatus(Status.error);
+ dataQuality.setErrorText("Test");
+ aService.setDataQuality(dataQuality);
+ Attribute attribute = new Attribute();
+ attribute.setName("Attribute");
+ aService.addAttribute(attribute);
assertTrue("Service Name doesn't match", aService.getName().equals("new service"));
assertTrue("Invariant Uuid doesn't match", aService.getInvariantUuid().equals("Invariant Uuid"));
assertTrue("Uuid doesn't match", aService.getUuid().equals("Uuid"));
+ assertTrue("Service data quality status doesn't match", aService.getDataQuality().getStatus().equals(Status.error));
+ assertTrue("Service data quality error text doesn't match", aService.getDataQuality().getErrorText().equals("Test"));
+ assertTrue("Service attribute name doesn't match", aService.getAttribute().get(0).getName().equals("Attribute"));
+ List<Attribute> attributeList = aService.getAttribute();
+ aService.setAttribute(attributeList);
+ assertEquals(aService.getAttribute().size(), 1);
}
}
diff --git a/src/test/java/org/onap/pomba/common/datatypes/VfModuleTests.java b/src/test/java/org/onap/pomba/common/datatypes/VfModuleTests.java
index afce299..3bb577c 100644
--- a/src/test/java/org/onap/pomba/common/datatypes/VfModuleTests.java
+++ b/src/test/java/org/onap/pomba/common/datatypes/VfModuleTests.java
@@ -15,25 +15,43 @@
* limitations under the License.
* ============LICENSE_END=====================================================
*/
+
package org.onap.pomba.common.datatypes;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
-
+import java.util.List;
import org.junit.Test;
+import org.onap.pomba.common.datatypes.DataQuality.Status;
public class VfModuleTests {
@Test
public void testVFModule() {
VFModule aVFModule = new VFModule();
+ aVFModule.setName("Name");
aVFModule.setInvariantUuid("Invariant Uuid");
aVFModule.setUuid("Uuid");
+ aVFModule.setNfNamingCode("Nf Naming Code");
aVFModule.setMaxInstances(10);
aVFModule.setMinInstances(1);
-
+ DataQuality dataQuality = new DataQuality();
+ dataQuality.setStatus(Status.error);
+ dataQuality.setErrorText("Test");
+ aVFModule.setDataQuality(dataQuality);
+ Attribute attribute = new Attribute();
+ attribute.setName("Attribute");
+ aVFModule.addAttribute(attribute);
+ assertTrue("VFModule Name doesn't match", aVFModule.getName().equals("Name"));
assertTrue("VFModule Invariant Uuid doesn't match", aVFModule.getInvariantUuid().equals("Invariant Uuid"));
assertTrue("VFModule Uuid doesn't match", aVFModule.getUuid().equals("Uuid"));
+ assertTrue("VFModule Nf Naming Code doesn't match", aVFModule.getNfNamingCode().equals("Nf Naming Code"));
assertEquals(aVFModule.getMaxInstances(), 10);
assertEquals(aVFModule.getMinInstances(), 1);
+ assertTrue("VFModule data quality status doesn't match", aVFModule.getDataQuality().getStatus().equals(Status.error));
+ assertTrue("VFModule data quality error text doesn't match", aVFModule.getDataQuality().getErrorText().equals("Test"));
+ assertTrue("VFModule attribute name doesn't match", aVFModule.getAttribute().get(0).getName().equals("Attribute"));
+ List<Attribute> attributeList = aVFModule.getAttribute();
+ aVFModule.setAttribute(attributeList);
+ assertEquals(aVFModule.getAttribute().size(), 1);
}
}
diff --git a/src/test/java/org/onap/pomba/common/datatypes/VfTests.java b/src/test/java/org/onap/pomba/common/datatypes/VfTests.java
index 8b2a255..9c17589 100644
--- a/src/test/java/org/onap/pomba/common/datatypes/VfTests.java
+++ b/src/test/java/org/onap/pomba/common/datatypes/VfTests.java
@@ -15,6 +15,7 @@
* limitations under the License.
* ============LICENSE_END=====================================================
*/
+
package org.onap.pomba.common.datatypes;
import static org.junit.Assert.assertEquals;
@@ -24,6 +25,7 @@ import java.util.ArrayList;
import java.util.List;
import org.junit.Test;
+import org.onap.pomba.common.datatypes.DataQuality.Status;
public class VfTests {
@Test
@@ -34,11 +36,24 @@ public class VfTests {
aVF.setInvariantUuid("Invariant Uuid");
aVF.setUuid("Uuid");
aVF.setNfNamingCode("NF Naming Code");
+ DataQuality dataQuality = new DataQuality();
+ dataQuality.setStatus(Status.error);
+ dataQuality.setErrorText("Test");
+ aVF.setDataQuality(dataQuality);
+ Attribute attribute = new Attribute();
+ attribute.setName("Attribute");
+ aVF.addAttribute(attribute);
assertTrue("VF name doesn't match", aVF.getName().equals("VF name"));
assertTrue("VF Type doesn't match", aVF.getType().equals("Type"));
assertTrue("VF Invariant Uuid doesn't match", aVF.getInvariantUuid().equals("Invariant Uuid"));
assertTrue("VF Uuid doesn't match", aVF.getUuid().equals("Uuid"));
assertTrue("VF NF Naming Code doesn't match", aVF.getNfNamingCode().equals("NF Naming Code"));
+ assertTrue("VF data quality status doesn't match", aVF.getDataQuality().getStatus().equals(Status.error));
+ assertTrue("VF data quality error text doesn't match", aVF.getDataQuality().getErrorText().equals("Test"));
+ assertTrue("VF attribute name doesn't match", aVF.getAttribute().get(0).getName().equals("Attribute"));
+ List<Attribute> attributeList = aVF.getAttribute();
+ aVF.setAttribute(attributeList);
+ assertEquals(aVF.getAttribute().size(), 1);
}
@Test
diff --git a/src/test/java/org/onap/pomba/common/datatypes/VnfcTests.java b/src/test/java/org/onap/pomba/common/datatypes/VnfcTests.java
index b1c1285..ea5ccc4 100644
--- a/src/test/java/org/onap/pomba/common/datatypes/VnfcTests.java
+++ b/src/test/java/org/onap/pomba/common/datatypes/VnfcTests.java
@@ -15,11 +15,14 @@
* limitations under the License.
* ============LICENSE_END=====================================================
*/
+
package org.onap.pomba.common.datatypes;
+import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
-
+import java.util.List;
import org.junit.Test;
+import org.onap.pomba.common.datatypes.DataQuality.Status;
public class VnfcTests {
@Test
@@ -29,9 +32,22 @@ public class VnfcTests {
aVNFC.setInvariantUuid("Invariant Uuid");
aVNFC.setUuid("Uuid");
aVNFC.setNfcNamingCode("NFC Naming Code");
+ DataQuality dataQuality = new DataQuality();
+ dataQuality.setStatus(Status.error);
+ dataQuality.setErrorText("Test");
+ aVNFC.setDataQuality(dataQuality);
+ Attribute attribute = new Attribute();
+ attribute.setName("Attribute");
+ aVNFC.addAttribute(attribute);
assertTrue("VNFC name doesn't match", aVNFC.getName().equals("VNFC name"));
assertTrue("VNFC invariant uuid doesn't match", aVNFC.getInvariantUuid().equals("Invariant Uuid"));
assertTrue("VNFC NFC Naming Code doesn't match", aVNFC.getNfcNamingCode().equals("NFC Naming Code"));
assertTrue("VNFC uuid doesn't match", aVNFC.getUuid().equals("Uuid"));
+ assertTrue("VNFC data quality status doesn't match", aVNFC.getDataQuality().getStatus().equals(Status.error));
+ assertTrue("VNFC data quality error text doesn't match", aVNFC.getDataQuality().getErrorText().equals("Test"));
+ assertTrue("VNFC attribute name doesn't match", aVNFC.getAttribute().get(0).getName().equals("Attribute"));
+ List<Attribute> attributeList = aVNFC.getAttribute();
+ aVNFC.setAttribute(attributeList);
+ assertEquals(aVNFC.getAttribute().size(), 1);
}
}