EMMA Coverage Report (generated Tue Feb 12 22:23:49 ICT 2008)
[all classes][net.sourceforge.hivelock]

COVERAGE SUMMARY FOR SOURCE FILE [DefaultPrincipal.java]

nameclass, %method, %block, %line, %
DefaultPrincipal.java0%   (0/1)0%   (0/7)0%   (0/43)0%   (0/14)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class DefaultPrincipal0%   (0/1)0%   (0/7)0%   (0/43)0%   (0/14)
DefaultPrincipal (String, String, String []): void 0%   (0/1)0%   (0/15)0%   (0/6)
equals (Object): boolean 0%   (0/1)0%   (0/12)0%   (0/3)
getLogin (): String 0%   (0/1)0%   (0/3)0%   (0/1)
getName (): String 0%   (0/1)0%   (0/3)0%   (0/1)
getRoles (): String [] 0%   (0/1)0%   (0/3)0%   (0/1)
hashCode (): int 0%   (0/1)0%   (0/4)0%   (0/1)
toString (): String 0%   (0/1)0%   (0/3)0%   (0/1)

1//  Copyright 2004-2007 Jean-Francois Poilpret
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14 
15package net.sourceforge.hivelock;
16 
17import java.io.Serializable;
18import java.security.Principal;
19import java.util.Arrays;
20 
21public class DefaultPrincipal implements Principal, Serializable
22{
23        public DefaultPrincipal(String login, String name, String[] roles)
24        {
25                _login = login;
26                _name = name;
27                _roles = roles;
28                Arrays.sort(_roles);
29        }
30        
31        public String[]        getRoles()
32        {
33                return _roles;
34        }
35        
36        public String        getName()
37        {
38                return _name;
39        }
40        
41        public String        getLogin()
42        {
43                return _login;
44        }
45        
46        public boolean equals(Object obj)
47        {
48                if (obj instanceof DefaultPrincipal)
49                {
50                        return getLogin().equals(((DefaultPrincipal) obj).getLogin());
51                }
52                return false;
53        }
54 
55        public String toString()
56        {
57                return getLogin();
58        }
59        
60        public int hashCode()
61        {
62                return getLogin().hashCode();
63        }
64        
65        private String                _login;
66        private String                _name;
67        private String[]        _roles;
68}

[all classes][net.sourceforge.hivelock]
EMMA 2.0.5312 (C) Vladimir Roubtsov