You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by xi...@apache.org on 2010/08/18 04:42:59 UTC

svn commit: r986553 - in /geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test: ./ src/main/java/org/apache/geronimo/testsuite/javaee6/beans/ src/main/java/org/apache/geronimo/testsuite/javaee6/interceptors/ src/main/java/org/apache/g...

Author: xiaming
Date: Wed Aug 18 02:42:58 2010
New Revision: 986553

URL: http://svn.apache.org/viewvc?rev=986553&view=rev
Log:
GERONIMO-5486 update the test case to include complete intercepter annotations, patch provided by LiWenQin

Added:
    geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/beans/IntcptBindingTestBean.java   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/beans/msgBean.java   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/beans/scheduleTask.java   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/interceptors/Hello.java   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/interceptors/HelloInterceptor.java   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/interceptors/TimeoutIntcpt.java   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/servlets/intcptBindingServlet.java   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/servlets/timeoutIntcptServlet.java   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/webapp/WEB-INF/beans.xml   (with props)
Modified:
    geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/pom.xml
    geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/beans/ValueBean.java
    geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/interceptors/ValueIntcpt1.java
    geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/interceptors/ValueIntcpt2.java
    geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/servlets/intcptServlet.java
    geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/webapp/WEB-INF/web.xml
    geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/webapp/index.jsp
    geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/test/java/org/apache/geronimo/testsuite/javaee6/intcptests/InterceptorTest.java

Modified: geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/pom.xml?rev=986553&r1=986552&r2=986553&view=diff
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/pom.xml (original)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/pom.xml Wed Aug 18 02:42:58 2010
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>interceptors1.1-test</artifactId>
-    <name>Geronimo TestSuite :: Java EE 6 Testsuite :: Interceptors 1.1</name>
+    <name>Geronimo TestSuite :: Java EE 6 Testsuite :: Interceptors 1.1 Test</name>
     <packaging>war</packaging>
 
     <dependencies>
@@ -66,7 +66,11 @@
             </property>
         </activation>
     <build>        
-        <plugins>            		
+        <plugins>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>selenium-maven-plugin</artifactId>
+            </plugin>            		
 		    <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-failsafe-plugin</artifactId>

Added: geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/beans/IntcptBindingTestBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/beans/IntcptBindingTestBean.java?rev=986553&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/beans/IntcptBindingTestBean.java (added)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/beans/IntcptBindingTestBean.java Wed Aug 18 02:42:58 2010
@@ -0,0 +1,36 @@
+/**
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+ */
+
+package org.apache.geronimo.testsuite.javaee6.beans;
+
+import javax.ejb.Stateless;
+import javax.ejb.AfterBegin;
+import javax.ejb.EJB;
+
+import org.apache.geronimo.testsuite.javaee6.interceptors.Hello;
+
+@Stateless
+public class IntcptBindingTestBean {
+
+    @EJB
+    private org.apache.geronimo.testsuite.javaee6.beans.msgBean msgb;
+    public String getResult()
+    {
+        return msgb.getOutput();
+    }
+    
+    @Hello public void testInterceptorBinding(){
+    //System.out.println("say");
+    }
+}

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/beans/IntcptBindingTestBean.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/beans/IntcptBindingTestBean.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/beans/IntcptBindingTestBean.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/beans/ValueBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/beans/ValueBean.java?rev=986553&r1=986552&r2=986553&view=diff
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/beans/ValueBean.java (original)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/beans/ValueBean.java Wed Aug 18 02:42:58 2010
@@ -14,17 +14,24 @@
 
 package org.apache.geronimo.testsuite.javaee6.beans;
 
-import javax.ejb.Stateful;
+import javax.ejb.Stateless;
+
 import javax.interceptor.Interceptors;
 import org.apache.geronimo.testsuite.javaee6.interceptors.ValueIntcpt1;
 import org.apache.geronimo.testsuite.javaee6.interceptors.ValueIntcpt2;
 
