01: /* Copyright 2004, 2005, 2006 Acegi Technology Pty Limited
02: *
03: * Licensed under the Apache License, Version 2.0 (the "License");
04: * you may not use this file except in compliance with the License.
05: * You may obtain a copy of the License at
06: *
07: * http://www.apache.org/licenses/LICENSE-2.0
08: *
09: * 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: */
15:
16: package org.acegisecurity.providers.cas.proxy;
17:
18: import junit.framework.TestCase;
19:
20: import java.util.Vector;
21:
22: /**
23: * Tests {@link AcceptAnyCasProxy}.
24: *
25: * @author Ben Alex
26: * @version $Id: AcceptAnyCasProxyTests.java 1496 2006-05-23 13:38:33Z benalex $
27: */
28: public class AcceptAnyCasProxyTests extends TestCase {
29: //~ Constructors ===================================================================================================
30:
31: public AcceptAnyCasProxyTests() {
32: super ();
33: }
34:
35: public AcceptAnyCasProxyTests(String arg0) {
36: super (arg0);
37: }
38:
39: //~ Methods ========================================================================================================
40:
41: public static void main(String[] args) {
42: junit.textui.TestRunner.run(AcceptAnyCasProxyTests.class);
43: }
44:
45: public final void setUp() throws Exception {
46: super .setUp();
47: }
48:
49: public void testDoesNotAcceptNull() {
50: AcceptAnyCasProxy proxyDecider = new AcceptAnyCasProxy();
51:
52: try {
53: proxyDecider.confirmProxyListTrusted(null);
54: fail("Should have thrown IllegalArgumentException");
55: } catch (IllegalArgumentException expected) {
56: assertEquals("proxyList cannot be null", expected
57: .getMessage());
58: }
59: }
60:
61: public void testNormalOperation() {
62: AcceptAnyCasProxy proxyDecider = new AcceptAnyCasProxy();
63: proxyDecider.confirmProxyListTrusted(new Vector());
64: assertTrue(true); // as no Exception thrown
65: }
66: }
|