01: /*
02: * JBoss, Home of Professional Open Source.
03: * Copyright 2006, Red Hat Middleware LLC, and individual contributors
04: * as indicated by the @author tags. See the copyright.txt file in the
05: * distribution for a full listing of individual contributors.
06: *
07: * This is free software; you can redistribute it and/or modify it
08: * under the terms of the GNU Lesser General Public License as
09: * published by the Free Software Foundation; either version 2.1 of
10: * the License, or (at your option) any later version.
11: *
12: * This software is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of
14: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15: * Lesser General Public License for more details.
16: *
17: * You should have received a copy of the GNU Lesser General Public
18: * License along with this software; if not, write to the Free
19: * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20: * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21: */
22: package org.jboss.test.jacc.test;
23:
24: import javax.management.ObjectName;
25:
26: import junit.framework.Test;
27: import junit.framework.TestSuite;
28:
29: import org.jboss.test.JBossTestSetup;
30:
31: /** Basic tests for web apps run under a JACC authorization manager
32: *
33: * @author Scott.Stark@jboss.org
34: * @author Anil.Saldhana@jboss.org
35: * @version $Revision: 57211 $
36: */
37: public class WebIntegrationUnitTestCase extends
38: org.jboss.test.web.test.WebIntegrationUnitTestCase {
39: public WebIntegrationUnitTestCase(String name) {
40: super (name);
41: }
42:
43: /**
44: * Overriden because a check is made for isUserInRole("InternalUser")
45: * and there is no security-role-ref for this role defined in web.xml
46: * @see org.jboss.test.web.test.WebIntegrationUnitTestCase#testUnsecureRunAsServletWithPrincipalName()
47: */
48: public void testUnsecureRunAsServletWithPrincipalName()
49: throws Exception {
50: }
51:
52: /**
53: * Overriden because a check is made for isUserInRole("InternalUser")
54: * and there is no security-role-ref for this role defined in web.xml
55: * @see org.jboss.test.web.test.WebIntegrationUnitTestCase#testUnsecureRunAsServletWithPrincipalNameAndRoles()
56: */
57: public void testUnsecureRunAsServletWithPrincipalNameAndRoles()
58: throws Exception {
59: }
60:
61: /**
62: * Setup the test suite.
63: */
64: public static Test suite() throws Exception {
65: TestSuite suite = new TestSuite();
66: suite.addTest(new TestSuite(WebIntegrationUnitTestCase.class));
67:
68: // Create an initializer for the test suite
69: Test wrapper = new JBossTestSetup(suite) {
70: protected void setUp() throws Exception {
71: super .setUp();
72: redeploy("jbosstest-web.ear");
73: flushAuthCache("jbosstest-web");
74: }
75:
76: protected void tearDown() throws Exception {
77: undeploy("jbosstest-web.ear");
78: super .tearDown();
79:
80: // Remove all the messages created during this test
81: getServer()
82: .invoke(
83: new ObjectName(
84: "jboss.mq.destination:service=Queue,name=testQueue"),
85: "removeAllMessages", new Object[0],
86: new String[0]);
87:
88: }
89: };
90: return wrapper;
91: }
92: }
|