-@Stateful
+@Stateless
 public class ValueBean {
 
-    @Interceptors({ValueIntcpt1.class, ValueIntcpt2.class})
+    
+    public void SayFound()
+    {
+        //System.out.println("Found.");
+    }
+
+    @Interceptors({ValueIntcpt1.class,ValueIntcpt2.class})
     public String[] SayIsValid(double d,String [] intcptArray ) {
+
         return  intcptArray;
     }
-
 }

Added: geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/beans/msgBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/beans/msgBean.java?rev=986553&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/beans/msgBean.java (added)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/beans/msgBean.java Wed Aug 18 02:42:58 2010
@@ -0,0 +1,36 @@
+/**
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+ */
+
+package org.apache.geronimo.testsuite.javaee6.beans;
+
+import javax.ejb.Singleton;
+
+@Singleton
+public class msgBean {
+    
+    private String msg = new String();
+        public String getOutput(){
+        try{
+            Thread.sleep(3000);//3 seconds
+            }catch(Exception e)
+            {
+            }
+       return msg;
+    }
+
+    public void setOutput(String s){
+        this.msg = s;
+    }
+ 
+}

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/beans/msgBean.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/beans/msgBean.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/beans/msgBean.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/beans/scheduleTask.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/beans/scheduleTask.java?rev=986553&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/beans/scheduleTask.java (added)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/beans/scheduleTask.java Wed Aug 18 02:42:58 2010
@@ -0,0 +1,48 @@
+/**
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+ */
+
+package org.apache.geronimo.testsuite.javaee6.beans;
+
+
+import java.util.Date;
+
+import javax.ejb.EJB;
+import javax.ejb.Schedule;
+import javax.ejb.Stateless;
+
+import javax.interceptor.Interceptors;
+
+import org.apache.geronimo.testsuite.javaee6.interceptors.TimeoutIntcpt;
+
+@Stateless
+
+public class scheduleTask {
+    @EJB
+    private org.apache.geronimo.testsuite.javaee6.beans.msgBean msgb;
+    public String getResult()
+    {
+        return msgb.getOutput();
+    }
+
+    @Interceptors(TimeoutIntcpt.class)
+    @Schedule(second = "*/1", minute = "*", hour = "*") 
+	public void invokeTimeout() {
+
+	}
+
+	}
+	
+
+
+

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/beans/scheduleTask.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/beans/scheduleTask.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/beans/scheduleTask.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/interceptors/Hello.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/interceptors/Hello.java?rev=986553&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/interceptors/Hello.java (added)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/interceptors/Hello.java Wed Aug 18 02:42:58 2010
@@ -0,0 +1,30 @@
+/**
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+ */
+
+package org.apache.geronimo.testsuite.javaee6.interceptors;
+
+import javax.interceptor.InterceptorBinding;
+import java.lang.annotation.Target;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.ElementType;
+
+@Inherited
+@InterceptorBinding
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ElementType.METHOD, ElementType.TYPE})
+public @interface Hello {
+
+}
\ No newline at end of file

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/interceptors/Hello.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/interceptors/Hello.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/interceptors/Hello.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/interceptors/HelloInterceptor.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/interceptors/HelloInterceptor.java?rev=986553&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/interceptors/HelloInterceptor.java (added)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/interceptors/HelloInterceptor.java Wed Aug 18 02:42:58 2010
@@ -0,0 +1,33 @@
+/**
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+ */
+
+package org.apache.geronimo.testsuite.javaee6.interceptors;
+
+import javax.interceptor.Interceptor;
+import javax.interceptor.AroundInvoke;
+import javax.interceptor.InvocationContext;
+import javax.ejb.EJB;
+
+@Hello @Interceptor
+public class HelloInterceptor {
+    @EJB
+    private org.apache.geronimo.testsuite.javaee6.beans.msgBean msgb;
+
+    @AroundInvoke
+    public Object sayHello(InvocationContext ic) throws Exception {
+        msgb.setOutput("invoke @Interceptor, @InterceptorBinding!");
+        //System.out.println("Hello from:" + ic.getMethod().getName());
+        return ic.proceed();
+    }
+}
\ No newline at end of file

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/interceptors/HelloInterceptor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/interceptors/HelloInterceptor.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/interceptors/HelloInterceptor.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/interceptors/TimeoutIntcpt.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/interceptors/TimeoutIntcpt.java?rev=986553&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/interceptors/TimeoutIntcpt.java (added)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/interceptors/TimeoutIntcpt.java Wed Aug 18 02:42:58 2010
@@ -0,0 +1,37 @@
+/**
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+ */
+ 
+package org.apache.geronimo.testsuite.javaee6.interceptors;
+
+import javax.interceptor.AroundTimeout;
+import javax.ejb.EJB;
+import javax.interceptor.InvocationContext;
+
+import javax.interceptor.Interceptor;
+
+
+public class TimeoutIntcpt {
+
+    @EJB
+    private org.apache.geronimo.testsuite.javaee6.beans.msgBean msgb;
+
+    @AroundTimeout
+    public Object InvokeIntcptMethod(InvocationContext ctx)throws Exception{
+            msgb.setOutput("@AroundTimeout invoked!");
+            //System.out.println("in interceptor 3 @AroundTimeout , class obtained is:"+ ctx.getMethod().getName());
+            return ctx.proceed();
+          }
+            
+
+}
\ No newline at end of file

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/interceptors/TimeoutIntcpt.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/interceptors/TimeoutIntcpt.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/interceptors/TimeoutIntcpt.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/interceptors/ValueIntcpt1.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/interceptors/ValueIntcpt1.java?rev=986553&r1=986552&r2=986553&view=diff
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/interceptors/ValueIntcpt1.java (original)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/interceptors/ValueIntcpt1.java Wed Aug 18 02:42:58 2010
@@ -17,7 +17,9 @@ package org.apache.geronimo.testsuite.ja
 import javax.interceptor.AroundInvoke;
 import javax.interceptor.InvocationContext;
 import java.util.Date;
