summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsubhash kumar singh <subhash.kumar.singh@huawei.com>2018-02-11 10:22:27 +0000
committersubhash kumar singh <subhash.kumar.singh@huawei.com>2018-02-11 10:22:27 +0000
commitdb87b7c2e0f751d4fba6a86d242d4c87e6101455 (patch)
treef0d0c01a9dfcd058b93be8b380730565c567bf90
parent08ef8020d394f84cfb5ae03890c11e0930061f83 (diff)
Improve code coverage for libs
Import code coverage for libs. Change-Id: I757d6d8e29fc22fc6a2b11159eed546dd702a5cd Issue-ID: SO-369 Signed-off-by: subhash kumar singh <subhash.kumar.singh@huawei.com>
-rw-r--r--keystone-client/src/test/java/com/woorea/openstack/keystone/v3/api/GroupsResourceTest.java29
-rw-r--r--keystone-client/src/test/java/com/woorea/openstack/keystone/v3/api/ProjectGroupRolesResourceTest.java45
-rw-r--r--keystone-client/src/test/java/com/woorea/openstack/keystone/v3/api/ProjectRolesResourceTest.java34
-rw-r--r--keystone-client/src/test/java/com/woorea/openstack/keystone/v3/api/ProjectUserRolesResourceTest.java34
-rw-r--r--keystone-client/src/test/java/com/woorea/openstack/keystone/v3/api/ProjectsResourceTest.java39
-rw-r--r--keystone-client/src/test/java/com/woorea/openstack/keystone/v3/api/RolesResourceTest.java29
-rw-r--r--keystone-client/src/test/java/com/woorea/openstack/keystone/v3/api/TokensResourceTest.java35
-rw-r--r--keystone-client/src/test/java/com/woorea/openstack/keystone/v3/api/UsersResourceTest.java39
8 files changed, 284 insertions, 0 deletions
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
index 0000000..4eba761
--- /dev/null
+++ b/keystone-client/src/test/java/com/woorea/openstack/keystone/v3/api/GroupsResourceTest.java
@@ -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
index 0000000..dac2691
--- /dev/null
+++ b/keystone-client/src/test/java/com/woorea/openstack/keystone/v3/api/ProjectGroupRolesResourceTest.java
@@ -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
index 0000000..881b3a8
--- /dev/null
+++ b/keystone-client/src/test/java/com/woorea/openstack/keystone/v3/api/ProjectRolesResourceTest.java
@@ -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
index 0000000..16b4b8e
--- /dev/null
+++ b/keystone-client/src/test/java/com/woorea/openstack/keystone/v3/api/ProjectUserRolesResourceTest.java
@@ -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
index 0000000..ae6ef18
--- /dev/null
+++ b/keystone-client/src/test/java/com/woorea/openstack/keystone/v3/api/ProjectsResourceTest.java
@@ -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
index 0000000..9d9236b
--- /dev/null
+++ b/keystone-client/src/test/java/com/woorea/openstack/keystone/v3/api/RolesResourceTest.java
@@ -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
index 0000000..c161dd3
--- /dev/null
+++ b/keystone-client/src/test/java/com/woorea/openstack/keystone/v3/api/TokensResourceTest.java
@@ -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
index 0000000..d21130f
--- /dev/null
+++ b/keystone-client/src/test/java/com/woorea/openstack/keystone/v3/api/UsersResourceTest.java
@@ -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