summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShubhada <SV00449682@techmahindra.com>2018-02-01 17:02:09 +0530
committerPatrick Brady <pb071s@att.com>2018-02-06 05:26:34 +0000
commitfc325fc52719a5db0b0047e82355bcacb4f88d28 (patch)
tree168d63ee9f8fc1d22769f20c2291f7bcf4eea003
parentd8d05ed2691a24bd278736064c1cd695fe785808 (diff)
Unit test for APPC yang generator
Provide unit coverage for /org/onap/appc/yang/type bundle. https://sonar.onap.org/drilldown/measures/114359?highlight=coverage&metric=uncovered_lines&rids%5B%5D=115255&rids%5B%5D=115275 Change-Id: I3cb77301b7d7369aa95dd5c493af690f6c5fcd59 Signed-off-by: Shubhada <SV00449682@techmahindra.com> Issue-ID: APPC-534"
-rw-r--r--appc-sdc-listener/appc-yang-generator/src/test/java/org/onap/appc/yang/type/TestYangTypes.java28
1 files changed, 28 insertions, 0 deletions
diff --git a/appc-sdc-listener/appc-yang-generator/src/test/java/org/onap/appc/yang/type/TestYangTypes.java b/appc-sdc-listener/appc-yang-generator/src/test/java/org/onap/appc/yang/type/TestYangTypes.java
new file mode 100644
index 000000000..778574f1c
--- /dev/null
+++ b/appc-sdc-listener/appc-yang-generator/src/test/java/org/onap/appc/yang/type/TestYangTypes.java
@@ -0,0 +1,28 @@
+package org.onap.appc.yang.type;
+
+import static org.junit.Assert.assertEquals;
+import java.util.Map;
+import org.junit.Test;
+
+public class TestYangTypes {
+ private Map<String, String> testTypeMap = YangTypes.getYangTypeMap();
+
+ @Test
+ public void testGetYangTypeMap_Size() {
+ assertEquals(48, testTypeMap.size());
+ }
+ @Test(expected = java.lang.UnsupportedOperationException.class)
+ public void testGetYangTypeMap_UnModifiableMap() {
+ testTypeMap.remove("timeticks");
+ assertEquals(47, testTypeMap.size());
+ }
+ @Test
+ public void testGetYangTypeMap_ValidKey() {
+ assertEquals("uint64", testTypeMap.get("uint64"));
+ }
+ @Test
+ public void testGetYangTypeMap_In_ValidKey() {
+ assertEquals(null, testTypeMap.get("uint128"));
+ }
+
+}