[Jboss-cvs] JBossAS SVN: r56793 - in trunk/aop: . src/resources/test src/resources/test/field src/resources/test/jdk15 src/test/org/jboss/test/aop src/test/org/jboss/test/aop/field src/test/org/jboss/test/aop/jdk15/annotated
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Sep 13 07:26:02 EDT 2006
Author: stalep
Date: 2006-09-13 07:25:56 -0400 (Wed, 13 Sep 2006)
New Revision: 56793
Added:
trunk/aop/src/resources/test/field/
trunk/aop/src/resources/test/field/jboss-aop.xml
trunk/aop/src/test/org/jboss/test/aop/field/
trunk/aop/src/test/org/jboss/test/aop/field/AnnotatedFieldTestCase.java
trunk/aop/src/test/org/jboss/test/aop/field/POJO.java
trunk/aop/src/test/org/jboss/test/aop/field/SubPOJO.java
trunk/aop/src/test/org/jboss/test/aop/field/TraceInterceptor.java
Removed:
trunk/aop/src/resources/test/jdk15/annotated/
trunk/aop/src/test/org/jboss/test/aop/field/AnnotatedFieldTestCase.java
trunk/aop/src/test/org/jboss/test/aop/field/POJO.java
trunk/aop/src/test/org/jboss/test/aop/field/SubPOJO.java
trunk/aop/src/test/org/jboss/test/aop/field/Trace.java
trunk/aop/src/test/org/jboss/test/aop/field/TraceInterceptor.java
trunk/aop/src/test/org/jboss/test/aop/jdk15/annotated/field/
Modified:
trunk/aop/build.xml
Log:
JBAOP-284
moved test
Modified: trunk/aop/build.xml
===================================================================
--- trunk/aop/build.xml 2006-09-13 11:05:51 UTC (rev 56792)
+++ trunk/aop/build.xml 2006-09-13 11:25:56 UTC (rev 56793)
@@ -773,6 +773,9 @@
<antcall target="_run-bootclasspath-test" inheritRefs="true">
<param name="test" value="callerargs"/>
</antcall>
+ <antcall target="_run-bootclasspath-test" inheritRefs="true">
+ <param name="test" value="field"/>
+ </antcall>
<!-- Tests with special requirements for parameters -->
<antcall target="_run-bootclasspath-test" inheritRefs="true">
@@ -1048,6 +1051,9 @@
<antcall target="_run-precompiled-test" inheritRefs="true">
<param name="test" value="callerargs"/>
</antcall>
+ <antcall target="_run-precompiled-test" inheritRefs="true">
+ <param name="test" value="field"/>
+ </antcall>
<!-- Tests with special requirements for parameters -->
<antcall target="_run-precompiled-test" inheritRefs="true">
@@ -1433,25 +1439,6 @@
<formatter usefile="true" type="xml" extension="-jdk15-loadtime-tests.xml"/>
<test todir="${report.dir}" name="org.jboss.test.aop.jdk15.dynamic.prepareFieldSet.HotSwapDisabledTester" />
</junit>
- <junit printsummary="yes" fork="yes" haltonfailure="no">
- <sysproperty key="jboss.aop.class.path" value="${build.tests.classes}"/>
- <sysproperty key="jboss.aop.path" value="${source.res}/test/jdk15/annotated/field/jboss-aop.xml"/>
- <sysproperty key="jboss.aop.debug.classes" value="false"/>
- <sysproperty key="jboss.aop.verbose" value="true"/>
- <!--
- <sysproperty key="jboss.aop.instrumentor" value="org.jboss.aop.instrument.GeneratedAdvisorInstrumentor"/>
- -->
- <sysproperty key="jboss.aop.instrumentor" value="org.jboss.aop.instrument.ClassicInstrumentor"/>
- <jvmarg value="-javaagent:${build.lib}/jboss-aop-jdk50.jar"/>
- <classpath>
- <path refid="test15.classpath"/>
- <pathelement location="${build.tests.classes}"/>
- <pathelement location="docs"/>
- </classpath>
- <formatter usefile="true" type="plain" extension="-jdk15-loadtime-tests.txt"/>
- <formatter usefile="true" type="xml" extension="-jdk15-loadtime-tests.xml"/>
- <test todir="${report.dir}" name="org.jboss.test.aop.jdk15.annotated.field.AnnotatedFieldTestCase" />
- </junit>
</target>
<!--
@@ -1471,15 +1458,15 @@
<classpath refid="aop.task.classpath"/>
<classpath path="${build.tests.classes}"/>
<src path="${build.tests.classes}"/>
- <include name="org/jboss/test/aop/jdk15/annotated/field/*"/>
- <aoppath path="${source.res}/test/jdk15/annotated/field/jboss-aop.xml"/>
+ <include name="org/jboss/test/aop/field/*"/>
+ <aoppath path="${source.res}/test/field/jboss-aop.xml"/>
<aopclasspath path="${build.tests.classes}"/>
</aopc>
<property name="report.dir" value="${build.reports}"/>
<mkdir dir="${report.dir}"/>
<junit printsummary="yes" fork="yes" haltonfailure="no">
<sysproperty key="jboss.aop.class.path" value="${build.tests.classes}"/>
- <sysproperty key="jboss.aop.path" value="${source.res}/test/jdk15/annotated/field/jboss-aop.xml"/>
+ <sysproperty key="jboss.aop.path" value="${source.res}/test/field/jboss-aop.xml"/>
<sysproperty key="jboss.aop.debug.classes" value="false"/>
<sysproperty key="jboss.aop.verbose" value="true"/>
<!--
@@ -1494,7 +1481,7 @@
</classpath>
<formatter usefile="true" type="plain" extension="-jdk15-loadtime-tests.txt"/>
<formatter usefile="true" type="xml" extension="-jdk15-loadtime-tests.xml"/>
- <test todir="${report.dir}" name="org.jboss.test.aop.jdk15.annotated.field.AnnotatedFieldTestCase" />
+ <test todir="${report.dir}" name="org.jboss.test.aop.field.AnnotatedFieldTestCase" />
</junit>
</target>
Added: trunk/aop/src/resources/test/field/jboss-aop.xml
===================================================================
--- trunk/aop/src/resources/test/field/jboss-aop.xml 2006-09-13 11:05:51 UTC (rev 56792)
+++ trunk/aop/src/resources/test/field/jboss-aop.xml 2006-09-13 11:25:56 UTC (rev 56793)
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<aop>
+ <bind pointcut="field(* org.jboss.test.aop.field.POJO->field)">
+ <interceptor class="org.jboss.test.aop.field.TraceInterceptor"/>
+ </bind>
+</aop>
\ No newline at end of file
Copied: trunk/aop/src/test/org/jboss/test/aop/field (from rev 56791, trunk/aop/src/test/org/jboss/test/aop/jdk15/annotated/field)
Deleted: trunk/aop/src/test/org/jboss/test/aop/field/AnnotatedFieldTestCase.java
===================================================================
--- trunk/aop/src/test/org/jboss/test/aop/jdk15/annotated/field/AnnotatedFieldTestCase.java 2006-09-13 10:15:54 UTC (rev 56791)
+++ trunk/aop/src/test/org/jboss/test/aop/field/AnnotatedFieldTestCase.java 2006-09-13 11:25:56 UTC (rev 56793)
@@ -1,67 +0,0 @@
-/*
- * 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.jdk15.annotated.field;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import junit.textui.TestRunner;
-
-import org.jboss.test.aop.AOPTestWithSetup;
-
-/**
- *
- * @author <a href="mailto:stalep at conduct.no">Stale W. Pedersen</a>
- * @version $Revision
- */
-public class AnnotatedFieldTestCase extends AOPTestWithSetup
-{
-
- public static void main(String[] args)
- {
- TestRunner.run(suite());
- }
-
- public static Test suite()
- {
- TestSuite suite = new TestSuite("AnnotatedFieldTestCase");
- suite.addTestSuite(AnnotatedFieldTestCase.class);
- return suite;
- }
-
- public AnnotatedFieldTestCase(String name)
- {
- super(name);
- }
-
- protected void setUp() throws Exception
- {
- super.setUp();
- }
-
- public void testAnnotatedField()
- {
- System.out.println("*** testAnnotatedField");
- SubPOJO spojo = new SubPOJO(4);
- assertEquals("Field is not set correctly", spojo.getPOJOField(), (spojo.getSubPOJOField()/2));
- }
-
-}
Copied: trunk/aop/src/test/org/jboss/test/aop/field/AnnotatedFieldTestCase.java (from rev 56792, trunk/aop/src/test/org/jboss/test/aop/jdk15/annotated/field/AnnotatedFieldTestCase.java)
===================================================================
--- trunk/aop/src/test/org/jboss/test/aop/jdk15/annotated/field/AnnotatedFieldTestCase.java 2006-09-13 11:05:51 UTC (rev 56792)
+++ trunk/aop/src/test/org/jboss/test/aop/field/AnnotatedFieldTestCase.java 2006-09-13 11:25:56 UTC (rev 56793)
@@ -0,0 +1,67 @@
+/*
+ * 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.field;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import junit.textui.TestRunner;
+
+import org.jboss.test.aop.AOPTestWithSetup;
+
+/**
+ *
+ * @author <a href="mailto:stalep at conduct.no">Stale W. Pedersen</a>
+ * @version $Revision
+ */
+public class AnnotatedFieldTestCase extends AOPTestWithSetup
+{
+
+ public static void main(String[] args)
+ {
+ TestRunner.run(suite());
+ }
+
+ public static Test suite()
+ {
+ TestSuite suite = new TestSuite("FieldTestCase");
+ suite.addTestSuite(AnnotatedFieldTestCase.class);
+ return suite;
+ }
+
+ public AnnotatedFieldTestCase(String name)
+ {
+ super(name);
+ }
+
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+ }
+
+ public void testField()
+ {
+ System.out.println("*** testField");
+ SubPOJO spojo = new SubPOJO(4);
+ assertEquals("Field is not set correctly", spojo.getPOJOField(), (spojo.getSubPOJOField()/2));
+ }
+
+}
Deleted: trunk/aop/src/test/org/jboss/test/aop/field/POJO.java
===================================================================
--- trunk/aop/src/test/org/jboss/test/aop/jdk15/annotated/field/POJO.java 2006-09-13 10:15:54 UTC (rev 56791)
+++ trunk/aop/src/test/org/jboss/test/aop/field/POJO.java 2006-09-13 11:25:56 UTC (rev 56793)
@@ -1,45 +0,0 @@
-/*
- * 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.jdk15.annotated.field;
-
-/**
-*
-* @author <a href="mailto:stalep at conduct.no">Stale W. Pedersen</a>
-* @version $Revision
-*/
-public class POJO
-{
- @Trace int field;
-
- public POJO() {}
-
- public POJO(int i)
- {
- field = i;
- }
-
- public int getPOJOField()
- {
- return field;
- }
-
-}
Copied: trunk/aop/src/test/org/jboss/test/aop/field/POJO.java (from rev 56792, trunk/aop/src/test/org/jboss/test/aop/jdk15/annotated/field/POJO.java)
===================================================================
--- trunk/aop/src/test/org/jboss/test/aop/jdk15/annotated/field/POJO.java 2006-09-13 11:05:51 UTC (rev 56792)
+++ trunk/aop/src/test/org/jboss/test/aop/field/POJO.java 2006-09-13 11:25:56 UTC (rev 56793)
@@ -0,0 +1,45 @@
+/*
+ * 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.field;
+
+/**
+*
+* @author <a href="mailto:stalep at conduct.no">Stale W. Pedersen</a>
+* @version $Revision
+*/
+public class POJO
+{
+ int field;
+
+ public POJO() {}
+
+ public POJO(int i)
+ {
+ field = i;
+ }
+
+ public int getPOJOField()
+ {
+ return field;
+ }
+
+}
Deleted: trunk/aop/src/test/org/jboss/test/aop/field/SubPOJO.java
===================================================================
--- trunk/aop/src/test/org/jboss/test/aop/jdk15/annotated/field/SubPOJO.java 2006-09-13 10:15:54 UTC (rev 56791)
+++ trunk/aop/src/test/org/jboss/test/aop/field/SubPOJO.java 2006-09-13 11:25:56 UTC (rev 56793)
@@ -1,46 +0,0 @@
-/*
- * 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.jdk15.annotated.field;
-
-/**
- *
- * @author <a href="mailto:stalep at conduct.no">Stale W. Pedersen</a>
- * @version $Revision
- */
-public class SubPOJO extends POJO
-{
- private int field;
- public SubPOJO() { }
-
- public SubPOJO(int i)
- {
- super(i/2);
- field = i;
- }
-
- public int getSubPOJOField()
- {
- return field;
- }
-
-
-}
Copied: trunk/aop/src/test/org/jboss/test/aop/field/SubPOJO.java (from rev 56792, trunk/aop/src/test/org/jboss/test/aop/jdk15/annotated/field/SubPOJO.java)
===================================================================
--- trunk/aop/src/test/org/jboss/test/aop/jdk15/annotated/field/SubPOJO.java 2006-09-13 11:05:51 UTC (rev 56792)
+++ trunk/aop/src/test/org/jboss/test/aop/field/SubPOJO.java 2006-09-13 11:25:56 UTC (rev 56793)
@@ -0,0 +1,46 @@
+/*
+ * 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.field;
+
+/**
+ *
+ * @author <a href="mailto:stalep at conduct.no">Stale W. Pedersen</a>
+ * @version $Revision
+ */
+public class SubPOJO extends POJO
+{
+ private int field;
+ public SubPOJO() { }
+
+ public SubPOJO(int i)
+ {
+ super(i/2);
+ field = i;
+ }
+
+ public int getSubPOJOField()
+ {
+ return field;
+ }
+
+
+}
Deleted: trunk/aop/src/test/org/jboss/test/aop/field/Trace.java
===================================================================
--- trunk/aop/src/test/org/jboss/test/aop/jdk15/annotated/field/Trace.java 2006-09-13 10:15:54 UTC (rev 56791)
+++ trunk/aop/src/test/org/jboss/test/aop/field/Trace.java 2006-09-13 11:25:56 UTC (rev 56793)
@@ -1,32 +0,0 @@
-/*
- * 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.jdk15.annotated.field;
-
-/**
- *
- * @author <a href="mailto:stalep at conduct.no">Stale W. Pedersen</a>
- * @version $Revision
- */
-public @interface Trace
-{
-
-}
Deleted: trunk/aop/src/test/org/jboss/test/aop/field/TraceInterceptor.java
===================================================================
--- trunk/aop/src/test/org/jboss/test/aop/jdk15/annotated/field/TraceInterceptor.java 2006-09-13 10:15:54 UTC (rev 56791)
+++ trunk/aop/src/test/org/jboss/test/aop/field/TraceInterceptor.java 2006-09-13 11:25:56 UTC (rev 56793)
@@ -1,60 +0,0 @@
-/*
- * 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.jdk15.annotated.field;
-
-import org.jboss.aop.advice.Interceptor;
-import org.jboss.aop.joinpoint.FieldReadInvocation;
-import org.jboss.aop.joinpoint.Invocation;
-
-/**
- *
- * @author <a href="mailto:stalep at conduct.no">Stale W. Pedersen</a>
- * @version $Revision
- */
-public class TraceInterceptor implements Interceptor
-{
-
- public String getName()
- {
- return "TraceInterceptor";
- }
-
- public Object invoke(Invocation invocation) throws Throwable
- {
- String msg = null;
- if (invocation instanceof FieldReadInvocation)
- {
- msg = "read field name: " + ((FieldReadInvocation)invocation).getField();
- }
-
- try
- {
- System.out.println("<<< Trace : " + msg);
- return invocation.invokeNext();
- }
- finally
- {
- System.out.println(">>> Leaving Trace");
- }
- }
-
-}
Copied: trunk/aop/src/test/org/jboss/test/aop/field/TraceInterceptor.java (from rev 56792, trunk/aop/src/test/org/jboss/test/aop/jdk15/annotated/field/TraceInterceptor.java)
===================================================================
--- trunk/aop/src/test/org/jboss/test/aop/jdk15/annotated/field/TraceInterceptor.java 2006-09-13 11:05:51 UTC (rev 56792)
+++ trunk/aop/src/test/org/jboss/test/aop/field/TraceInterceptor.java 2006-09-13 11:25:56 UTC (rev 56793)
@@ -0,0 +1,60 @@
+/*
+ * 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.field;
+
+import org.jboss.aop.advice.Interceptor;
+import org.jboss.aop.joinpoint.FieldReadInvocation;
+import org.jboss.aop.joinpoint.Invocation;
+
+/**
+ *
+ * @author <a href="mailto:stalep at conduct.no">Stale W. Pedersen</a>
+ * @version $Revision
+ */
+public class TraceInterceptor implements Interceptor
+{
+
+ public String getName()
+ {
+ return "TraceInterceptor";
+ }
+
+ public Object invoke(Invocation invocation) throws Throwable
+ {
+ String msg = null;
+ if (invocation instanceof FieldReadInvocation)
+ {
+ msg = "read field name: " + ((FieldReadInvocation)invocation).getField();
+ }
+
+ try
+ {
+ System.out.println("<<< Trace : " + msg);
+ return invocation.invokeNext();
+ }
+ finally
+ {
+ System.out.println(">>> Leaving Trace");
+ }
+ }
+
+}
More information about the jboss-cvs-commits
mailing list