+import javax.interceptor.Interceptor;
 
+//@Value1 @Interceptor
 public class ValueIntcpt1 {
 
     @AroundInvoke
@@ -30,7 +32,7 @@ public class ValueIntcpt1 {
         else
         {
            double dv = Double.valueOf(param[0].toString());
-           //System.out.println("in interceptor 1 ,value obtained is:"+dv);
+           //System.out.println("in interceptor 1 , class obtained is:"+ ctx.getMethod().getName());
            String[] tmp=(String[])param[1];
            if(dv>=0.0)
            {
@@ -52,12 +54,7 @@ public class ValueIntcpt1 {
             }catch(Exception e)
             {
             }
-            long time = System.currentTimeMillis() - start;
-            //System.out.println("time:"+ time + "ms");
           }
             return ctx.proceed();
-
-
-
     }
 }

Modified: geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/interceptors/ValueIntcpt2.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/interceptors/ValueIntcpt2.java?rev=986553&r1=986552&r2=986553&view=diff
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/interceptors/ValueIntcpt2.java (original)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/interceptors/ValueIntcpt2.java Wed Aug 18 02:42:58 2010
@@ -14,6 +14,7 @@
 
 package org.apache.geronimo.testsuite.javaee6.interceptors;
 
+import javax.interceptor.Interceptor;
 import javax.interceptor.AroundInvoke;
 import javax.interceptor.InvocationContext;
 import java.util.Date;
@@ -47,9 +48,7 @@ public class ValueIntcpt2 {
             tmp[5]=Long.toString(tm);
             tmp[4]=new Date(tm).toString();
             param[1]=tmp;
-            long time = System.currentTimeMillis() - start;
-            
-            //System.out.println("time:"+ time + "ms");
+            //System.out.println("in interceptor 2 , class obtained is:"+ ctx.getMethod().getName());
             ctx.setParameters(param);
             }
             return ctx.proceed();

Added: geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/servlets/intcptBindingServlet.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/servlets/intcptBindingServlet.java?rev=986553&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/servlets/intcptBindingServlet.java (added)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/servlets/intcptBindingServlet.java Wed Aug 18 02:42:58 2010
@@ -0,0 +1,64 @@
+/**
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+ */
+
+package org.apache.geronimo.testsuite.javaee6.servlets;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import javax.ejb.EJB;
+
+import org.apache.geronimo.testsuite.javaee6.beans.IntcptBindingTestBean;
+
+public class intcptBindingServlet extends HttpServlet {
+   @EJB
+   private IntcptBindingTestBean itb;
+
+    @Override
+    protected void doGet(HttpServletRequest request, HttpServletResponse response)
+    throws ServletException, IOException {
+        response.setContentType("text/html;charset=UTF-8");
+        PrintWriter out = response.getWriter();
+        try {
+
+            out.println("<html>");
+            out.println("<head>");
+            out.println("<title>Servlet IntcptBindingServlet</title>");
+            out.println("</head>");
+            out.println("<body>");
+            out.println("<h1>Servlet IntcptBindingServlet at " + request.getContextPath () + "</h1>");
+            itb.testInterceptorBinding();
+            String output = itb.getResult();
+            out.println("<p id = \"intcptBind\">"+output+"</p>");
+            out.println("<br/><a href = \"index.jsp\">Return</a>");
+            out.println("</body>");
+            out.println("</html>");
+
+        } finally {
+            out.close();
+        }
+    } 
+
+
+    @Override
+    protected void doPost(HttpServletRequest request, HttpServletResponse response)
+    throws ServletException, IOException {
+        this.doGet(request, response);
+    }
+
+}

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/servlets/intcptBindingServlet.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/servlets/intcptBindingServlet.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/servlets/intcptBindingServlet.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/servlets/intcptServlet.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/servlets/intcptServlet.java?rev=986553&r1=986552&r2=986553&view=diff
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/servlets/intcptServlet.java (original)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/servlets/intcptServlet.java Wed Aug 18 02:42:58 2010
@@ -19,10 +19,6 @@ import javax.servlet.ServletException;
 import javax.servlet.http.HttpServlet;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
-
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-
 import javax.ejb.EJB;
 import org.apache.geronimo.testsuite.javaee6.beans.ValueBean;
 
@@ -41,7 +37,7 @@ public class intcptServlet extends HttpS
 		//try{
                 //  InitialContext ctx = new InitialContext();
                 //  ValueBean valuebean = (ValueBean) ctx.lookup("java:global/interceptor/ValueBean");
-                  
+        //valuebean.SayFound(); 
 		arr=valuebean.SayIsValid(d,arr);
                 //System.out.println("in servlet,arr[0]:"+arr[0]);
                 //System.out.println("in servlet,arr[1]:"+arr[1]);
@@ -49,7 +45,7 @@ public class intcptServlet extends HttpS
                 //System.out.println("in servlet,arr[3]:"+arr[3]);
                 //System.out.println("in servlet,arr[4]:"+arr[4]);
                 //System.out.println("in servlet,arr[5]:"+arr[5]);
-		request.setAttribute("Intcpt1IsValid",arr[0]);
+	request.setAttribute("Intcpt1IsValid",arr[0]);
         request.setAttribute("Intcpt2IsValid",arr[3]);
         request.setAttribute("date1",arr[1]);
         request.setAttribute("date2",arr[4]);

Added: geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/servlets/timeoutIntcptServlet.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/servlets/timeoutIntcptServlet.java?rev=986553&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/servlets/timeoutIntcptServlet.java (added)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/servlets/timeoutIntcptServlet.java Wed Aug 18 02:42:58 2010
@@ -0,0 +1,61 @@
+/**
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+ */
+
+package org.apache.geronimo.testsuite.javaee6.servlets;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import javax.ejb.EJB;
+import org.apache.geronimo.testsuite.javaee6.beans.scheduleTask;
+
+public class timeoutIntcptServlet extends HttpServlet {
+    @EJB scheduleTask st;
+
+    @Override
+    protected void doGet(HttpServletRequest request, HttpServletResponse response)
+    throws ServletException, IOException {
+        response.setContentType("text/html;charset=UTF-8");
+        PrintWriter out = response.getWriter();
+        try {
+           
+            out.println("<html>");
+            out.println("<head>");
+            out.println("<title>Servlet timeoutIntcptServlet</title>");  
+            out.println("</head>");
+            out.println("<body>");
+            out.println("<h1>Servlet timeoutIntcptServlet at " + request.getContextPath () + "</h1>");
+            String output = new String();
+            st.invokeTimeout();
+            output=st.getResult();
+            out.println("<p id = \"outputRes\">"+output+"</p>");
+            out.println("<br/><a href = \"index.jsp\">Return</a>");
+            out.println("</body>");
+            out.println("</html>");
+            
+        } finally { 
+            out.close();
+        }
+    } 
+
+    @Override
+    protected void doPost(HttpServletRequest request, HttpServletResponse response)
+    throws ServletException, IOException {
+        this.doGet(request, response);
+    }
+}

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/servlets/timeoutIntcptServlet.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/servlets/timeoutIntcptServlet.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/java/org/apache/geronimo/testsuite/javaee6/servlets/timeoutIntcptServlet.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/webapp/WEB-INF/beans.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/webapp/WEB-INF/beans.xml?rev=986553&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/webapp/WEB-INF/beans.xml (added)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/webapp/WEB-INF/beans.xml Wed Aug 18 02:42:58 2010
@@ -0,0 +1,26 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<beans
+xmlns="http://java.sun.com/xml/ns/javaee"
+xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+xsi:schemaLocation="
+http://java.sun.com/xml/ns/javaee
+http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
+<interceptors>
+<class>org.apache.geronimo.testsuite.javaee6.interceptors.HelloInterceptor</class>
+</interceptors>
+</beans>
\ No newline at end of file

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/webapp/WEB-INF/beans.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/webapp/WEB-INF/beans.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/webapp/WEB-INF/beans.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/webapp/WEB-INF/web.xml?rev=986553&r1=986552&r2=986553&view=diff
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/webapp/WEB-INF/web.xml (original)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/webapp/WEB-INF/web.xml Wed Aug 18 02:42:58 2010
@@ -17,6 +17,7 @@
 -->
 <web-app id="WebApp_ID" version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
     <display-name>interceptor</display-name>
+
     <welcome-file-list>
         <welcome-file>index.html</welcome-file>
         <welcome-file>index.htm</welcome-file>
@@ -31,8 +32,24 @@
         <servlet-name>intcptServlet</servlet-name>
         <servlet-class>org.apache.geronimo.testsuite.javaee6.servlets.intcptServlet</servlet-class>
     </servlet>
+    <servlet>
+        <servlet-name>timeoutIntcptServlet</servlet-name>
+        <servlet-class>org.apache.geronimo.testsuite.javaee6.servlets.timeoutIntcptServlet</servlet-class>
+    </servlet>
+    <servlet-mapping>
+        <servlet-name>timeoutIntcptServlet</servlet-name>
+        <url-pattern>/timeoutIntcptServlet</url-pattern>
+    </servlet-mapping>
     <servlet-mapping>
         <servlet-name>intcptServlet</servlet-name>
         <url-pattern>/intcptServlet</url-pattern>
     </servlet-mapping>
+        <servlet>
+        <servlet-name>intcptBindingServlet</servlet-name>
+        <servlet-class>org.apache.geronimo.testsuite.javaee6.servlets.intcptBindingServlet</servlet-class>
+    </servlet>
+    <servlet-mapping>
+        <servlet-name>intcptBindingServlet</servlet-name>
+        <url-pattern>/intcptBindingServlet</url-pattern>
+    </servlet-mapping>
 </web-app>

Modified: geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/webapp/index.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/webapp/index.jsp?rev=986553&r1=986552&r2=986553&view=diff
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/webapp/index.jsp (original)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/main/webapp/index.jsp Wed Aug 18 02:42:58 2010
@@ -26,6 +26,7 @@
   </head>
   <body>
     <h2>An Interceptor Sample</h2>
+    <h3>Test Section One</h3>
     <p>
       <%
           String intcpt1 = String.valueOf(request.getAttribute("Intcpt1IsValid"));
@@ -99,9 +100,36 @@
           </tr>
       </table>
     </form>
+
+    <br/>
+    <h3>Test Section Two</h3>
+    <p>Click here to check @AroundTimeout</p>
+    <form action="timeoutIntcptServlet" method="get">
+        <table border="3" cellpadding="1">
+            <tr>
+                <td>
+                <input type="submit" name="checkAroundTimeout" value="check"/>
+                </td>
+            </tr>
+        </table>
+    </form>
+
+    <br/>
+    <h3>Test Section Three</h3>
+    <p>Click here to check @Interceptor, @InterceptorBinding</p>
+    <form action="intcptBindingServlet" method="get">
+                <table border="3" cellpadding="1">
+            <tr>
+                <td>
+                <input type="submit" name="checkIntcptBind" value="check"/>
+                </td>
+            </tr>
+        </table>
+        </form>
+
     <p>
         <br />
-        <b>1.This example checks the input value.</b>
+        <b>1.This example checks the input value in Section One.</b>
         <br/>
         &nbsp&nbsp Interceptor 1 says valid & Interceptor 2 says invalid if the value is greater than or equal zero.
         <br/>
@@ -112,6 +140,11 @@
         &nbsp&nbsp It should firstly invoke Interceptor 1 and Interceptor 2 happens afterwards.
         <br/>
          &nbsp&nbsp You can check the invoking sequence through Time and SystemTimeMillis.
+        <br/>
+        <b>3.This example presents the @AroundTimeout annotation in interceptor-1.1 in Section Two.</b>
+        <br/>
+        <b>4.This example presents the @Interceptor and @InterceptorBinding annotation in interceptor-1.1 in Section Three.</b>
+        <br/>
     </p>
   </body>
 </html> 

Modified: geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/test/java/org/apache/geronimo/testsuite/javaee6/intcptests/InterceptorTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/test/java/org/apache/geronimo/testsuite/javaee6/intcptests/InterceptorTest.java?rev=986553&r1=986552&r2=986553&view=diff
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/test/java/org/apache/geronimo/testsuite/javaee6/intcptests/InterceptorTest.java (original)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/interceptors1.1-test/src/test/java/org/apache/geronimo/testsuite/javaee6/intcptests/InterceptorTest.java Wed Aug 18 02:42:58 2010
@@ -17,15 +17,12 @@ package org.apache.geronimo.testsuite.ja
 import org.apache.geronimo.testsupport.SeleniumTestSupport;
 import org.testng.Assert;
 import org.testng.annotations.*;
-import static org.testng.Assert.*;
-import java.util.regex.Pattern;
+
 
 
 public class InterceptorTest extends SeleniumTestSupport 
 {
-	/**
-	 * Test 1
-	 */
+
 	@Test 
 	public void testInterceptorA() throws Exception 
 	{
@@ -44,10 +41,7 @@ public class InterceptorTest extends Sel
 		
 	}
 	
-	
-	/**
-	 * Test 2
-	 */
+
 	@Test 
 	public void testInterceptorB() throws Exception 
 	{
@@ -65,5 +59,23 @@ public class InterceptorTest extends Sel
 		Assert.assertEquals(true, real);
 		
 	}
+	
+
+	@Test 
+	public void testTimeoutInterceptor() throws Exception {
+		selenium.open("/interceptor/");
+		selenium.click("checkAroundTimeout");
+		selenium.waitForPageToLoad("30000");
+		Assert.assertEquals("@AroundTimeout invoked!", selenium.getText("//*[@id=\"outputRes\"]"));
+	}
+	
+
+	@Test 
+	public void testInterceptorBinding() throws Exception {
+		selenium.open("/interceptor/");
+		selenium.click("checkIntcptBind");		
+		selenium.waitForPageToLoad("30000");
+		Assert.assertEquals("invoke @Interceptor, @InterceptorBinding!", selenium.getText("//*[@id=\"intcptBind\"]"));
+	}
 }