1   package net.sourceforge.heracles.service;
2   
3   /**
4    * Title:            AuthenticationImplTest.java<br
5    * Copyright:        HFT-SO<br>
6    * Java Version:     JDK 1.5<br>
7    *
8    * @author Philipp Gantert
9    * @version 1.0
10   */
11  
12  import junit.framework.TestCase;
13  import net.sourceforge.heracles.service.impl.AuthenticationImpl;
14  import net.sourceforge.heracles.utilities.HeraclesException;
15  
16  public class AuthenticationImplTest extends TestCase {
17  
18  	public void testValidating() throws Exception {
19  		Authentication auth = new AuthenticationImpl();
20  
21  		try {
22  			auth.authAdvanced("heracles@XXXXXXX", "");
23  			auth.authAdvanced("XXXXXXX\\\\heracless", "");
24  		} catch (NullPointerException ex) {
25  
26  		}
27  		try {
28  			auth.authAdvanced("heracles@XXXXXXX", null);
29  			fail("Here should be a HeraclesException");
30  		} catch (HeraclesException ex) {
31  
32  		} catch (NullPointerException ex) {
33  
34  		}
35  		try {
36  			auth.authSimple("heracles@XXXXXXX", null);
37  			fail("Here should be a HeraclesException");
38  		} catch (HeraclesException ex) {
39  
40  		} catch (NullPointerException ex) {
41  
42  		}
43  		try {
44  			auth.authSimple("heracles", "");
45  			fail("Here should be a HeraclesException");
46  		} catch (HeraclesException ex) {
47  
48  		} catch (NullPointerException ex) {
49  
50  		}
51  
52  	}
53  
54  }