[jboss-cvs] JBossAS SVN: r62592 - in projects/aop/trunk/aop/src: test/org/jboss/test/aop/regression and 1 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Apr 26 14:11:23 EDT 2007


Author: flavia.rainone at jboss.com
Date: 2007-04-26 14:11:23 -0400 (Thu, 26 Apr 2007)
New Revision: 62592

Added:
   projects/aop/trunk/aop/src/test/org/jboss/test/aop/regression/jbaop398/
   projects/aop/trunk/aop/src/test/org/jboss/test/aop/regression/jbaop398/POJO.java
   projects/aop/trunk/aop/src/test/org/jboss/test/aop/regression/jbaop398/SimpleInterceptor.java
   projects/aop/trunk/aop/src/test/org/jboss/test/aop/regression/jbaop398/SimpleTestCase.java
Modified:
   projects/aop/trunk/aop/src/resources/test/regression/jboss-aop.xml
Log:
[JBAOP-398] This test reproduces the error no such field jboss

Modified: projects/aop/trunk/aop/src/resources/test/regression/jboss-aop.xml
===================================================================
--- projects/aop/trunk/aop/src/resources/test/regression/jboss-aop.xml	2007-04-26 16:47:40 UTC (rev 62591)
+++ projects/aop/trunk/aop/src/resources/test/regression/jboss-aop.xml	2007-04-26 18:11:23 UTC (rev 62592)
@@ -165,4 +165,9 @@
    <bind pointcut="call(void org.jboss.test.aop.regression.jbaop336callnpe.Log->overwriteFile(java.lang.String))">
       <interceptor-ref name="org.jboss.test.aop.regression.jbaop336callnpe.LogInterceptor"/>
    </bind>
+   
+   <bind pointcut="all(org.jboss.test.aop.regression.jbaop398.POJO)">
+      <interceptor class="org.jboss.test.aop.regression.jbaop398.SimpleInterceptor"/>
+   </bind>
+   
 </aop>
\ No newline at end of file

Added: projects/aop/trunk/aop/src/test/org/jboss/test/aop/regression/jbaop398/POJO.java
===================================================================
--- projects/aop/trunk/aop/src/test/org/jboss/test/aop/regression/jbaop398/POJO.java	                        (rev 0)
+++ projects/aop/trunk/aop/src/test/org/jboss/test/aop/regression/jbaop398/POJO.java	2007-04-26 18:11:23 UTC (rev 62592)
@@ -0,0 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */ 
+package org.jboss.test.aop.regression.jbaop398;
+
+
+public class POJO
+{
+   private static String org = "Fail";
+   
+   public int method()
+   {
+      return 0;
+   }
+}
\ No newline at end of file

Added: projects/aop/trunk/aop/src/test/org/jboss/test/aop/regression/jbaop398/SimpleInterceptor.java
===================================================================
--- projects/aop/trunk/aop/src/test/org/jboss/test/aop/regression/jbaop398/SimpleInterceptor.java	                        (rev 0)
+++ projects/aop/trunk/aop/src/test/org/jboss/test/aop/regression/jbaop398/SimpleInterceptor.java	2007-04-26 18:11:23 UTC (rev 62592)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */ 
+package org.jboss.test.aop.regression.jbaop398;
+
+import org.jboss.aop.advice.Interceptor;
+import org.jboss.aop.joinpoint.Invocation;
+
+public class SimpleInterceptor implements Interceptor
+{
+   public static boolean intercepted = false;
+   
+   public String getName()
+   {
+      return this.getClass().getName();
+   }
+
+   public Object invoke(Invocation invocation) throws Throwable
+   {
+      intercepted = true;
+      return invocation.invokeNext();
+   }  
+}
\ No newline at end of file

Added: projects/aop/trunk/aop/src/test/org/jboss/test/aop/regression/jbaop398/SimpleTestCase.java
===================================================================
--- projects/aop/trunk/aop/src/test/org/jboss/test/aop/regression/jbaop398/SimpleTestCase.java	                        (rev 0)
+++ projects/aop/trunk/aop/src/test/org/jboss/test/aop/regression/jbaop398/SimpleTestCase.java	2007-04-26 18:11:23 UTC (rev 62592)
@@ -0,0 +1,57 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */ 
+package org.jboss.test.aop.regression.jbaop398;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import junit.textui.TestRunner;
+
+import org.jboss.test.aop.AOPTestWithSetup;
+
+public class SimpleTestCase extends AOPTestWithSetup
+{
+   public static void main(String[] args)
+   {
+      TestRunner.run(suite());
+   }
+
+   public static Test suite()
+   {
+      TestSuite suite = new TestSuite("SimpleTestCase");
+      suite.addTestSuite(SimpleTestCase.class);
+      return suite;
+   }
+
+   public SimpleTestCase(String name)
+   {
+      super(name);
+   }
+
+   public void test()
+   {
+      POJO pojo = new POJO();
+      assertTrue(SimpleInterceptor.intercepted);
+      SimpleInterceptor.intercepted = false;
+      pojo.method();
+      assertTrue(SimpleInterceptor.intercepted);
+   }
+}
\ No newline at end of file




More information about the jboss-cvs-commits mailing list