EMMA Coverage Report (generated Wed Jun 22 19:47:49 EDT 2011)
[all classes][org.jclouds.deltacloud.domain]

COVERAGE SUMMARY FOR SOURCE FILE [PasswordAuthentication.java]

nameclass, %method, %block, %line, %
PasswordAuthentication.java100% (1/1)40%  (2/5)24%  (19/78)18%  (4/22)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class PasswordAuthentication100% (1/1)40%  (2/5)24%  (19/78)18%  (4/22)
equals (Object): boolean 0%   (0/1)0%   (0/37)0%   (0/13)
getLoginCredentials (): Credentials 0%   (0/1)0%   (0/3)0%   (0/1)
hashCode (): int 0%   (0/1)0%   (0/19)0%   (0/4)
PasswordAuthentication (Credentials): void 100% (1/1)100% (9/9)100% (3/3)
toString (): String 100% (1/1)100% (10/10)100% (1/1)

1/**
2 *
3 * Copyright (C) 2011 Cloud Conscious, LLC. <info@cloudconscious.com>
4 *
5 * ====================================================================
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 * ====================================================================
18 */
19package org.jclouds.deltacloud.domain;
20 
21import static com.google.common.base.Preconditions.checkNotNull;
22 
23import java.io.Serializable;
24 
25import org.jclouds.domain.Credentials;
26 
27/**
28 * 
29 * @author Adrian Cole
30 */
31public class PasswordAuthentication implements Instance.Authentication, Serializable {
32 
33   /** The serialVersionUID */
34   private static final long serialVersionUID = 7669076186483470376L;
35   private final Credentials login;
36 
37   public PasswordAuthentication(Credentials login) {
38      this.login = checkNotNull(login, "login");
39   }
40 
41   public Credentials getLoginCredentials() {
42      return login;
43   }
44 
45   @Override
46   public int hashCode() {
47      final int prime = 31;
48      int result = 1;
49      result = prime * result + ((login == null) ? 0 : login.hashCode());
50      return result;
51   }
52 
53   @Override
54   public boolean equals(Object obj) {
55      if (this == obj)
56         return true;
57      if (obj == null)
58         return false;
59      if (getClass() != obj.getClass())
60         return false;
61      PasswordAuthentication other = (PasswordAuthentication) obj;
62      if (login == null) {
63         if (other.login != null)
64            return false;
65      } else if (!login.equals(other.login))
66         return false;
67      return true;
68   }
69 
70   @Override
71   public String toString() {
72      return String.format("[login=%s]", login);
73   }
74 
75}

[all classes][org.jclouds.deltacloud.domain]
EMMA 2.0.5312 (C) Vladimir Roubtsov