[jboss-cvs] JBossAS SVN: r73174 - projects/aop/trunk/aop/src/test/org/jboss/test/aop/scope.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu May 8 16:15:16 EDT 2008


Author: flavia.rainone at jboss.com
Date: 2008-05-08 16:15:16 -0400 (Thu, 08 May 2008)
New Revision: 73174

Added:
   projects/aop/trunk/aop/src/test/org/jboss/test/aop/scope/NullAspectFactory.java
   projects/aop/trunk/aop/src/test/org/jboss/test/aop/scope/POJOWithNullAspect.java
Log:
[JBAOP-560] Tests for this feature have been added to scope test suite.

Added: projects/aop/trunk/aop/src/test/org/jboss/test/aop/scope/NullAspectFactory.java
===================================================================
--- projects/aop/trunk/aop/src/test/org/jboss/test/aop/scope/NullAspectFactory.java	                        (rev 0)
+++ projects/aop/trunk/aop/src/test/org/jboss/test/aop/scope/NullAspectFactory.java	2008-05-08 20:15:16 UTC (rev 73174)
@@ -0,0 +1,68 @@
+/*
+ * 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.scope;
+
+import org.jboss.aop.Advisor;
+import org.jboss.aop.InstanceAdvisor;
+import org.jboss.aop.advice.AspectFactory;
+import org.jboss.aop.joinpoint.Joinpoint;
+
+/**
+ * AspectFactory that returns {@code null} instances for all scopes.
+ * 
+ * @author  <a href="flavia.rainone at jboss.com">Flavia Rainone</a>
+ *
+ */
+public class NullAspectFactory implements AspectFactory
+{
+
+   public Object createPerClass(Advisor advisor)
+   {
+      return null;
+   }
+
+   public Object createPerInstance(Advisor advisor, InstanceAdvisor instanceAdvisor)
+   {
+      return null;
+   }
+
+   public Object createPerJoinpoint(Advisor advisor, Joinpoint jp)
+   {
+      return null;
+   }
+
+   public Object createPerJoinpoint(Advisor advisor,
+         InstanceAdvisor instanceAdvisor, Joinpoint jp)
+   {
+      return null;
+   }
+
+   public Object createPerVM()
+   {
+      return null;
+   }
+
+   public String getName()
+   {
+      return null;
+   }
+}
\ No newline at end of file

Added: projects/aop/trunk/aop/src/test/org/jboss/test/aop/scope/POJOWithNullAspect.java
===================================================================
--- projects/aop/trunk/aop/src/test/org/jboss/test/aop/scope/POJOWithNullAspect.java	                        (rev 0)
+++ projects/aop/trunk/aop/src/test/org/jboss/test/aop/scope/POJOWithNullAspect.java	2008-05-08 20:15:16 UTC (rev 73174)
@@ -0,0 +1,39 @@
+/*
+ * 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.scope;
+
+/**
+ * Plain old java object for testing of {@code NullAspectFactory}.
+ * 
+ * @author  <a href="flavia.rainone at jboss.com">Flavia Rainone</a>
+ */
+public class POJOWithNullAspect
+{
+   public int field;
+   public static int staticField;
+   public POJOWithNullAspect() {}
+   public void method() {}
+   public static void staticMethod() {}
+   // method that will be intercepted by both normal factories and
+   // NullAspectFactories
+   public void mixedMethod(){}
+}
\ No newline at end of file




More information about the jboss-cvs-commits mailing list