[jboss-cvs] JBossAS SVN: r60216 - in branches/Branch_4_2/testsuite/src: resources/cluster/http/http-field and 1 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Feb 2 16:21:43 EST 2007


Author: bstansberry at jboss.com
Date: 2007-02-02 16:21:43 -0500 (Fri, 02 Feb 2007)
New Revision: 60216

Added:
   branches/Branch_4_2/testsuite/src/resources/cluster/http/http-field/base/
   branches/Branch_4_2/testsuite/src/resources/cluster/http/http-field/base/bindSession.jsp
   branches/Branch_4_2/testsuite/src/resources/cluster/http/http-field/base/getAttribute.jsp
   branches/Branch_4_2/testsuite/src/resources/cluster/http/http-field/base/modifyAttribute.jsp
   branches/Branch_4_2/testsuite/src/resources/cluster/http/http-field/base/modifySubject.jsp
   branches/Branch_4_2/testsuite/src/resources/cluster/http/http-field/base/setSession.jsp
Removed:
   branches/Branch_4_2/testsuite/src/resources/cluster/http/http-field/bindSession.jsp
   branches/Branch_4_2/testsuite/src/resources/cluster/http/http-field/getAttribute.jsp
   branches/Branch_4_2/testsuite/src/resources/cluster/http/http-field/modifyAttribute.jsp
   branches/Branch_4_2/testsuite/src/resources/cluster/http/http-field/modifySubject.jsp
   branches/Branch_4_2/testsuite/src/resources/cluster/http/http-field/setSession.jsp
Modified:
   branches/Branch_4_2/testsuite/src/main/org/jboss/test/cluster/web/aop/Address.java
   branches/Branch_4_2/testsuite/src/main/org/jboss/test/cluster/web/aop/AopBindingListener.java
   branches/Branch_4_2/testsuite/src/main/org/jboss/test/cluster/web/aop/Course.java
   branches/Branch_4_2/testsuite/src/main/org/jboss/test/cluster/web/aop/Person.java
   branches/Branch_4_2/testsuite/src/main/org/jboss/test/cluster/web/aop/Student.java
Log:
Test both marker-interface-based and annotation-based FIELD repl

Modified: branches/Branch_4_2/testsuite/src/main/org/jboss/test/cluster/web/aop/Address.java
===================================================================
--- branches/Branch_4_2/testsuite/src/main/org/jboss/test/cluster/web/aop/Address.java	2007-02-02 21:19:02 UTC (rev 60215)
+++ branches/Branch_4_2/testsuite/src/main/org/jboss/test/cluster/web/aop/Address.java	2007-02-02 21:21:43 UTC (rev 60216)
@@ -28,9 +28,8 @@
  * Person is a POJO that will be instrumented with CacheInterceptor
  *
  * @version $Revision$
- * annotation marker that is needed for fine-grained replication.
- * @@org.jboss.web.tomcat.service.session.AopMarker
  */
