[Jboss-cvs] JBossAS SVN: r57072 - in branches/Branch_4_0/testsuite/src/resources/web: . custom-principal custom-principal/WEB-INF
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri Sep 22 10:53:19 EDT 2006
Author: anil.saldhana at jboss.com
Date: 2006-09-22 10:53:18 -0400 (Fri, 22 Sep 2006)
New Revision: 57072
Added:
branches/Branch_4_0/testsuite/src/resources/web/custom-principal/
branches/Branch_4_0/testsuite/src/resources/web/custom-principal/WEB-INF/
branches/Branch_4_0/testsuite/src/resources/web/custom-principal/WEB-INF/jboss-web.xml
branches/Branch_4_0/testsuite/src/resources/web/custom-principal/WEB-INF/web.xml
branches/Branch_4_0/testsuite/src/resources/web/custom-principal/index.jsp
branches/Branch_4_0/testsuite/src/resources/web/custom-principal/login.jsp
branches/Branch_4_0/testsuite/src/resources/web/custom-principal/loginError.jsp
Log:
JBAS-3687:resources for testcase
Added: branches/Branch_4_0/testsuite/src/resources/web/custom-principal/WEB-INF/jboss-web.xml
===================================================================
--- branches/Branch_4_0/testsuite/src/resources/web/custom-principal/WEB-INF/jboss-web.xml 2006-09-22 14:30:51 UTC (rev 57071)
+++ branches/Branch_4_0/testsuite/src/resources/web/custom-principal/WEB-INF/jboss-web.xml 2006-09-22 14:53:18 UTC (rev 57072)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE jboss-web
+ PUBLIC "-//JBoss//DTD Web Application 2.4//EN"
+ "http://www.jboss.org/j2ee/dtds/jboss-web_4_0.dtd">
+<jboss-web>
+ <security-domain>java:/jaas/jaas-testpropagation</security-domain>
+</jboss-web>
Added: branches/Branch_4_0/testsuite/src/resources/web/custom-principal/WEB-INF/web.xml
===================================================================
--- branches/Branch_4_0/testsuite/src/resources/web/custom-principal/WEB-INF/web.xml 2006-09-22 14:30:51 UTC (rev 57071)
+++ branches/Branch_4_0/testsuite/src/resources/web/custom-principal/WEB-INF/web.xml 2006-09-22 14:53:18 UTC (rev 57072)
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE web-app
+ PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd">
+<web-app>
+ <display-name>Custom Principal Propagation Test</display-name>
+ <welcome-file-list>
+ <welcome-file>index.jsp</welcome-file>
+ </welcome-file-list>
+
+ <security-constraint>
+ <web-resource-collection>
+ <web-resource-name>allJspPages</web-resource-name>
+ <description>All JSP Pages</description>
+ <url-pattern>*.jsp</url-pattern>
+ <http-method>GET</http-method>
+ <http-method>POST</http-method>
+ </web-resource-collection>
+ <auth-constraint>
+ <role-name>Echo</role-name>
+ </auth-constraint>
+ <user-data-constraint>
+ <description>no description</description>
+ <transport-guarantee>NONE</transport-guarantee>
+ </user-data-constraint>
+ </security-constraint>
+
+ <login-config>
+ <auth-method>FORM</auth-method>
+ <realm-name>CustomPrincipalPropagation</realm-name>
+ <form-login-config>
+ <form-login-page>/login.jsp</form-login-page>
+ <form-error-page>/loginError.jsp</form-error-page>
+ </form-login-config>
+ </login-config>
+
+ <security-role>
+ <role-name>Echo</role-name>
+ </security-role>
+</web-app>
Added: branches/Branch_4_0/testsuite/src/resources/web/custom-principal/index.jsp
===================================================================
--- branches/Branch_4_0/testsuite/src/resources/web/custom-principal/index.jsp 2006-09-22 14:30:51 UTC (rev 57071)
+++ branches/Branch_4_0/testsuite/src/resources/web/custom-principal/index.jsp 2006-09-22 14:53:18 UTC (rev 57072)
@@ -0,0 +1,23 @@
+<%@page import="javax.naming.InitialContext,javax.rmi.PortableRemoteObject,org.jboss.test.security.interfaces.CustomPrincipalHome,org.jboss.test.security.interfaces.CustomPrincipal,org.jboss.test.security.ejb.CustomPrincipalImpl"
+%>
+
+<%
+ boolean isCustomType = false;
+ try
+ {
+ InitialContext ic = new InitialContext();
+ Object obj = ic.lookup("jaas.CustomPrincipalPropagation");
+ obj = PortableRemoteObject.narrow(obj, CustomPrincipalHome.class);
+ CustomPrincipalHome home = (CustomPrincipalHome) obj;
+ CustomPrincipal bean = home.create();
+ isCustomType = bean.validateCallerPrincipal(CustomPrincipalImpl.class);
+ bean.remove();
+ }
+ catch(Exception e)
+ {
+ throw new IllegalStateException(e.getMessage());
+ }
+ if(!isCustomType)
+ throw new IllegalStateException("Custom Principal not seen");
+ out.println("Propagation Success");
+%>
Added: branches/Branch_4_0/testsuite/src/resources/web/custom-principal/login.jsp
===================================================================
--- branches/Branch_4_0/testsuite/src/resources/web/custom-principal/login.jsp 2006-09-22 14:30:51 UTC (rev 57071)
+++ branches/Branch_4_0/testsuite/src/resources/web/custom-principal/login.jsp 2006-09-22 14:53:18 UTC (rev 57072)
@@ -0,0 +1,15 @@
+<html>
+<body>
+ <form action="j_security_check" method="post" id="login">
+ <p>
+ User ID: <input type="text" size="20" name="j_username" id="user
+name_id"/>
+ <br>
+ Password: <input type="password" size="20" name="j_password"/>
+ <br>
+ <br>
+ <input type="submit" value="submit">
+ </p>
+ </form>
+</body>
+</html>
Added: branches/Branch_4_0/testsuite/src/resources/web/custom-principal/loginError.jsp
===================================================================
--- branches/Branch_4_0/testsuite/src/resources/web/custom-principal/loginError.jsp 2006-09-22 14:30:51 UTC (rev 57071)
+++ branches/Branch_4_0/testsuite/src/resources/web/custom-principal/loginError.jsp 2006-09-22 14:53:18 UTC (rev 57072)
@@ -0,0 +1 @@
+Encountered a login error!!
More information about the jboss-cvs-commits
mailing list