Improve code coverage for libs 51/31251/1
authorsubhash kumar singh <subhash.kumar.singh@huawei.com>
Sun, 11 Feb 2018 10:22:27 +0000 (10:22 +0000)
committersubhash kumar singh <subhash.kumar.singh@huawei.com>
Sun, 11 Feb 2018 10:22:27 +0000 (10:22 +0000)
Import code coverage for libs.

Change-Id: I757d6d8e29fc22fc6a2b11159eed546dd702a5cd
Issue-ID: SO-369
Signed-off-by: subhash kumar singh <subhash.kumar.singh@huawei.com>
keystone-client/src/test/java/com/woorea/openstack/keystone/v3/api/GroupsResourceTest.java [new file with mode: 0644]
keystone-client/src/test/java/com/woorea/openstack/keystone/v3/api/ProjectGroupRolesResourceTest.java [new file with mode: 0644]
keystone-client/src/test/java/com/woorea/openstack/keystone/v3/api/ProjectRolesResourceTest.java [new file with mode: 0644]
keystone-client/src/test/java/com/woorea/openstack/keystone/v3/api/ProjectUserRolesResourceTest.java [new file with mode: 0644]
keystone-client/src/test/java/com/woorea/openstack/keystone/v3/api/ProjectsResourceTest.java [new file with mode: 0644]
keystone-client/src/test/java/com/woorea/openstack/keystone/v3/api/RolesResourceTest.java [new file with mode: 0644]
keystone-client/src/test/java/com/woorea/openstack/keystone/v3/api/TokensResourceTest.java [new file with mode: 0644]
keystone-client/src/test/java/com/woorea/openstack/keystone/v3/api/UsersResourceTest.java [new file with mode: 0644]

