[jboss-cvs] JBossAS SVN: r57380 - branches/Branch_4_0/testsuite/src/main/org/jboss/test/aop/scoped/ear/servlet

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Oct 3 05:25:44 EDT 2006


Author: kabir.khan at jboss.com
Date: 2006-10-03 05:25:43 -0400 (Tue, 03 Oct 2006)
New Revision: 57380

Modified:
   branches/Branch_4_0/testsuite/src/main/org/jboss/test/aop/scoped/ear/servlet/EarExampleServlet.java
Log:
Fix test so it will also work with the aop 2.0 generated advisors

Modified: branches/Branch_4_0/testsuite/src/main/org/jboss/test/aop/scoped/ear/servlet/EarExampleServlet.java
===================================================================
--- branches/Branch_4_0/testsuite/src/main/org/jboss/test/aop/scoped/ear/servlet/EarExampleServlet.java	2006-10-03 09:23:50 UTC (rev 57379)
+++ branches/Branch_4_0/testsuite/src/main/org/jboss/test/aop/scoped/ear/servlet/EarExampleServlet.java	2006-10-03 09:25:43 UTC (rev 57380)
@@ -68,13 +68,6 @@
          ExampleSessionHome home = (ExampleSessionHome)PortableRemoteObject.narrow(obj, ExampleSessionHome.class);
          ExampleSession exSess = home.create();
          
-         String expected = "scope" + scope;
-         String actual = TestInterceptor.scope;
-         if (!actual.equals(expected))
-         {
-            throw new ServletException("Wrong TestInterceptor.scope, expected=" + expected + "; actual=" + TestInterceptor.scope);
-         }
-         
          TestInterceptor.intercepted = 0;
          exSess.getValue("hello"); 
          if (TestInterceptor.intercepted != 1)
@@ -88,8 +81,15 @@
          {
             throw new ServletException("Wrong TestInterceptor.intercepted for servlet, expected=1; actual=" + TestInterceptor.intercepted);
          }
-//            throw new ServletException("Failed to call OptimizedEJB/Session30 through remote and local interfaces", e);
 
+         //This check must happen after methods calling the interceptor have occured since the interceptor chains are created lazily with generated advisors
+         String expected = "scope" + scope;
+         String actual = TestInterceptor.scope;
+         if (!actual.equals(expected))
+         {
+            throw new ServletException("Wrong TestInterceptor.scope, expected=" + expected + "; actual=" + TestInterceptor.scope);
+         }
+
          response.setContentType("text/html");
          PrintWriter out = response.getWriter();
          out.println("<html>");




More information about the jboss-cvs-commits mailing list