[Jboss-cvs] JBossAS SVN: r55042 - in trunk/testsuite/src/resources/cluster/http: . http-cross-ctx-first http-cross-ctx-first/WEB-INF http-cross-ctx-second http-cross-ctx-second/WEB-INF http-cross-ctx-third http-cross-ctx-third/WEB-INF
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Aug 2 17:04:13 EDT 2006
Author: bstansberry at jboss.com
Date: 2006-08-02 17:04:08 -0400 (Wed, 02 Aug 2006)
New Revision: 55042
Added:
trunk/testsuite/src/resources/cluster/http/application.xml
trunk/testsuite/src/resources/cluster/http/http-cross-ctx-first/
trunk/testsuite/src/resources/cluster/http/http-cross-ctx-first/WEB-INF/
trunk/testsuite/src/resources/cluster/http/http-cross-ctx-first/WEB-INF/context.xml
trunk/testsuite/src/resources/cluster/http/http-cross-ctx-first/WEB-INF/jboss-web.xml
trunk/testsuite/src/resources/cluster/http/http-cross-ctx-first/WEB-INF/web.xml
trunk/testsuite/src/resources/cluster/http/http-cross-ctx-first/attributeNames.jsp
trunk/testsuite/src/resources/cluster/http/http-cross-ctx-first/getAttribute.jsp
trunk/testsuite/src/resources/cluster/http/http-cross-ctx-first/invalidateSession.jsp
trunk/testsuite/src/resources/cluster/http/http-cross-ctx-first/modifyAttribute.jsp
trunk/testsuite/src/resources/cluster/http/http-cross-ctx-first/removeAttribute.jsp
trunk/testsuite/src/resources/cluster/http/http-cross-ctx-first/setSession.jsp
trunk/testsuite/src/resources/cluster/http/http-cross-ctx-second/
trunk/testsuite/src/resources/cluster/http/http-cross-ctx-second/WEB-INF/
trunk/testsuite/src/resources/cluster/http/http-cross-ctx-second/WEB-INF/context.xml
trunk/testsuite/src/resources/cluster/http/http-cross-ctx-second/WEB-INF/jboss-web.xml
trunk/testsuite/src/resources/cluster/http/http-cross-ctx-second/WEB-INF/web.xml
trunk/testsuite/src/resources/cluster/http/http-cross-ctx-second/attributeNames.jsp
trunk/testsuite/src/resources/cluster/http/http-cross-ctx-second/getAttribute.jsp
trunk/testsuite/src/resources/cluster/http/http-cross-ctx-second/invalidateSession.jsp
trunk/testsuite/src/resources/cluster/http/http-cross-ctx-second/modifyAttribute.jsp
trunk/testsuite/src/resources/cluster/http/http-cross-ctx-second/removeAttribute.jsp
trunk/testsuite/src/resources/cluster/http/http-cross-ctx-second/setSession.jsp
trunk/testsuite/src/resources/cluster/http/http-cross-ctx-third/
trunk/testsuite/src/resources/cluster/http/http-cross-ctx-third/WEB-INF/
trunk/testsuite/src/resources/cluster/http/http-cross-ctx-third/WEB-INF/context.xml
trunk/testsuite/src/resources/cluster/http/http-cross-ctx-third/WEB-INF/jboss-web.xml
trunk/testsuite/src/resources/cluster/http/http-cross-ctx-third/WEB-INF/web.xml
trunk/testsuite/src/resources/cluster/http/http-cross-ctx-third/attributeNames.jsp
trunk/testsuite/src/resources/cluster/http/http-cross-ctx-third/getAttribute.jsp
trunk/testsuite/src/resources/cluster/http/http-cross-ctx-third/invalidateSession.jsp
trunk/testsuite/src/resources/cluster/http/http-cross-ctx-third/modifyAttribute.jsp
trunk/testsuite/src/resources/cluster/http/http-cross-ctx-third/removeAttribute.jsp
trunk/testsuite/src/resources/cluster/http/http-cross-ctx-third/setSession.jsp
Log:
[JBAS-3318] Test for replication of all sessions in a cross-context request
Added: trunk/testsuite/src/resources/cluster/http/application.xml
===================================================================
--- trunk/testsuite/src/resources/cluster/http/application.xml 2006-08-02 19:05:09 UTC (rev 55041)
+++ trunk/testsuite/src/resources/cluster/http/application.xml 2006-08-02 21:04:08 UTC (rev 55042)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE application PUBLIC
+ "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN"
+ "http://java.sun.com/dtd/application_1_3.dtd">
+
+<application>
+ <display-name>JBoss Cross Context Session Replication Tests</display-name>
+
+ <module>
+ <web>
+ <web-uri>http-cross-ctx-first.war</web-uri>
+ <context-root>/http-cross-ctx-first</context-root>
+ </web>
+ </module>
+ <module>
+ <web>
+ <web-uri>http-cross-ctx-second.war</web-uri>
+ <context-root>/http-cross-ctx-second</context-root>
+ </web>
+ </module>
+ <module>
+ <web>
+ <web-uri>http-cross-ctx-third.war</web-uri>
+ <context-root>/http-cross-ctx-third</context-root>
+ </web>
+ </module>
+
+</application>
Added: trunk/testsuite/src/resources/cluster/http/http-cross-ctx-first/WEB-INF/context.xml
===================================================================
--- trunk/testsuite/src/resources/cluster/http/http-cross-ctx-first/WEB-INF/context.xml 2006-08-02 19:05:09 UTC (rev 55041)
+++ trunk/testsuite/src/resources/cluster/http/http-cross-ctx-first/WEB-INF/context.xml 2006-08-02 21:04:08 UTC (rev 55042)
@@ -0,0 +1,17 @@
+<!-- Ensure cross-context is true, it's the default but lets be sure -->
+<Context cookies="true" crossContext="true">
+ <!-- Session persistence is disable by default. To enable for all web
+ apps set the pathname to a non-empty value:
+ <Manager pathname="SESSIONS.ser" />
+
+ To enable session persistence for a single web app, add a
+ WEB-INF/context.xml
+ -->
+ <Manager pathname="" />
+
+ <!-- Install an InstanceListener to handle the establishment of the run-as
+ role for servlet init/destroy events.
+ -->
+ <InstanceListener>org.jboss.web.tomcat.security.RunAsListener</InstanceListener>
+
+</Context>
Added: trunk/testsuite/src/resources/cluster/http/http-cross-ctx-first/WEB-INF/jboss-web.xml
===================================================================
--- trunk/testsuite/src/resources/cluster/http/http-cross-ctx-first/WEB-INF/jboss-web.xml 2006-08-02 19:05:09 UTC (rev 55041)
+++ trunk/testsuite/src/resources/cluster/http/http-cross-ctx-first/WEB-INF/jboss-web.xml 2006-08-02 21:04:08 UTC (rev 55042)
@@ -0,0 +1,13 @@
+<jboss-web>
+ <class-loading>
+ <loader-repository>jboss.web:loader=testHA</loader-repository>
+ </class-loading>
+
+ <!-- To avoid a custom config, use the jmx-console security domain -->
+ <security-domain>java:/jaas/jmx-console</security-domain>
+
+ <replication-config>
+ <replication-trigger>SET_AND_GET</replication-trigger>
+ <replication-granularity>SESSION</replication-granularity>
+ </replication-config>
+</jboss-web>
Added: trunk/testsuite/src/resources/cluster/http/http-cross-ctx-first/WEB-INF/web.xml
===================================================================
--- trunk/testsuite/src/resources/cluster/http/http-cross-ctx-first/WEB-INF/web.xml 2006-08-02 19:05:09 UTC (rev 55041)
+++ trunk/testsuite/src/resources/cluster/http/http-cross-ctx-first/WEB-INF/web.xml 2006-08-02 21:04:08 UTC (rev 55042)
@@ -0,0 +1,35 @@
+<?xml version="1.0"?>
+<!DOCTYPE web-app PUBLIC
+ "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd">
+
+<web-app>
+ <description>Testing HttpSessionRepl</description>
+
+ <distributable/>
+
+ <security-constraint>
+ <web-resource-collection>
+ <web-resource-name>Restricted</web-resource-name>
+ <description>Single SignOn Tests</description>
+ <url-pattern>/index.html</url-pattern>
+ </web-resource-collection>
+ <auth-constraint>
+ <description>Only authenticated users can access secure content</description>
+ <role-name>JBossAdmin</role-name>
+ </auth-constraint>
+ </security-constraint>
+
+ <login-config>
+ <auth-method>FORM</auth-method>
+ <form-login-config>
+ <form-login-page>/login.html</form-login-page>
+ <form-error-page>/error.html</form-error-page>
+ </form-login-config>
+ </login-config>
+
+ <security-role>
+ <role-name>JBossAdmin</role-name>
+ </security-role>
+
+</web-app>
Added: trunk/testsuite/src/resources/cluster/http/http-cross-ctx-first/attributeNames.jsp
===================================================================
--- trunk/testsuite/src/resources/cluster/http/http-cross-ctx-first/attributeNames.jsp 2006-08-02 19:05:09 UTC (rev 55041)
+++ trunk/testsuite/src/resources/cluster/http/http-cross-ctx-first/attributeNames.jsp 2006-08-02 21:04:08 UTC (rev 55042)
@@ -0,0 +1,19 @@
+<%@page contentType="text/html"
+ import="java.util.*"
+%>
+<%
+ Enumeration names = session.getAttributeNames();
+ String list = "";
+ while (names.hasMoreElements())
+ {
+ list += names.nextElement();
+ }
+
+ response.setHeader("FIRST", list);
+
+ ServletContext ctx = application.getContext("/http-cross-ctx-second");
+ RequestDispatcher disp = ctx.getRequestDispatcher("/attributeNames.jsp");
+
+ disp.forward(request, response);
+%>
+
Added: trunk/testsuite/src/resources/cluster/http/http-cross-ctx-first/getAttribute.jsp
===================================================================
--- trunk/testsuite/src/resources/cluster/http/http-cross-ctx-first/getAttribute.jsp 2006-08-02 19:05:09 UTC (rev 55041)
+++ trunk/testsuite/src/resources/cluster/http/http-cross-ctx-first/getAttribute.jsp 2006-08-02 21:04:08 UTC (rev 55042)
@@ -0,0 +1,13 @@
+<%@page contentType="text/html"
+ import="java.util.*"
+ import="org.jboss.test.cluster.web.Person"
+%>
+<%
+ String name = ((Person)session.getAttribute("TEST_PERSON")).getName();
+ response.setHeader("FIRST", name);
+
+ ServletContext ctx = application.getContext("/http-cross-ctx-second");
+ RequestDispatcher disp = ctx.getRequestDispatcher("/getAttribute.jsp");
+
+ disp.forward(request, response);
+%>
Added: trunk/testsuite/src/resources/cluster/http/http-cross-ctx-first/invalidateSession.jsp
===================================================================
--- trunk/testsuite/src/resources/cluster/http/http-cross-ctx-first/invalidateSession.jsp 2006-08-02 19:05:09 UTC (rev 55041)
+++ trunk/testsuite/src/resources/cluster/http/http-cross-ctx-first/invalidateSession.jsp 2006-08-02 21:04:08 UTC (rev 55042)
@@ -0,0 +1,14 @@
+<%@page contentType="text/html"
+ import="java.util.*"
+ import="org.jboss.test.cluster.web.Person"
+%>
+<%
+ String name = ((Person)session.getAttribute("TEST_PERSON")).getName();
+ response.setHeader("FIRST", name);
+ session.invalidate();
+
+ ServletContext ctx = application.getContext("/http-cross-ctx-second");
+ RequestDispatcher disp = ctx.getRequestDispatcher("/invalidateSession.jsp");
+
+ disp.forward(request, response);
+%>
Added: trunk/testsuite/src/resources/cluster/http/http-cross-ctx-first/modifyAttribute.jsp
===================================================================
--- trunk/testsuite/src/resources/cluster/http/http-cross-ctx-first/modifyAttribute.jsp 2006-08-02 19:05:09 UTC (rev 55041)
+++ trunk/testsuite/src/resources/cluster/http/http-cross-ctx-first/modifyAttribute.jsp 2006-08-02 21:04:08 UTC (rev 55042)
@@ -0,0 +1,16 @@
+<%@page contentType="text/html"
+ import="java.util.*"
+ import="org.jboss.test.cluster.web.Person"
+%>
+<%
+ String name = "Joe";
+ Person person = (Person)session.getAttribute("TEST_PERSON");
+ person.setName(name);
+ session.setAttribute("TEST_PERSON", person);
+ response.setHeader("FIRST", name);
+
+ ServletContext ctx = application.getContext("/http-cross-ctx-second");
+ RequestDispatcher disp = ctx.getRequestDispatcher("/modifyAttribute.jsp");
+
+ disp.forward(request, response);
+%>
Added: trunk/testsuite/src/resources/cluster/http/http-cross-ctx-first/removeAttribute.jsp
===================================================================
--- trunk/testsuite/src/resources/cluster/http/http-cross-ctx-first/removeAttribute.jsp 2006-08-02 19:05:09 UTC (rev 55041)
+++ trunk/testsuite/src/resources/cluster/http/http-cross-ctx-first/removeAttribute.jsp 2006-08-02 21:04:08 UTC (rev 55042)
@@ -0,0 +1,16 @@
+<%@page contentType="text/html"
+ import="java.util.*"
+ import="org.jboss.test.cluster.web.Person"
+%>
+
+<%
+ String name = ((Person)session.getAttribute("TEST_PERSON")).getName();
+ response.setHeader("FIRST", name);
+
+ session.removeAttribute("TEST_PERSON");
+
+ ServletContext ctx = application.getContext("/http-cross-ctx-second");
+ RequestDispatcher disp = ctx.getRequestDispatcher("/removeAttribute.jsp");
+
+ disp.forward(request, response);
+%>
Added: trunk/testsuite/src/resources/cluster/http/http-cross-ctx-first/setSession.jsp
===================================================================
--- trunk/testsuite/src/resources/cluster/http/http-cross-ctx-first/setSession.jsp 2006-08-02 19:05:09 UTC (rev 55041)
+++ trunk/testsuite/src/resources/cluster/http/http-cross-ctx-first/setSession.jsp 2006-08-02 21:04:08 UTC (rev 55042)
@@ -0,0 +1,19 @@
+<%@page contentType="text/html"
+ import="java.util.*"
+ import="javax.servlet.*"
+ import="org.jboss.test.cluster.web.Person"
+%>
+
+<%
+ String id=request.getSession().getId();
+ session.setAttribute("TEST_ID",id);
+ Person person=new Person("Ben", 55);
+ session.setAttribute("TEST_PERSON", person);
+
+ response.setHeader("FIRST", person.getName());
+
+ ServletContext ctx = application.getContext("/http-cross-ctx-second");
+ RequestDispatcher disp = ctx.getRequestDispatcher("/setSession.jsp");
+
+ disp.forward(request, response);
+%>
\ No newline at end of file
Added: trunk/testsuite/src/resources/cluster/http/http-cross-ctx-second/WEB-INF/context.xml
===================================================================
--- trunk/testsuite/src/resources/cluster/http/http-cross-ctx-second/WEB-INF/context.xml 2006-08-02 19:05:09 UTC (rev 55041)
+++ trunk/testsuite/src/resources/cluster/http/http-cross-ctx-second/WEB-INF/context.xml 2006-08-02 21:04:08 UTC (rev 55042)
@@ -0,0 +1,17 @@
+<!-- Ensure cross-context is true, it's the default but lets be sure -->
+<Context cookies="true" crossContext="true">
+ <!-- Session persistence is disable by default. To enable for all web
+ apps set the pathname to a non-empty value:
+ <Manager pathname="SESSIONS.ser" />
+
+ To enable session persistence for a single web app, add a
+ WEB-INF/context.xml
+ -->
+ <Manager pathname="" />
+
+ <!-- Install an InstanceListener to handle the establishment of the run-as
+ role for servlet init/destroy events.
+ -->
+ <InstanceListener>org.jboss.web.tomcat.security.RunAsListener</InstanceListener>
+
+</Context>
Added: trunk/testsuite/src/resources/cluster/http/http-cross-ctx-second/WEB-INF/jboss-web.xml
===================================================================
--- trunk/testsuite/src/resources/cluster/http/http-cross-ctx-second/WEB-INF/jboss-web.xml 2006-08-02 19:05:09 UTC (rev 55041)
+++ trunk/testsuite/src/resources/cluster/http/http-cross-ctx-second/WEB-INF/jboss-web.xml 2006-08-02 21:04:08 UTC (rev 55042)
@@ -0,0 +1,13 @@
+<jboss-web>
+ <class-loading>
+ <loader-repository>jboss.web:loader=testHA</loader-repository>
+ </class-loading>
+
+ <!-- To avoid a custom config, use the jmx-console security domain -->
+ <security-domain>java:/jaas/jmx-console</security-domain>
+
+ <replication-config>
+ <replication-trigger>SET_AND_GET</replication-trigger>
+ <replication-granularity>SESSION</replication-granularity>
+ </replication-config>
+</jboss-web>
Added: trunk/testsuite/src/resources/cluster/http/http-cross-ctx-second/WEB-INF/web.xml
===================================================================
--- trunk/testsuite/src/resources/cluster/http/http-cross-ctx-second/WEB-INF/web.xml 2006-08-02 19:05:09 UTC (rev 55041)
+++ trunk/testsuite/src/resources/cluster/http/http-cross-ctx-second/WEB-INF/web.xml 2006-08-02 21:04:08 UTC (rev 55042)
@@ -0,0 +1,35 @@
+<?xml version="1.0"?>
+<!DOCTYPE web-app PUBLIC
+ "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd">
+
+<web-app>
+ <description>Testing HttpSessionRepl</description>
+
+ <distributable/>
+
+ <security-constraint>
+ <web-resource-collection>
+ <web-resource-name>Restricted</web-resource-name>
+ <description>Single SignOn Tests</description>
+ <url-pattern>/index.html</url-pattern>
+ </web-resource-collection>
+ <auth-constraint>
+ <description>Only authenticated users can access secure content</description>
+ <role-name>JBossAdmin</role-name>
+ </auth-constraint>
+ </security-constraint>
+
+ <login-config>
+ <auth-method>FORM</auth-method>
+ <form-login-config>
+ <form-login-page>/login.html</form-login-page>
+ <form-error-page>/error.html</form-error-page>
+ </form-login-config>
+ </login-config>
+
+ <security-role>
+ <role-name>JBossAdmin</role-name>
+ </security-role>
+
+</web-app>
Added: trunk/testsuite/src/resources/cluster/http/http-cross-ctx-second/attributeNames.jsp
===================================================================
--- trunk/testsuite/src/resources/cluster/http/http-cross-ctx-second/attributeNames.jsp 2006-08-02 19:05:09 UTC (rev 55041)
+++ trunk/testsuite/src/resources/cluster/http/http-cross-ctx-second/attributeNames.jsp 2006-08-02 21:04:08 UTC (rev 55042)
@@ -0,0 +1,19 @@
+<%@page contentType="text/html"
+ import="java.util.*"
+%>
+<%
+ Enumeration names = session.getAttributeNames();
+ String list = "";
+ while (names.hasMoreElements())
+ {
+ list += names.nextElement();
+ }
+
+ response.setHeader("SECOND", list);
+
+ ServletContext ctx = application.getContext("/http-cross-ctx-third");
+ RequestDispatcher disp = ctx.getRequestDispatcher("/attributeNames.jsp");
+
+ disp.include(request, response);
+%>
+
Added: trunk/testsuite/src/resources/cluster/http/http-cross-ctx-second/getAttribute.jsp
===================================================================
--- trunk/testsuite/src/resources/cluster/http/http-cross-ctx-second/getAttribute.jsp 2006-08-02 19:05:09 UTC (rev 55041)
+++ trunk/testsuite/src/resources/cluster/http/http-cross-ctx-second/getAttribute.jsp 2006-08-02 21:04:08 UTC (rev 55042)
@@ -0,0 +1,13 @@
+<%@page contentType="text/html"
+ import="java.util.*"
+ import="org.jboss.test.cluster.web.Person"
+%>
+<%
+ String name = ((Person)session.getAttribute("TEST_PERSON")).getName();
+ response.setHeader("SECOND", name);
+
+ ServletContext ctx = application.getContext("/http-cross-ctx-third");
+ RequestDispatcher disp = ctx.getRequestDispatcher("/getAttribute.jsp");
+
+ disp.include(request, response);
+%>
Added: trunk/testsuite/src/resources/cluster/http/http-cross-ctx-second/invalidateSession.jsp
===================================================================
--- trunk/testsuite/src/resources/cluster/http/http-cross-ctx-second/invalidateSession.jsp 2006-08-02 19:05:09 UTC (rev 55041)
+++ trunk/testsuite/src/resources/cluster/http/http-cross-ctx-second/invalidateSession.jsp 2006-08-02 21:04:08 UTC (rev 55042)
@@ -0,0 +1,14 @@
+<%@page contentType="text/html"
+ import="java.util.*"
+ import="org.jboss.test.cluster.web.Person"
+%>
+<%
+ String name = ((Person)session.getAttribute("TEST_PERSON")).getName();
+ response.setHeader("SECOND", name);
+ session.invalidate();
+
+ ServletContext ctx = application.getContext("/http-cross-ctx-third");
+ RequestDispatcher disp = ctx.getRequestDispatcher("/invalidateSession.jsp");
+
+ disp.include(request, response);
+%>
Added: trunk/testsuite/src/resources/cluster/http/http-cross-ctx-second/modifyAttribute.jsp
===================================================================
--- trunk/testsuite/src/resources/cluster/http/http-cross-ctx-second/modifyAttribute.jsp 2006-08-02 19:05:09 UTC (rev 55041)
+++ trunk/testsuite/src/resources/cluster/http/http-cross-ctx-second/modifyAttribute.jsp 2006-08-02 21:04:08 UTC (rev 55042)
@@ -0,0 +1,16 @@
+<%@page contentType="text/html"
+ import="java.util.*"
+ import="org.jboss.test.cluster.web.Person"
+%>
+<%
+ String name = "Tina";
+ Person person = (Person)session.getAttribute("TEST_PERSON");
+ person.setName(name);
+ session.setAttribute("TEST_PERSON", person);
+ response.setHeader("SECOND", name);
+
+ ServletContext ctx = application.getContext("/http-cross-ctx-third");
+ RequestDispatcher disp = ctx.getRequestDispatcher("/modifyAttribute.jsp");
+
+ disp.include(request, response);
+%>
Added: trunk/testsuite/src/resources/cluster/http/http-cross-ctx-second/removeAttribute.jsp
===================================================================
--- trunk/testsuite/src/resources/cluster/http/http-cross-ctx-second/removeAttribute.jsp 2006-08-02 19:05:09 UTC (rev 55041)
+++ trunk/testsuite/src/resources/cluster/http/http-cross-ctx-second/removeAttribute.jsp 2006-08-02 21:04:08 UTC (rev 55042)
@@ -0,0 +1,16 @@
+<%@page contentType="text/html"
+ import="java.util.*"
+ import="org.jboss.test.cluster.web.Person"
+%>
+
+<%
+ String name = ((Person)session.getAttribute("TEST_PERSON")).getName();
+ response.setHeader("SECOND", name);
+
+ session.removeAttribute("TEST_PERSON");
+
+ ServletContext ctx = application.getContext("/http-cross-ctx-third");
+ RequestDispatcher disp = ctx.getRequestDispatcher("/removeAttribute.jsp");
+
+ disp.include(request, response);
+%>
Added: trunk/testsuite/src/resources/cluster/http/http-cross-ctx-second/setSession.jsp
===================================================================
--- trunk/testsuite/src/resources/cluster/http/http-cross-ctx-second/setSession.jsp 2006-08-02 19:05:09 UTC (rev 55041)
+++ trunk/testsuite/src/resources/cluster/http/http-cross-ctx-second/setSession.jsp 2006-08-02 21:04:08 UTC (rev 55042)
@@ -0,0 +1,18 @@
+<%@page contentType="text/html"
+ import="java.util.*"
+ import="javax.servlet.*"
+ import="org.jboss.test.cluster.web.Person"
+%>
+
+<%
+ String id=request.getSession().getId();
+ session.setAttribute("TEST_ID",id);
+ Person person=new Person("Mary", 55);
+ session.setAttribute("TEST_PERSON", person);
+
+ response.setHeader("SECOND", person.getName());
+
+ ServletContext ctx = application.getContext("/http-cross-ctx-third");
+ RequestDispatcher disp = ctx.getRequestDispatcher("/setSession.jsp");
+ disp.include(request, response);
+%>
Added: trunk/testsuite/src/resources/cluster/http/http-cross-ctx-third/WEB-INF/context.xml
===================================================================
--- trunk/testsuite/src/resources/cluster/http/http-cross-ctx-third/WEB-INF/context.xml 2006-08-02 19:05:09 UTC (rev 55041)
+++ trunk/testsuite/src/resources/cluster/http/http-cross-ctx-third/WEB-INF/context.xml 2006-08-02 21:04:08 UTC (rev 55042)
@@ -0,0 +1,17 @@
+<!-- Ensure cross-context is true, it's the default but lets be sure -->
+<Context cookies="true" crossContext="true">
+ <!-- Session persistence is disable by default. To enable for all web
+ apps set the pathname to a non-empty value:
+ <Manager pathname="SESSIONS.ser" />
+
+ To enable session persistence for a single web app, add a
+ WEB-INF/context.xml
+ -->
+ <Manager pathname="" />
+
+ <!-- Install an InstanceListener to handle the establishment of the run-as
+ role for servlet init/destroy events.
+ -->
+ <InstanceListener>org.jboss.web.tomcat.security.RunAsListener</InstanceListener>
+
+</Context>
Added: trunk/testsuite/src/resources/cluster/http/http-cross-ctx-third/WEB-INF/jboss-web.xml
===================================================================
--- trunk/testsuite/src/resources/cluster/http/http-cross-ctx-third/WEB-INF/jboss-web.xml 2006-08-02 19:05:09 UTC (rev 55041)
+++ trunk/testsuite/src/resources/cluster/http/http-cross-ctx-third/WEB-INF/jboss-web.xml 2006-08-02 21:04:08 UTC (rev 55042)
@@ -0,0 +1,13 @@
+<jboss-web>
+ <class-loading>
+ <loader-repository>jboss.web:loader=testHA</loader-repository>
+ </class-loading>
+
+ <!-- To avoid a custom config, use the jmx-console security domain -->
+ <security-domain>java:/jaas/jmx-console</security-domain>
+
+ <replication-config>
+ <replication-trigger>SET_AND_GET</replication-trigger>
+ <replication-granularity>SESSION</replication-granularity>
+ </replication-config>
+</jboss-web>
Added: trunk/testsuite/src/resources/cluster/http/http-cross-ctx-third/WEB-INF/web.xml
===================================================================
--- trunk/testsuite/src/resources/cluster/http/http-cross-ctx-third/WEB-INF/web.xml 2006-08-02 19:05:09 UTC (rev 55041)
+++ trunk/testsuite/src/resources/cluster/http/http-cross-ctx-third/WEB-INF/web.xml 2006-08-02 21:04:08 UTC (rev 55042)
@@ -0,0 +1,35 @@
+<?xml version="1.0"?>
+<!DOCTYPE web-app PUBLIC
+ "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd">
+
+<web-app>
+ <description>Testing HttpSessionRepl</description>
+
+ <distributable/>
+
+ <security-constraint>
+ <web-resource-collection>
+ <web-resource-name>Restricted</web-resource-name>
+ <description>Single SignOn Tests</description>
+ <url-pattern>/index.html</url-pattern>
+ </web-resource-collection>
+ <auth-constraint>
+ <description>Only authenticated users can access secure content</description>
+ <role-name>JBossAdmin</role-name>
+ </auth-constraint>
+ </security-constraint>
+
+ <login-config>
+ <auth-method>FORM</auth-method>
+ <form-login-config>
+ <form-login-page>/login.html</form-login-page>
+ <form-error-page>/error.html</form-error-page>
+ </form-login-config>
+ </login-config>
+
+ <security-role>
+ <role-name>JBossAdmin</role-name>
+ </security-role>
+
+</web-app>
Added: trunk/testsuite/src/resources/cluster/http/http-cross-ctx-third/attributeNames.jsp
===================================================================
--- trunk/testsuite/src/resources/cluster/http/http-cross-ctx-third/attributeNames.jsp 2006-08-02 19:05:09 UTC (rev 55041)
+++ trunk/testsuite/src/resources/cluster/http/http-cross-ctx-third/attributeNames.jsp 2006-08-02 21:04:08 UTC (rev 55042)
@@ -0,0 +1,12 @@
+<%@page contentType="text/html"
+ import="java.util.*"
+%>
+<%
+ Enumeration names = session.getAttributeNames();
+ String list = "";
+ while (names.hasMoreElements())
+ {
+ list += names.nextElement();
+ }
+%>
+<%= list %>
\ No newline at end of file
Added: trunk/testsuite/src/resources/cluster/http/http-cross-ctx-third/getAttribute.jsp
===================================================================
--- trunk/testsuite/src/resources/cluster/http/http-cross-ctx-third/getAttribute.jsp 2006-08-02 19:05:09 UTC (rev 55041)
+++ trunk/testsuite/src/resources/cluster/http/http-cross-ctx-third/getAttribute.jsp 2006-08-02 21:04:08 UTC (rev 55042)
@@ -0,0 +1,5 @@
+<%@page contentType="text/html"
+ import="java.util.*"
+ import="org.jboss.test.cluster.web.Person"
+%>
+<%=((Person)session.getAttribute("TEST_PERSON")).getAge() %>
Added: trunk/testsuite/src/resources/cluster/http/http-cross-ctx-third/invalidateSession.jsp
===================================================================
--- trunk/testsuite/src/resources/cluster/http/http-cross-ctx-third/invalidateSession.jsp 2006-08-02 19:05:09 UTC (rev 55041)
+++ trunk/testsuite/src/resources/cluster/http/http-cross-ctx-third/invalidateSession.jsp 2006-08-02 21:04:08 UTC (rev 55042)
@@ -0,0 +1,9 @@
+<%@page contentType="text/html"
+ import="java.util.*"
+ import="org.jboss.test.cluster.web.Person"
+%>
+<%
+ int age = ((Person)session.getAttribute("TEST_PERSON")).getAge();
+ session.invalidate();
+%>
+<%= age %>
Added: trunk/testsuite/src/resources/cluster/http/http-cross-ctx-third/modifyAttribute.jsp
===================================================================
--- trunk/testsuite/src/resources/cluster/http/http-cross-ctx-third/modifyAttribute.jsp 2006-08-02 19:05:09 UTC (rev 55041)
+++ trunk/testsuite/src/resources/cluster/http/http-cross-ctx-third/modifyAttribute.jsp 2006-08-02 21:04:08 UTC (rev 55042)
@@ -0,0 +1,10 @@
+<%@page contentType="text/html"
+ import="java.util.*"
+ import="org.jboss.test.cluster.web.Person"
+%>
+<%
+ Person person = (Person)session.getAttribute("TEST_PERSON");
+ person.setAge(41);
+ session.setAttribute("TEST_PERSON", person);
+%>
+<%= person.getAge() %>
Added: trunk/testsuite/src/resources/cluster/http/http-cross-ctx-third/removeAttribute.jsp
===================================================================
--- trunk/testsuite/src/resources/cluster/http/http-cross-ctx-third/removeAttribute.jsp 2006-08-02 19:05:09 UTC (rev 55041)
+++ trunk/testsuite/src/resources/cluster/http/http-cross-ctx-third/removeAttribute.jsp 2006-08-02 21:04:08 UTC (rev 55042)
@@ -0,0 +1,10 @@
+<%@page contentType="text/html"
+ import="java.util.*"
+ import="org.jboss.test.cluster.web.Person"
+%>
+
+<%
+ int age = ((Person)session.getAttribute("TEST_PERSON")).getAge();
+ session.removeAttribute("TEST_PERSON");
+%>
+<%= age %>
Added: trunk/testsuite/src/resources/cluster/http/http-cross-ctx-third/setSession.jsp
===================================================================
--- trunk/testsuite/src/resources/cluster/http/http-cross-ctx-third/setSession.jsp 2006-08-02 19:05:09 UTC (rev 55041)
+++ trunk/testsuite/src/resources/cluster/http/http-cross-ctx-third/setSession.jsp 2006-08-02 21:04:08 UTC (rev 55042)
@@ -0,0 +1,12 @@
+<%@page contentType="text/html"
+ import="java.util.*"
+ import="org.jboss.test.cluster.web.Person"
+%>
+
+<%
+ String id=request.getSession().getId();
+ session.setAttribute("TEST_ID",id);
+ Person person=new Person("Gary", 32);
+ session.setAttribute("TEST_PERSON", person);
+%>
+<%= person.getAge() %>
\ No newline at end of file
More information about the jboss-cvs-commits
mailing list