1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.acegisecurity.event.authorization;
17
18 import junit.framework.TestCase;
19
20 import org.acegisecurity.AuthenticationCredentialsNotFoundException;
21 import org.acegisecurity.ConfigAttributeDefinition;
22 import org.acegisecurity.util.SimpleMethodInvocation;
23
24
25 /***
26 * Tests {@link AuthenticationCredentialsNotFoundEvent}.
27 *
28 * @author Ben Alex
29 * @version $Id: AuthenticationCredentialsNotFoundEventTests.java,v 1.3 2005/11/25 04:17:24 benalex Exp $
30 */
31 public class AuthenticationCredentialsNotFoundEventTests extends TestCase {
32
33
34 public AuthenticationCredentialsNotFoundEventTests() {
35 super();
36 }
37
38 public AuthenticationCredentialsNotFoundEventTests(String arg0) {
39 super(arg0);
40 }
41
42
43
44 public static void main(String[] args) {
45 junit.textui.TestRunner.run(AuthenticationCredentialsNotFoundEventTests.class);
46 }
47
48 public void testRejectsNulls() {
49 try {
50 new AuthenticationCredentialsNotFoundEvent(null,
51 new ConfigAttributeDefinition(),
52 new AuthenticationCredentialsNotFoundException("test"));
53 fail("Should have thrown IllegalArgumentException");
54 } catch (IllegalArgumentException expected) {
55 assertTrue(true);
56 }
57
58 try {
59 new AuthenticationCredentialsNotFoundEvent(new SimpleMethodInvocation(),
60 null, new AuthenticationCredentialsNotFoundException("test"));
61 fail("Should have thrown IllegalArgumentException");
62 } catch (IllegalArgumentException expected) {
63 assertTrue(true);
64 }
65
66 try {
67 new AuthenticationCredentialsNotFoundEvent(new SimpleMethodInvocation(),
68 new ConfigAttributeDefinition(), null);
69 fail("Should have thrown IllegalArgumentException");
70 } catch (IllegalArgumentException expected) {
71 assertTrue(true);
72 }
73 }
74 }