Class to improve for SO/libs coverage 85/35185/1
authorSeshu-Kumar-M <seshu.kumar.m@huawei.com>
Mon, 12 Mar 2018 11:27:18 +0000 (16:57 +0530)
committerSeshu-Kumar-M <seshu.kumar.m@huawei.com>
Mon, 12 Mar 2018 11:34:57 +0000 (17:04 +0530)
Issue-ID: SO-360

Change-Id: Iaa5ec998c1d6b471e9af83f82a124e0f0cfba8ad
Signed-off-by: Seshu-Kumar-M <seshu.kumar.m@huawei.com>
nova-model/src/test/java/com/woorea/openstack/nova/model/ServerActionTest.java [new file with mode: 0644]

diff --git a/nova-model/src/test/java/com/woorea/openstack/nova/model/ServerActionTest.java b/nova-model/src/test/java/com/woorea/openstack/nova/model/ServerActionTest.java
new file mode 100644 (file)
index 0000000..d60ee9b
--- /dev/null
@@ -0,0 +1,74 @@
+/*-\r
+ * ============LICENSE_START=======================================================\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ *      http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ * ============LICENSE_END=========================================================\r
+ */\r
+\r
+package com.woorea.openstack.nova.model;\r
+\r
+import com.woorea.openstack.nova.model.ServerAction.ChangePassword;\r
+import org.junit.Test;\r
+\r
+import static org.junit.Assert.assertEquals;\r
+import static org.junit.Assert.fail; \r
+\r
+\r
+public class ServerActionTest {\r
+    private ChangePassword testObj = new ServerAction.ChangePassword();\r
+\r
+    @Test\r
+    public void testSetAdminPass(){\r
+\r
+        try {\r
+\r
+            testObj.setAdminPass("sai");\r
+            assertEquals( testObj.getAdminPass(), "sai");\r
+\r
+        } catch (Exception e) {\r
+\r
+            fail("Exception in test obj");\r
+        }\r
+\r
+    }\r
+\r
+    @Test\r
+    public void testChangePasswdConstructor(){\r
+\r
+        try {\r
+            ServerAction.ChangePassword test = new ServerAction.ChangePassword("sai");\r
+            assertEquals( test.getAdminPass(), "sai");\r
+\r
+        } catch (Exception e) {\r
+\r
+            fail("Exception in test obj");\r
+        }\r
+\r
+    }\r
+\r
+    private ServerAction.Reboot testObj1 = new ServerAction.Reboot();\r
+\r
+    @Test\r
+    public void testSetType(){\r
+        testObj1.setType("sai");\r
+        assertEquals("sai", testObj1.getType());\r
+    }\r
+\r
+    private ServerAction.Rebuild testRebuild = new ServerAction.Rebuild();\r
+    \r
+    @Test\r
+    public void testRebuild()\r
+    {\r
+        testRebuild.setAccessIPv4("1.1.1.1");\r
+        assertEquals(testRebuild.getAccessIPv4(),"1.1.1.1");\r
+    }\r
+}\r