+ at org.jboss.cache.aop.annotation.PojoCacheable
 public class Address
 {
    String street = null;

Modified: branches/Branch_4_2/testsuite/src/main/org/jboss/test/cluster/web/aop/AopBindingListener.java
===================================================================
--- branches/Branch_4_2/testsuite/src/main/org/jboss/test/cluster/web/aop/AopBindingListener.java	2007-02-02 21:19:02 UTC (rev 60215)
+++ branches/Branch_4_2/testsuite/src/main/org/jboss/test/cluster/web/aop/AopBindingListener.java	2007-02-02 21:21:43 UTC (rev 60216)
@@ -29,12 +29,8 @@
  * 
  * @author <a href="mailto://brian.stansberry@jboss.com">Brian Stansberry</a>
  * @version $Revision$
- * 
- * Annotation marker that is needed for fine-grained replication.
- * Note that we do it in 1.4 style now so it needs annotation compiler,
- * annotationc.
- * @@org.jboss.web.tomcat.service.session.AopMarker
  */
+ at org.jboss.cache.aop.annotation.PojoCacheable
 public class AopBindingListener extends BindingListener
 {
 

Modified: branches/Branch_4_2/testsuite/src/main/org/jboss/test/cluster/web/aop/Course.java
===================================================================
--- branches/Branch_4_2/testsuite/src/main/org/jboss/test/cluster/web/aop/Course.java	2007-02-02 21:19:02 UTC (rev 60215)
+++ branches/Branch_4_2/testsuite/src/main/org/jboss/test/cluster/web/aop/Course.java	2007-02-02 21:21:43 UTC (rev 60216)
@@ -23,8 +23,8 @@
 
 /**
  * @author Brian Stansberry
- * @@org.jboss.web.tomcat.service.session.AopMarker
  */
+ at org.jboss.cache.aop.annotation.PojoCacheable
 public class Course {
    protected String title;
    protected String instructor;

Modified: branches/Branch_4_2/testsuite/src/main/org/jboss/test/cluster/web/aop/Person.java
===================================================================
--- branches/Branch_4_2/testsuite/src/main/org/jboss/test/cluster/web/aop/Person.java	2007-02-02 21:19:02 UTC (rev 60215)
+++ branches/Branch_4_2/testsuite/src/main/org/jboss/test/cluster/web/aop/Person.java	2007-02-02 21:21:43 UTC (rev 60216)
@@ -29,9 +29,8 @@
  * Person is a POJO that will be instrumented with CacheInterceptor
  *
  * @version $Revision$
- * annotation marker that is needed for fine-grained replication.
- * @@org.jboss.web.tomcat.service.session.InstanceOfAopMarker
  */
+ at org.jboss.cache.aop.annotation.InstanceOfPojoCacheable
 public class Person
 {
    String name = null;

Modified: branches/Branch_4_2/testsuite/src/main/org/jboss/test/cluster/web/aop/Student.java
===================================================================
--- branches/Branch_4_2/testsuite/src/main/org/jboss/test/cluster/web/aop/Student.java	2007-02-02 21:19:02 UTC (rev 60215)
+++ branches/Branch_4_2/testsuite/src/main/org/jboss/test/cluster/web/aop/Student.java	2007-02-02 21:21:43 UTC (rev 60216)
@@ -28,7 +28,7 @@
  * Student is a POJO that will be instrumented with CacheInterceptor
  *
  * @version $Revision$
- * annotation marker that is needed for fine-grained replication.
+ * No annotation marker needed as the superclass uses InstanceOfAopMarker.
  */
 public class Student extends Person
 {

Added: branches/Branch_4_2/testsuite/src/resources/cluster/http/http-field/base/bindSession.jsp
===================================================================
--- branches/Branch_4_2/testsuite/src/resources/cluster/http/http-field/base/bindSession.jsp	                        (rev 0)
+++ branches/Branch_4_2/testsuite/src/resources/cluster/http/http-field/base/bindSession.jsp	2007-02-02 21:21:43 UTC (rev 60216)
@@ -0,0 +1,62 @@
+<%@page contentType="text/html"
+   import="java.util.*, 
+   org.jboss.test.cluster.web.aop.AopBindingListener"
+%>
+
+<html>
+<%
+   String resp = "FAILED";
+   AopBindingListener listener = new AopBindingListener();
+%>
+
+<% 
+   String bind = (String)request.getParameter("Binding");
+   if( "new".equals(bind) ) {
+      session.setAttribute("binding", listener);
+      try {
+         Thread.sleep(1000);
+      } catch (Exception ex) {}
+
+      if( listener.getValueBound() ) {
+         resp = "OK";
+      }
+   } 
+   else if ( "replace".equals(bind) ) {
+      listener = (AopBindingListener)session.getAttribute("binding");
+      session.setAttribute("binding", new AopBindingListener());
+      try {
+         Thread.sleep(1000);
+      } catch (Exception ex) {}
+
+      if( listener.getValueUnBound() ) {
+         resp = "OK";
+      }
+   } 
+   else if ( "rebind".equals(bind) ){
+      // JBAS-2381 -- if we rebind the same object 
+      // we should not get a valueUnbound()
+      listener = (AopBindingListener)session.getAttribute("binding");
+      session.setAttribute("binding", listener);
+      try {
+         Thread.sleep(1000);
+      } catch (Exception ex) {}
+
+      if( listener.getValueUnBound() == false ) {
+         resp = "OK";
+      }
+   } 
+   else if ( "remove".equals(bind) ) {
+      listener = (AopBindingListener)session.getAttribute("binding");
+      session.removeAttribute("binding");
+      try {
+         Thread.sleep(1000);
+      } catch (Exception ex) {}
+
+      if( listener.getValueUnBound() ) {
+         resp = "OK";
+      }
+   }
+%>
+
+<%=resp%>
+</html>

Added: branches/Branch_4_2/testsuite/src/resources/cluster/http/http-field/base/getAttribute.jsp
===================================================================
--- branches/Branch_4_2/testsuite/src/resources/cluster/http/http-field/base/getAttribute.jsp	                        (rev 0)
+++ branches/Branch_4_2/testsuite/src/resources/cluster/http/http-field/base/getAttribute.jsp	2007-02-02 21:21:43 UTC (rev 60216)
@@ -0,0 +1,39 @@
+<%@page contentType="text/html"
+   import="java.util.*, 
+   javax.servlet.ServletContext,
+   org.jboss.test.cluster.web.CacheHelper, 
+   org.jboss.test.cluster.web.aop.*"
+%>
+
+<%
+   String isNew = session.isNew() ? "true" : "false";
+   response.setHeader("X-SessionIsNew", isNew);
+   
+   Student ben = (Student)session.getAttribute("TEST_PERSON");
+   String flag = ben != null ? "true" : "false";
+   response.setHeader("X-SawTestHttpAttribute", flag);
+   Address addr = (Address)ben.getAddress();
+      flag = addr != null ? "true" : "false";
+      response.setHeader("X-SawTestHttpAttribute", flag);
+
+   Student jane = (Student)session.getAttribute("WIFE");
+   Collection col = jane.getCourses();
+   Course first = null;
+   if(!(col == null || col.size() == 0))
+   {
+      first = (Course)col.iterator().next();
+   } else
+   {
+      throw new RuntimeException("getAttribute(): Empty course from student jane.");
+   }
+
+   // Bind ben to the servlet context as well so it can be
+   // accessed later without involving the session
+   ServletContext ctx = getServletConfig().getServletContext();
+   ctx.setAttribute("TEST_PERSON", ben);
+%>
+
+<%=ben.getName() %>
+<%=addr.getZip() %>
+<%=ben.getLanguages() %>
+<%=first.getInstructor() %>

Added: branches/Branch_4_2/testsuite/src/resources/cluster/http/http-field/base/modifyAttribute.jsp
===================================================================
--- branches/Branch_4_2/testsuite/src/resources/cluster/http/http-field/base/modifyAttribute.jsp	                        (rev 0)
+++ branches/Branch_4_2/testsuite/src/resources/cluster/http/http-field/base/modifyAttribute.jsp	2007-02-02 21:21:43 UTC (rev 60216)
@@ -0,0 +1,29 @@
+<%@page contentType="text/html"
+   import="java.util.*, 
+   javax.servlet.ServletContext, 
+   org.jboss.test.cluster.web.aop.*"
+%>
+
+<% 
+   // Note: The name are hard-coded in the test case as well!!!
+   // POJO modify no need to do setAttribute again!
+   Student ben = (Student)session.getAttribute("TEST_PERSON");
+   ben.setName("Joe");
+   ben.setAge(60);
+   ben.getAddress().setZip(94086);
+
+   Student jane = (Student)session.getAttribute("WIFE");
+   if( jane.getAddress().getZip() != 94086 )
+   {
+      throw new RuntimeException("modifyAttribute(): address zip is not modified properly.");
+   }
+
+   List lang = new ArrayList();
+   lang.add("English");
+   lang.add("Holo");
+   ben.setLanguages(lang);
+
+   Collection col = ben.getCourses();
+   Course first = (Course)col.iterator().next();
+   first.setInstructor("White");
+%>

Added: branches/Branch_4_2/testsuite/src/resources/cluster/http/http-field/base/modifySubject.jsp
===================================================================
--- branches/Branch_4_2/testsuite/src/resources/cluster/http/http-field/base/modifySubject.jsp	                        (rev 0)
+++ branches/Branch_4_2/testsuite/src/resources/cluster/http/http-field/base/modifySubject.jsp	2007-02-02 21:21:43 UTC (rev 60216)
@@ -0,0 +1,16 @@
+<%@page contentType="text/html"
+   import="java.util.*, 
+   javax.servlet.ServletContext, 
+   org.jboss.test.cluster.web.aop.*, 
+   java.security.SecureRandom"
+%>
+
+<% 
+   // Modify the POJO that was bound to the servlet context and
+   // to the session as well.  Only access it via the servlet context
+   // so we can check whether modifying it causes the session
+   // to be replicated.
+   ServletContext ctx = getServletConfig().getServletContext();
+   Person ben = (Person)ctx.getAttribute("TEST_PERSON");
+   ben.setAge(ben.getAge() + new SecureRandom().nextInt(10));
+%>

Added: branches/Branch_4_2/testsuite/src/resources/cluster/http/http-field/base/setSession.jsp
===================================================================
--- branches/Branch_4_2/testsuite/src/resources/cluster/http/http-field/base/setSession.jsp	                        (rev 0)
+++ branches/Branch_4_2/testsuite/src/resources/cluster/http/http-field/base/setSession.jsp	2007-02-02 21:21:43 UTC (rev 60216)
@@ -0,0 +1,47 @@
+<%@page contentType="text/html"
+   import="java.util.*, 
+   javax.servlet.ServletContext, 
+   org.jboss.test.cluster.web.aop.*"
+%>
+
+<html>
+<center>
+<% 
+   String id=request.getSession().getId();
+   session.setAttribute("TEST_ID",id); 
+   Student ben=new Student();
+   Student jane=new Student();
+   Address addr = new Address();
+   addr.setZip(95123);
+   addr.setCity("San Jose");
+   ben.setAge(100);
+   ben.setName("Ben");
+   ben.setAddress(addr);
+   jane.setAge(50);
+   jane.setName("Jane");
+   jane.setAddress(addr);
+
+   Course foo = new Course();
+   foo.setTitle("Intro to Foo");
+   foo.setInstructor("Jones");
+
+   ben.addCourse(foo);
+   jane.addCourse(foo);
+
+   session.setAttribute("TEST_PERSON", ben);
+   session.setAttribute("WIFE", jane);
+
+   Collection col = ben.getCourses();
+   Course first = (Course)col.iterator().next();
+   first.setInstructor("Black");
+
+   // Bind ben to the servlet context as well so it can be
+   // accessed without involving the session
+   ServletContext ctx = getServletConfig().getServletContext();
+   ctx.setAttribute("TEST_PERSON", ben);
+   ctx.setAttribute("WIFE", jane);
+%>
+<%=id%>
+
+<h1><%=application.getServerInfo()%>:<%=request.getServerPort()%></h1>
+</html>

Deleted: branches/Branch_4_2/testsuite/src/resources/cluster/http/http-field/bindSession.jsp
===================================================================
--- branches/Branch_4_2/testsuite/src/resources/cluster/http/http-field/bindSession.jsp	2007-02-02 21:19:02 UTC (rev 60215)
+++ branches/Branch_4_2/testsuite/src/resources/cluster/http/http-field/bindSession.jsp	2007-02-02 21:21:43 UTC (rev 60216)
@@ -1,61 +0,0 @@
-<%@page contentType="text/html"
-   import="java.util.*, org.jboss.test.cluster.web.aop.AopBindingListener"
-%>
-
-<html>
-<%
-   String resp = "FAILED";
-   AopBindingListener listener = new AopBindingListener();
-%>
-
-<% 
-   String bind = (String)request.getParameter("Binding");
-   if( "new".equals(bind) ) {
-      session.setAttribute("binding", listener);
-      try {
-         Thread.sleep(1000);
-      } catch (Exception ex) {}
-
-      if( listener.getValueBound() ) {
-         resp = "OK";
-      }
-   } 
-   else if ( "replace".equals(bind) ) {
-      listener = (AopBindingListener)session.getAttribute("binding");
-      session.setAttribute("binding", new AopBindingListener());
-      try {
-         Thread.sleep(1000);
-      } catch (Exception ex) {}
-
-      if( listener.getValueUnBound() ) {
-         resp = "OK";
-      }
-   } 
-   else if ( "rebind".equals(bind) ){
-      // JBAS-2381 -- if we rebind the same object 
-      // we should not get a valueUnbound()
-      listener = (AopBindingListener)session.getAttribute("binding");
-      session.setAttribute("binding", listener);
-      try {
-         Thread.sleep(1000);
-      } catch (Exception ex) {}
-
-      if( listener.getValueUnBound() == false ) {
-         resp = "OK";
-      }
-   } 
-   else if ( "remove".equals(bind) ) {
-      listener = (AopBindingListener)session.getAttribute("binding");
-      session.removeAttribute("binding");
-      try {
-         Thread.sleep(1000);
-      } catch (Exception ex) {}
-
-      if( listener.getValueUnBound() ) {
-         resp = "OK";
-      }
-   }
-%>
-
-<%=resp%>
-</html>

Deleted: branches/Branch_4_2/testsuite/src/resources/cluster/http/http-field/getAttribute.jsp
===================================================================
--- branches/Branch_4_2/testsuite/src/resources/cluster/http/http-field/getAttribute.jsp	2007-02-02 21:19:02 UTC (rev 60215)
+++ branches/Branch_4_2/testsuite/src/resources/cluster/http/http-field/getAttribute.jsp	2007-02-02 21:21:43 UTC (rev 60216)
@@ -1,40 +0,0 @@
-<%@page contentType="text/html"
-   import="java.util.*, javax.servlet.ServletContext, org.jboss.test.cluster.web.aop.Person,
-   org.jboss.test.cluster.web.aop.Address,
-   org.jboss.test.cluster.web.CacheHelper"
-%>
-<%@ page import="org.jboss.test.cluster.web.aop.Course"%>
-<%@ page import="org.jboss.test.cluster.web.aop.Student"%>
-
-<%
-   String isNew = session.isNew() ? "true" : "false";
-   response.setHeader("X-SessionIsNew", isNew);
-   
-   Student ben = (Student)session.getAttribute("TEST_PERSON");
-   String flag = ben != null ? "true" : "false";
-   response.setHeader("X-SawTestHttpAttribute", flag);
-   Address addr = (Address)ben.getAddress();
-      flag = addr != null ? "true" : "false";
-      response.setHeader("X-SawTestHttpAttribute", flag);
-
-   Student jane = (Student)session.getAttribute("WIFE");
-   Collection col = jane.getCourses();
-   Course first = null;
-   if(!(col == null || col.size() == 0))
-   {
-      first = (Course)col.iterator().next();
-   } else
-   {
-      throw new RuntimeException("getAttribute(): Empty course from student jane.");
-   }
-
-   // Bind ben to the servlet context as well so it can be
-   // accessed later without involving the session
-   ServletContext ctx = getServletConfig().getServletContext();
-   ctx.setAttribute("TEST_PERSON", ben);
-%>
-
-<%=ben.getName() %>
-<%=addr.getZip() %>
-<%=ben.getLanguages() %>
-<%=first.getInstructor() %>

Deleted: branches/Branch_4_2/testsuite/src/resources/cluster/http/http-field/modifyAttribute.jsp
===================================================================
--- branches/Branch_4_2/testsuite/src/resources/cluster/http/http-field/modifyAttribute.jsp	2007-02-02 21:19:02 UTC (rev 60215)
+++ branches/Branch_4_2/testsuite/src/resources/cluster/http/http-field/modifyAttribute.jsp	2007-02-02 21:21:43 UTC (rev 60216)
@@ -1,30 +0,0 @@
-<%@page contentType="text/html"
-   import="java.util.*, javax.servlet.ServletContext, org.jboss.test.cluster.web.aop.Person,
-   org.jboss.test.cluster.web.aop.Address"
-%>
-<%@ page import="org.jboss.test.cluster.web.aop.Student"%>
-<%@ page import="org.jboss.test.cluster.web.aop.Course"%>
-
-<% 
-   // Note: The name are hard-coded in the test case as well!!!
-   // POJO modify no need to do setAttribute again!
-   Student ben = (Student)session.getAttribute("TEST_PERSON");
-   ben.setName("Joe");
-   ben.setAge(60);
-   ben.getAddress().setZip(94086);
-
-   Student jane = (Student)session.getAttribute("WIFE");
-   if( jane.getAddress().getZip() != 94086 )
-   {
-      throw new RuntimeException("modifyAttribute(): address zip is not modified properly.");
-   }
-
-   List lang = new ArrayList();
-   lang.add("English");
-   lang.add("Holo");
-   ben.setLanguages(lang);
-
-   Collection col = ben.getCourses();
-   Course first = (Course)col.iterator().next();
-   first.setInstructor("White");
-%>

Deleted: branches/Branch_4_2/testsuite/src/resources/cluster/http/http-field/modifySubject.jsp
===================================================================
--- branches/Branch_4_2/testsuite/src/resources/cluster/http/http-field/modifySubject.jsp	2007-02-02 21:19:02 UTC (rev 60215)
+++ branches/Branch_4_2/testsuite/src/resources/cluster/http/http-field/modifySubject.jsp	2007-02-02 21:21:43 UTC (rev 60216)
@@ -1,14 +0,0 @@
-<%@page contentType="text/html"
-   import="java.util.*, javax.servlet.ServletContext, org.jboss.test.cluster.web.aop.Person,
-   org.jboss.test.cluster.web.aop.Address, java.security.SecureRandom"
-%>
-
-<% 
-   // Modify the POJO that was bound to the servlet context and
-   // to the session as well.  Only access it via the servlet context
-   // so we can check whether modifying it causes the session
-   // to be replicated.
-   ServletContext ctx = getServletConfig().getServletContext();
-   Person ben = (Person)ctx.getAttribute("TEST_PERSON");
-   ben.setAge(ben.getAge() + new SecureRandom().nextInt(10));
-%>

Deleted: branches/Branch_4_2/testsuite/src/resources/cluster/http/http-field/setSession.jsp
===================================================================
--- branches/Branch_4_2/testsuite/src/resources/cluster/http/http-field/setSession.jsp	2007-02-02 21:19:02 UTC (rev 60215)
+++ branches/Branch_4_2/testsuite/src/resources/cluster/http/http-field/setSession.jsp	2007-02-02 21:21:43 UTC (rev 60216)
@@ -1,48 +0,0 @@
-<%@page contentType="text/html"
-   import="java.util.*, javax.servlet.ServletContext, org.jboss.test.cluster.web.aop.Person,
-   org.jboss.test.cluster.web.aop.Address"
-%>
-<%@ page import="org.jboss.test.cluster.web.aop.Course"%>
-<%@ page import="org.jboss.test.cluster.web.aop.Student"%>
-
-<html>
-<center>
-<% 
-   String id=request.getSession().getId();
-   session.setAttribute("TEST_ID",id); 
-   Student ben=new Student();
-   Student jane=new Student();
-   Address addr = new Address();
-   addr.setZip(95123);
-   addr.setCity("San Jose");
-   ben.setAge(100);
-   ben.setName("Ben");
-   ben.setAddress(addr);
-   jane.setAge(50);
-   jane.setName("Jane");
-   jane.setAddress(addr);
-
-   Course foo = new Course();
-   foo.setTitle("Intro to Foo");
-   foo.setInstructor("Jones");
-
-   ben.addCourse(foo);
-   jane.addCourse(foo);
-
-   session.setAttribute("TEST_PERSON", ben);
-   session.setAttribute("WIFE", jane);
-
-   Collection col = ben.getCourses();
-   Course first = (Course)col.iterator().next();
-   first.setInstructor("Black");
-
-   // Bind ben to the servlet context as well so it can be
-   // accessed without involving the session
-   ServletContext ctx = getServletConfig().getServletContext();
-   ctx.setAttribute("TEST_PERSON", ben);
-   ctx.setAttribute("WIFE", jane);
-%>
-<%=id%>
-
-<h1><%=application.getServerInfo()%>:<%=request.getServerPort()%></h1>
-</html>




More information about the jboss-cvs-commits mailing list