Improve test coverage for libs.
Change-Id: Iac0c18f07d425d54ca8219e624a65a54b4b4529a
Issue-ID: SO-369
Signed-off-by: subhash kumar singh <subhash.kumar.singh@huawei.com>
<name>OpenStack Keystone Model</name>
<description>OpenStack Keystone Model</description>
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.12</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
</project>
\ No newline at end of file
--- /dev/null
+/*-
+ * ============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.model;
+
+import org.junit.Test;
+
+public class AccessTest {
+
+ Access access = new Access();
+
+ @Test
+ public void getTokenTest() throws Exception {
+ access.getToken();
+ }
+
+ @Test
+ public void getServiceCatalogTest() throws Exception {
+ access.getServiceCatalog();
+ }
+
+ @Test
+ public void getUserTest() throws Exception {
+ access.getUser();
+ }
+
+ @Test
+ public void getMetadataTest() throws Exception {
+ access.getMetadata();
+ }
+
+}
\ No newline at end of file
--- /dev/null
+/*-
+ * ============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.model;
+
+import org.junit.Test;
+
+public class EndpointTest {
+
+ Endpoint endpoint = new Endpoint();
+
+ @Test
+ public void getId() throws Exception {
+ endpoint.getId();
+ }
+
+ @Test
+ public void setId() throws Exception {
+ endpoint.setId("test");
+ }
+
+ @Test
+ public void getServiceId() throws Exception {
+ endpoint.getServiceId();
+ }
+
+ @Test
+ public void setServiceId() throws Exception {
+ endpoint.setServiceId("test");
+ }
+
+ @Test
+ public void getRegion() throws Exception {
+ endpoint.getRegion();
+ }
+
+ @Test
+ public void setRegion() throws Exception {
+ endpoint.setRegion("region");
+ }
+
+ @Test
+ public void getPublicURL() throws Exception {
+ endpoint.getPublicURL();
+ }
+
+ @Test
+ public void setPublicURL() throws Exception {
+ endpoint.setPublicURL("url");
+ }
+
+ @Test
+ public void getInternalURL() throws Exception {
+ endpoint.getInternalURL();
+ }
+
+ @Test
+ public void setInternalURL() throws Exception {
+ endpoint.setInternalURL("test");
+ }
+
+ @Test
+ public void getAdminURL() throws Exception {
+ endpoint.getAdminURL();
+ }
+
+ @Test
+ public void setAdminURL() throws Exception {
+ endpoint.setAdminURL("admin url");
+ }
+
+}
\ No newline at end of file
--- /dev/null
+/*-
+ * ============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.model;
+
+import org.junit.Test;
+
+public class EndpointsTest {
+
+ Endpoints endpoints = new Endpoints();
+
+ @Test
+ public void getList() throws Exception {
+ endpoints.getList();
+ }
+
+ @Test(expected = NullPointerException.class)
+ public void iterator() throws Exception {
+ endpoints.iterator();
+ }
+
+}
\ No newline at end of file
--- /dev/null
+/*-
+ * ============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.model;
+
+import org.junit.Test;
+
+public class ErrorTest {
+
+ Error error = new Error();
+
+ @Test
+ public void getCode() throws Exception {
+ error.getCode();
+ }
+
+ @Test
+ public void getTitle() throws Exception {
+ error.getTitle();
+ }
+
+ @Test
+ public void getMessage() throws Exception {
+ error.getMessage();
+ }
+
+}
\ No newline at end of file
--- /dev/null
+/*-
+ * ============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.model;
+
+import org.junit.Test;
+
+public class LinkTest {
+
+ Link link = new Link();
+
+ @Test
+ public void getRel() throws Exception {
+ link.getRel();
+ }
+
+ @Test
+ public void getHref() throws Exception {
+ link.getHref();
+ }
+
+ @Test
+ public void getType() throws Exception {
+ link.getType();
+ }
+
+}
\ No newline at end of file
--- /dev/null
+/*-
+ * ============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.model;
+
+import org.junit.Test;
+
+public class MetadataTest {
+
+ Metadata metadata = new Metadata();
+
+ @Test
+ public void getMetadata() throws Exception {
+ metadata.getMetadata();
+ }
+
+ @Test
+ public void setMetadata() throws Exception {
+ metadata.setMetadata(null);
+ }
+
+}
\ No newline at end of file
--- /dev/null
+/*-
+ * ============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.model;
+
+import org.junit.Test;
+
+public class RoleTest {
+
+ Role role = new Role();
+
+ @Test
+ public void getId() throws Exception {
+ role.getId();
+ }
+
+ @Test
+ public void getName() throws Exception {
+ role.getName();
+ }
+
+ @Test
+ public void setName() throws Exception {
+ role.setName("name");
+ }
+
+ @Test
+ public void getDescription() throws Exception {
+ role.getDescription();
+ }
+
+ @Test
+ public void setDescription() throws Exception {
+ role.setDescription("desc");
+ }
+
+ @Test
+ public void getEnabled() throws Exception {
+ role.getEnabled();
+ }
+
+ @Test
+ public void setEnabled() throws Exception {
+ role.setEnabled("test");
+ }
+
+}
\ No newline at end of file
--- /dev/null
+/*-
+ * ============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.model;
+
+import org.junit.Test;
+
+public class RolesTest {
+
+ Roles roles = new Roles();
+
+ @Test
+ public void getList() throws Exception {
+ roles.getList();
+ }
+
+ @Test(expected = NullPointerException.class)
+ public void iterator() throws Exception {
+ roles.iterator();
+ }
+
+}
\ No newline at end of file
--- /dev/null
+/*-
+ * ============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.model;
+
+import org.junit.Test;
+
+public class ServiceTest {
+
+ Service service = new Service();
+
+ @Test
+ public void getId() throws Exception {
+ service.getId();
+ }
+
+ @Test
+ public void getType() throws Exception {
+ service.getType();
+ }
+
+ @Test
+ public void setType() throws Exception {
+ service.setType("type");
+ }
+
+ @Test
+ public void getName() throws Exception {
+ service.getName();
+ }
+
+ @Test
+ public void setName() throws Exception {
+ service.setName("name");
+ }
+
+ @Test
+ public void getDescription() throws Exception {
+ service.getDescription();
+ }
+
+ @Test
+ public void setDescription() throws Exception {
+ service.setDescription("desc");
+ }
+
+}
\ No newline at end of file
--- /dev/null
+/*-
+ * ============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.model;
+
+import org.junit.Test;
+
+public class ServicesTest {
+
+ Services services = new Services();
+
+ @Test
+ public void getList() throws Exception {
+ services.getList();
+ }
+
+ @Test(expected = NullPointerException.class)
+ public void iterator() throws Exception {
+ services.iterator();
+ }
+
+}
\ No newline at end of file
--- /dev/null
+/*-
+ * ============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.model;
+
+import org.junit.Test;
+
+public class TenantTest {
+
+ Tenant tenant = new Tenant();
+
+ @Test
+ public void getId() throws Exception {
+ tenant.getId();
+ }
+
+ @Test
+ public void setId() throws Exception {
+ tenant.setId("tenantid");
+ }
+
+ @Test
+ public void getName() throws Exception {
+ tenant.getName();
+ }
+
+ @Test
+ public void setName() throws Exception {
+ tenant.setName("test");
+ }
+
+ @Test
+ public void getDescription() throws Exception {
+ tenant.getDescription();
+ }
+
+ @Test
+ public void setDescription() throws Exception {
+ tenant.setDescription("desc");
+ }
+
+ @Test
+ public void getEnabled() throws Exception {
+ tenant.getEnabled();
+ }
+
+ @Test
+ public void setEnabled() throws Exception {
+ tenant.setEnabled(true);
+ }
+}
\ No newline at end of file
--- /dev/null
+/*-
+ * ============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.model;
+
+import org.junit.Test;
+
+public class TenantsTest {
+
+ Tenants tenants= new Tenants();
+
+ @Test
+ public void getList() throws Exception {
+ tenants.getList();
+ }
+
+ @Test
+ public void getLinks() throws Exception {
+ tenants.getLinks();
+ }
+
+ @Test(expected = NullPointerException.class)
+ public void iterator() throws Exception {
+ tenants.iterator();
+ }
+
+}
\ No newline at end of file
--- /dev/null
+/*-
+ * ============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.model;
+
+import org.junit.Test;
+
+public class TokenTest {
+
+ Token token = new Token();
+
+ @Test
+ public void getId() throws Exception {
+ token.getId();
+ }
+
+ @Test
+ public void getIssued_at() throws Exception {
+ token.getIssued_at();
+ }
+
+ @Test
+ public void getExpires() throws Exception {
+ token.getExpires();
+ }
+
+ @Test
+ public void getTenant() throws Exception {
+ token.getTenant();
+ }
+
+}
\ No newline at end of file
--- /dev/null
+/*-
+ * ============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.model;
+
+import org.junit.Test;
+
+public class UserTest {
+
+ User user = new User();
+
+ @Test
+ public void getId() throws Exception {
+ user.getId();
+ }
+
+ @Test
+ public void setId() throws Exception {
+ user.setId("test");
+ }
+
+ @Test
+ public void getUsername() throws Exception {
+ user.getUsername();
+ }
+
+ @Test
+ public void setUsername() throws Exception {
+ user.setUsername("test");
+ }
+
+ @Test
+ public void getPassword() throws Exception {
+ user.getPassword();
+ }
+
+ @Test
+ public void setPassword() throws Exception {
+ user.setPassword("test");
+ }
+
+ @Test
+ public void getTenantId() throws Exception {
+ user.getTenantId();
+ }
+
+ @Test
+ public void setTenantId() throws Exception {
+ user.setTenantId("test");
+ }
+
+ @Test
+ public void getName() throws Exception {
+ user.getName();
+ }
+
+ @Test
+ public void setName() throws Exception {
+ user.setName("test");
+ }
+
+ @Test
+ public void getEmail() throws Exception {
+ user.getEmail();
+ }
+
+ @Test
+ public void setEmail() throws Exception {
+ user.setEmail("test");
+ }
+
+ @Test
+ public void getEnabled() throws Exception {
+ user.getEnabled();
+ }
+
+ @Test
+ public void setEnabled() throws Exception {
+ user.setEnabled(true);
+ }
+
+}
\ No newline at end of file
--- /dev/null
+/*-
+ * ============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.model;
+
+import org.junit.Test;
+
+public class UsersTest {
+
+ Users users = new Users();
+
+ @Test
+ public void getList() throws Exception {
+ users.getList();
+ }
+
+ @Test(expected = NullPointerException.class)
+ public void iterator() throws Exception {
+ users.iterator();
+ }
+
+}
\ No newline at end of file