Unit Test Coverage 97/33597/2
authorshubhada <SV00449682@techmahindra.com>
Thu, 1 Mar 2018 10:39:41 +0000 (16:09 +0530)
committerPatrick Brady <pb071s@att.com>
Thu, 1 Mar 2018 18:36:07 +0000 (18:36 +0000)
Unit Test Coverage for:
1. Data.java
2. CreateSnapshotParams.java
3. Properties.java
4. ResourceData.java

Sonar Link:
https://sonar.onap.org/code?id=org.onap.appc%3Aappc&selected=org.onap.appc%3Aappc-iaas-adapter-bundle%3Asrc%2Fmain%2Fjava%2Forg%2Fonap%2Fappc%2Fadapter%2Fopenstack%2Fheat%2Fmodel

Change-Id: I0eeef6216f536483c6b7a45d0847688d6d84fd2f
Issue-ID: APPC-685
Signed-off-by: shubhada <SV00449682@techmahindra.com>
appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/test/java/org/onap/appc/adapter/openstack/heat/model/TestCreateSnapshotParams.java [new file with mode: 0644]
appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/test/java/org/onap/appc/adapter/openstack/heat/model/TestData.java [new file with mode: 0644]
appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/test/java/org/onap/appc/adapter/openstack/heat/model/TestProperties.java [new file with mode: 0644]
appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/test/java/org/onap/appc/adapter/openstack/heat/model/TestResourceData.java [new file with mode: 0644]

diff --git a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/test/java/org/onap/appc/adapter/openstack/heat/model/TestCreateSnapshotParams.java b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/test/java/org/onap/appc/adapter/openstack/heat/model/TestCreateSnapshotParams.java
new file mode 100644 (file)
index 0000000..b613888
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+* ============LICENSE_START=======================================================
+* ONAP : APPC
+* ================================================================================
+* Copyright 2018 TechMahindra
+*=================================================================================
+* 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.appc.adapter.openstack.heat.model;
+
+import static org.junit.Assert.*;
+
+import org.junit.Before;
+import org.junit.Test;
+
+public class TestCreateSnapshotParams {
+    private CreateSnapshotParams createSnapshotParams;
+
+    @Before
+    public void setUp() {
+        createSnapshotParams=new CreateSnapshotParams();
+    }
+    @Test
+    public void testGetName() {
+        createSnapshotParams.setName("ABC");
+        assertNotNull(createSnapshotParams.getName());
+        assertEquals(createSnapshotParams.getName(),"ABC");
+    }
+
+    @Test
+    public void testToString_ReturnNonEmptyString() {
+        assertNotEquals(createSnapshotParams.toString(), "");
+        assertNotEquals(createSnapshotParams.toString(), null);
+    }
+
+}
diff --git a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/test/java/org/onap/appc/adapter/openstack/heat/model/TestData.java b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/test/java/org/onap/appc/adapter/openstack/heat/model/TestData.java
new file mode 100644 (file)
index 0000000..4d40dba
--- /dev/null
@@ -0,0 +1,83 @@
+/*
+* ============LICENSE_START=======================================================
+* ONAP : APPC
+* ================================================================================
+* Copyright 2018 TechMahindra
+*=================================================================================
+* 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.appc.adapter.openstack.heat.model;
+
+import static org.junit.Assert.*;
+
+import org.junit.Before;
+import org.junit.Test;
+
+public class TestData {
+    private Data data;
+
+    @Before
+    public void setUp() {
+        data=new Data();
+    }
+
+    @Test
+    public void testGetStatus() {
+        data.setStatus("status");
+        assertNotNull(data.getStatus());
+        assertEquals(data.getStatus(),"status");
+    }
+
+    @Test
+    public void testGetName() {
+        data.setName("XYZ");
+        assertNotNull(data.getName());
+        assertEquals(data.getName(),"XYZ");
+    }
+
+    @Test
+    public void testGetStackUserProjectId() {
+        data.setStackUserProjectId("stackUserProjectId");
+        assertNotNull(data.getStackUserProjectId());
+        assertEquals(data.getStackUserProjectId(),"stackUserProjectId");
+    }
+
+    @Test
+    public void testGetAction() {
+        data.setAction("action");
+        assertNotNull(data.getAction());
+        assertEquals(data.getAction(),"action");
+    }
+
+    @Test
+    public void testGetProjectId() {
+        data.setProjectId("projectId");
+        assertNotNull(data.getProjectId());
+        assertEquals(data.getProjectId(),"projectId");
+    }
+
+    @Test
+    public void testGetId() {
+        data.setId("Id");
+        assertNotNull(data.getId());
+        assertEquals(data.getId(),"Id");
+    }
+
+    @Test
+    public void testToString_ReturnNonEmptyString() {
+        assertNotEquals(data.toString(), "");
+        assertNotEquals(data.toString(), null);
+    }
+
+}
diff --git a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/test/java/org/onap/appc/adapter/openstack/heat/model/TestProperties.java b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/test/java/org/onap/appc/adapter/openstack/heat/model/TestProperties.java
new file mode 100644 (file)
index 0000000..a94c083
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+* ============LICENSE_START=======================================================
+* ONAP : APPC
+* ================================================================================
+* Copyright 2018 TechMahindra
+*=================================================================================
+* 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.appc.adapter.openstack.heat.model;
+
+import static org.junit.Assert.*;
+
+import org.junit.Before;
+import org.junit.Test;
+
+public class TestProperties {
+    private Properties properties;
+
+    @Before
+    public void setUp() {
+        properties=new Properties();
+    }
+    @Test
+    public void testGetSize() {
+        properties.setSize(123);
+        assertNotNull(properties.getSize());
+        assertEquals(properties.getSize(),123);
+    }
+
+    @Test
+    public void testToString_ReturnNonEmptyString() {
+        assertNotEquals(properties.toString(), "");
+        assertNotEquals(properties.toString(), null);
+    }
+
+}
diff --git a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/test/java/org/onap/appc/adapter/openstack/heat/model/TestResourceData.java b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/test/java/org/onap/appc/adapter/openstack/heat/model/TestResourceData.java
new file mode 100644 (file)
index 0000000..159cf40
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+* ============LICENSE_START=======================================================
+* ONAP : APPC
+* ================================================================================
+* Copyright 2018 TechMahindra
+*=================================================================================
+* 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.appc.adapter.openstack.heat.model;
+
+import static org.junit.Assert.*;
+
+import org.junit.Before;
+import org.junit.Test;
+
+public class TestResourceData {
+    private ResourceData resourceData;
+
+    @Before
+    public void setUp() {
+        resourceData=new ResourceData();
+    }
+    @Test
+    public void testGetBackupId() {
+        resourceData.setBackupId("111");
+        assertNotNull(resourceData.getBackupId());
+        assertEquals(resourceData.getBackupId(),"111");
+    }
+
+    @Test
+    public void testToString_ReturnNonEmptyString() {
+        assertNotEquals(resourceData.toString(), "");
+        assertNotEquals(resourceData.toString(), null);
+    }
+}