01: /*
02: * Tomcat: The deployer for the tomcat daemon
03: * Copyright (C) 2007 Rift IT Contracting
04: *
05: * This library is free software; you can redistribute it and/or
06: * modify it under the terms of the GNU Lesser General Public
07: * License as published by the Free Software Foundation; either
08: * version 2.1 of the License, or (at your option) any later version.
09: *
10: * This library is distributed in the hope that it will be useful,
11: * but WITHOUT ANY WARRANTY; without even the implied warranty of
12: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13: * Lesser General Public License for more details.
14: *
15: * You should have received a copy of the GNU Lesser General Public
16: * License along with this library; if not, write to the Free Software
17: * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18: *
19: * CoadunationGenericPrincipalTest.java
20: */
21:
22: package com.rift.coad.daemon.tomcat.security;
23:
24: import junit.framework.*;
25: import java.security.Principal;
26: import java.util.Arrays;
27: import java.util.List;
28: import java.util.ArrayList;
29: import org.apache.catalina.realm.GenericPrincipal;
30: import org.apache.catalina.Realm;
31: import com.rift.coad.lib.security.UserSession;
32:
33: /**
34: *
35: * @author brett
36: */
37: public class CoadunationGenericPrincipalTest extends TestCase {
38:
39: public CoadunationGenericPrincipalTest(String testName) {
40: super (testName);
41: }
42:
43: protected void setUp() throws Exception {
44: }
45:
46: protected void tearDown() throws Exception {
47: }
48:
49: /**
50: * Test of getSession method, of class com.rift.coad.daemon.tomcat.security.CoadunationGenericPrincipal.
51: */
52: public void testGetSession() throws Exception {
53: System.out.println("getSession");
54:
55: UserSession expResult = new UserSession();
56: CoadunationGenericPrincipal instance = new CoadunationGenericPrincipal(
57: new CoadunationRealm(), "test", "112233",
58: new ArrayList(), expResult);
59:
60: UserSession result = instance.getSession();
61: assertEquals(expResult, result);
62:
63: }
64:
65: }
|