diff --git a/keystone-client/src/test/java/com/woorea/openstack/keystone/v3/api/GroupsResourceTest.java b/keystone-client/src/test/java/com/woorea/openstack/keystone/v3/api/GroupsResourceTest.java
new file mode 100644 (file)
index 0000000..4eba761
--- /dev/null
@@ -0,0 +1,29 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * 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 com.woorea.openstack.keystone.v3.api;
+
+import org.junit.Test;
+
+public class GroupsResourceTest {
+
+    GroupsResource groupsResource = new GroupsResource(null);
+
+    @Test
+    public void userRolesTest() throws Exception {
+        groupsResource.userRoles("test", "test");
+    }
+
+}
\ No newline at end of file
diff --git a/keystone-client/src/test/java/com/woorea/openstack/keystone/v3/api/ProjectGroupRolesResourceTest.java b/keystone-client/src/test/java/com/woorea/openstack/keystone/v3/api/ProjectGroupRolesResourceTest.java
new file mode 100644 (file)
index 0000000..dac2691
--- /dev/null
@@ -0,0 +1,45 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * 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 com.woorea.openstack.keystone.v3.api;
+
+import com.woorea.openstack.keystone.model.Role;
+import org.junit.Test;
+
+public class ProjectGroupRolesResourceTest {
+
+    ProjectGroupRolesResource projectGroupRolesResource = new ProjectGroupRolesResource(null, "test");
+
+    @Test(expected = UnsupportedOperationException.class)
+    public void createTest() throws Exception {
+        projectGroupRolesResource.create(new Role());
+    }
+
+    @Test(expected = UnsupportedOperationException.class)
+    public void showTest() throws Exception {
+        projectGroupRolesResource.show("test");
+    }
+
+    @Test(expected = UnsupportedOperationException.class)
+    public void updateTest() throws Exception {
+        projectGroupRolesResource.update("test", new Role());
+    }
+
+    @Test(expected = UnsupportedOperationException.class)
+    public void deleteTest() throws Exception {
+        projectGroupRolesResource.delete("test");
+    }
+
+}
\ No newline at end of file
diff --git a/keystone-client/src/test/java/com/woorea/openstack/keystone/v3/api/ProjectRolesResourceTest.java b/keystone-client/src/test/java/com/woorea/openstack/keystone/v3/api/ProjectRolesResourceTest.java
new file mode 100644 (file)
index 0000000..881b3a8
--- /dev/null
@@ -0,0 +1,34 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * 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 com.woorea.openstack.keystone.v3.api;
+
+import org.junit.Test;
+
+public class ProjectRolesResourceTest {
+
+    ProjectRolesResource projectRolesResource = new ProjectRolesResource(null, "path");
+
+    @Test
+    public void addTest() throws Exception {
+        projectRolesResource.add("test");
+    }
+
+    @Test
+    public void removeTest() throws Exception {
+        projectRolesResource.remove("test");
+    }
+
+}
\ No newline at end of file
diff --git a/keystone-client/src/test/java/com/woorea/openstack/keystone/v3/api/ProjectUserRolesResourceTest.java b/keystone-client/src/test/java/com/woorea/openstack/keystone/v3/api/ProjectUserRolesResourceTest.java
new file mode 100644 (file)
index 0000000..16b4b8e
--- /dev/null
@@ -0,0 +1,34 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * 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 com.woorea.openstack.keystone.v3.api;
+
+import org.junit.Test;
+
+public class ProjectUserRolesResourceTest {
+
+    ProjectUserRolesResource projectUserRolesResource = new ProjectUserRolesResource(null, "test");
+
+    @Test
+    public void addTest() throws Exception {
+        projectUserRolesResource.add("roleid");
+    }
+
+    @Test
+    public void removeTest() throws Exception {
+        projectUserRolesResource.remove("roleid");
+    }
+
+}
\ No newline at end of file
diff --git a/keystone-client/src/test/java/com/woorea/openstack/keystone/v3/api/ProjectsResourceTest.java b/keystone-client/src/test/java/com/woorea/openstack/keystone/v3/api/ProjectsResourceTest.java
new file mode 100644 (file)
index 0000000..ae6ef18
--- /dev/null
@@ -0,0 +1,39 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * 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 com.woorea.openstack.keystone.v3.api;
+
+import org.junit.Test;
+
+public class ProjectsResourceTest {
+
+    ProjectsResource projectsResource = new ProjectsResource(null);
+
+    @Test(expected = NullPointerException.class)
+    public void usersTest() throws Exception {
+        projectsResource.users("projectid");
+    }
+
+    @Test
+    public void userRolesTest() throws Exception {
+        projectsResource.userRoles("pid", "uid");
+    }
+
+    @Test
+    public void groupRolesTest() throws Exception {
+        projectsResource.groupRoles("pid", "gid");
+    }
+
+}
\ No newline at end of file
diff --git a/keystone-client/src/test/java/com/woorea/openstack/keystone/v3/api/RolesResourceTest.java b/keystone-client/src/test/java/com/woorea/openstack/keystone/v3/api/RolesResourceTest.java
new file mode 100644 (file)
index 0000000..9d9236b
--- /dev/null
@@ -0,0 +1,29 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * 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 com.woorea.openstack.keystone.v3.api;
+
+import org.junit.Test;
+
+public class RolesResourceTest {
+
+    RolesResource rolesResource = new RolesResource(null);
+
+    @Test(expected = NullPointerException.class)
+    public void usersTest() throws Exception {
+        rolesResource.users("domainid", "userid");
+    }
+
+}
\ No newline at end of file
diff --git a/keystone-client/src/test/java/com/woorea/openstack/keystone/v3/api/TokensResourceTest.java b/keystone-client/src/test/java/com/woorea/openstack/keystone/v3/api/TokensResourceTest.java
new file mode 100644 (file)
index 0000000..c161dd3
--- /dev/null
@@ -0,0 +1,35 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * 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 com.woorea.openstack.keystone.v3.api;
+
+import com.woorea.openstack.keystone.v3.model.Authentication;
+import org.junit.Test;
+
+public class TokensResourceTest {
+
+    TokensResource tokensResource = new TokensResource(null);
+
+    @Test
+    public void authenticateTest() throws Exception {
+        tokensResource.authenticate(new Authentication());
+    }
+
+    @Test(expected = NullPointerException.class)
+    public void showTest() throws Exception {
+        tokensResource.show();
+    }
+
+}
\ No newline at end of file
diff --git a/keystone-client/src/test/java/com/woorea/openstack/keystone/v3/api/UsersResourceTest.java b/keystone-client/src/test/java/com/woorea/openstack/keystone/v3/api/UsersResourceTest.java
new file mode 100644 (file)
index 0000000..d21130f
--- /dev/null
@@ -0,0 +1,39 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * 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 com.woorea.openstack.keystone.v3.api;
+
+import org.junit.Test;
+
+public class UsersResourceTest {
+
+    UsersResource usersResource = new UsersResource(null);
+
+    @Test(expected = NullPointerException.class)
+    public void groupsTest() throws Exception {
+        usersResource.groups("id");
+    }
+
+    @Test(expected = NullPointerException.class)
+    public void projectsTest() throws Exception {
+        usersResource.projects("uid");
+    }
+
+    @Test(expected = NullPointerException.class)
+    public void rolesTest() throws Exception {
+        usersResource.roles("uid");
+    }
+
+}
\ No newline at end of file