Clover Coverage Report - itracker
Coverage timestamp: Tue May 1 2012 16:42:12 CEST
4   51   3   1.33
0   19   0.75   3
3     1  
1    
 
 
  TestAuthenticator       Line # 15 4 3 0% 0.0
 
No Tests
 
1    package org.itracker.services.authentication;
2   
3    import org.itracker.model.User;
4    import org.itracker.services.UserService;
5    import org.itracker.services.exceptions.AuthenticatorException;
6   
7   
8    /**
9    * An authenticator that always returns the admin user.
10    * Mainly for testing
11    *
12    *
13    * @author Ricardo Trindade (ricardo.trindade@emation.pt)
14    */
 
15    public class TestAuthenticator extends DefaultAuthenticator {
16   
17    /**
18    * @see org.itracker.ejb.authentication.AbstractPluggableAuthenticator#checkLogin(java.lang.String,
19    * java.lang.Object, int, int)
20    */
 
21  0 toggle public User checkLogin(String login, Object authentication, int authType, int reqSource)
22    throws AuthenticatorException {
23   
24  0 UserService userService = getUserService();
25  0 return (userService.getUserByLogin("admin"));
26   
27    }
28   
29    /*
30    * (non-Javadoc)
31    *
32    * @see org.itracker.ejb.authentication.AbstractPluggableAuthenticator#allowProfileUpdates(org.itracker.model.deprecatedmodels.User,
33    * java.lang.Object, int, int)
34    */
 
35  0 toggle public boolean allowProfileUpdates(User user, Object authentication, int authType, int reqSource)
36    throws AuthenticatorException {
37  0 return true;
38    }
39   
40    /*
41    * (non-Javadoc)
42    *
43    * @see org.itracker.ejb.authentication.AbstractPluggableAuthenticator#allowPasswordUpdates(org.itracker.model.deprecatedmodels.User,
44    * java.lang.Object, int, int)
45    */
 
46  0 toggle public boolean allowPasswordUpdates(User user, Object authentication, int authType, int reqSource)
47    throws AuthenticatorException {
48  0 return false;
49    }
50   
51    }