aboutsummaryrefslogtreecommitdiffstats
path: root/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle
diff options
context:
space:
mode:
authorshubhada <SV00449682@techmahindra.com>2018-03-01 16:09:41 +0530
committerPatrick Brady <pb071s@att.com>2018-03-01 18:36:07 +0000
commitffeb264f28291a5a8c3c5dcb1ef5b7afc1de5c77 (patch)
treeb550d68f6fdebe9d18b07e0c93e83df577a06e1e /appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle
parent4e26089e179c395ad1ceed510f3170765d4eea27 (diff)
Unit Test Coverage
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>
Diffstat (limited to 'appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle')
-rw-r--r--appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/test/java/org/onap/appc/adapter/openstack/heat/model/TestCreateSnapshotParams.java47
-rw-r--r--appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/test/java/org/onap/appc/adapter/openstack/heat/model/TestData.java83
-rw-r--r--appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/test/java/org/onap/appc/adapter/openstack/heat/model/TestProperties.java47
-rw-r--r--appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/test/java/org/onap/appc/adapter/openstack/heat/model/TestResourceData.java46
4 files changed, 223 insertions, 0 deletions
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
index 000000000..b613888a9
--- /dev/null
+++ b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/test/java/org/onap/appc/adapter/openstack/heat/model/TestCreateSnapshotParams.java
@@ -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
index 000000000..4d40dba36
--- /dev/null
+++ b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/test/java/org/onap/appc/adapter/openstack/heat/model/TestData.java
@@ -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
index 000000000..a94c083ad
--- /dev/null
+++ b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/test/java/org/onap/appc/adapter/openstack/heat/model/TestProperties.java
@@ -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
index 000000000..159cf4030
--- /dev/null
+++ b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/test/java/org/onap/appc/adapter/openstack/heat/model/TestResourceData.java
@@ -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);
+ }
+}