[jboss-cvs] JBossAS SVN: r59943 - in projects/aop/trunk/aop: src/test/org/jboss/test/aop/pointcut and 1 other directory.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Jan 23 11:21:24 EST 2007
Author: kabir.khan at jboss.com
Date: 2007-01-23 11:21:23 -0500 (Tue, 23 Jan 2007)
New Revision: 59943
Added:
projects/aop/trunk/aop/src/test/org/jboss/test/aop/pointcut/PointcutTestCase.java
Removed:
projects/aop/trunk/aop/src/test/org/jboss/test/aop/pointcut/PointcutTester.java
Modified:
projects/aop/trunk/aop/build-tests-jdk14.xml
projects/aop/trunk/aop/build-tests-jdk50.xml
Log:
Rename PointcutTester -> PointcutTestCase and add to build script
Modified: projects/aop/trunk/aop/build-tests-jdk14.xml
===================================================================
--- projects/aop/trunk/aop/build-tests-jdk14.xml 2007-01-23 15:52:26 UTC (rev 59942)
+++ projects/aop/trunk/aop/build-tests-jdk14.xml 2007-01-23 16:21:23 UTC (rev 59943)
@@ -706,10 +706,23 @@
<include name="org/jboss/test/aop/proxy/ProxyTestCase.class"/>
<include name="org/jboss/test/aop/methodhashing/MethodHashingTestCase.class"/>
<include name="org/jboss/test/aop/annotationc/AnnotationTester.class"/>
+ <include name="org/jboss/test/aop/pointcut/PointcutTestCase.class"/>
</fileset>
</batchtest>
-
</junit>
+ <junit printsummary="yes" fork="yes" haltonfailure="no">
+ <sysproperty key="jboss.aop.path" value="${source.res}/test/container/jboss-aop.xml"/>
+ <classpath>
+ <path refid="test.classpath"/>
+ <path refid="aopc.classpath"/>
+ <pathelement location="${build.tests.retro}"/>
+ <pathelement location="docs"/>
+ </classpath>
+ <sysproperty key="jboss-junit-configuration" value="jdk14"/>
+ <formatter type="plain" extension="-jdk14.txt"/>
+ <formatter classname="org.jboss.ant.taskdefs.XMLJUnitMultipleResultFormatter" extension="-jdk14.xml"/>
+ <test todir="${build.reports}" name="org.jboss.test.aop.container.ContainerTestCase"/>
+ </junit>
</target>
<target name="system-classloader-test" depends="compile-test-classes">
Modified: projects/aop/trunk/aop/build-tests-jdk50.xml
===================================================================
--- projects/aop/trunk/aop/build-tests-jdk50.xml 2007-01-23 15:52:26 UTC (rev 59942)
+++ projects/aop/trunk/aop/build-tests-jdk50.xml 2007-01-23 16:21:23 UTC (rev 59943)
@@ -673,7 +673,6 @@
<junit printsummary="yes" fork="no" haltonfailure="no" >
<sysproperty key="jboss.aop.debug.classes" value="false"/>
- <sysproperty key="jboss.aop.path" value="${source.res}/test/container/jboss-aop.xml"/>
<classpath>
<path refid="javac.classpath"/>
<pathelement location="${build.tests.classes}"/>
@@ -692,6 +691,7 @@
<include name="org/jboss/test/aop/methodhashing/MethodHashingTestCase.class"/>
<include name="org/jboss/test/aop/annotationc/AnnotationTester.class"/>
<include name="org/jboss/test/aop/bridgemethodnotwoven/BridgeMethodTestCase.class"/>
+ <include name="org/jboss/test/aop/pointcut/PointcutTestCase.class"/>
</fileset>
</batchtest>
</junit>
Added: projects/aop/trunk/aop/src/test/org/jboss/test/aop/pointcut/PointcutTestCase.java
===================================================================
--- projects/aop/trunk/aop/src/test/org/jboss/test/aop/pointcut/PointcutTestCase.java (rev 0)
+++ projects/aop/trunk/aop/src/test/org/jboss/test/aop/pointcut/PointcutTestCase.java 2007-01-23 16:21:23 UTC (rev 59943)
@@ -0,0 +1,133 @@
+/*
+ * 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.pointcut;
+
+
+import java.io.StringReader;
+import java.util.ArrayList;
+import java.util.Iterator;
+
+import org.jboss.aop.pointcut.ast.ASTStart;
+import org.jboss.aop.pointcut.ast.PointcutExpressionParser;
+import org.jboss.aop.pointcut.ast.PointcutExpressionParserVisitor;
+import org.jboss.test.aop.AOPTestWithSetup;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * Tests an annotated introduction
+ *
+ * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
+ * @version $Revision: 45977 $
+ */
+public class PointcutTestCase extends AOPTestWithSetup
+{
+ public static Test suite()
+ {
+ TestSuite suite = new TestSuite("PointcutTestCase");
+ suite.addTestSuite(PointcutTestCase.class);
+ return suite;
+ }
+
+ public PointcutTestCase(String name)
+ {
+ super(name);
+ }
+
+ public void testPassingPointcuts() throws Exception
+ {
+ Executor e = new Executor();
+ e.parseGoodPointcut("execution(public * *->*())");
+ e.parseGoodPointcut("execution(* *->*())");
+ e.parseGoodPointcut("execution(* $instanceof{a}->$implements{a}())");
+ e.parseGoodPointcut("execution(* $instanceof{a.b}->$implements{a.b}())");
+ e.parseGoodPointcut("execution(* $instanceof{@a.b}->$implements{@a.b}())");
+ e.parseGoodPointcut("execution(* $instanceof{a}->$implementing{a}())");
+ e.parseGoodPointcut("execution(* $instanceof{a.b}->$implementing{a.b}())");
+ e.parseGoodPointcut("execution(* $instanceof{@a.b}->$implementing{@a.b}())");
+ checkFailures(e.failures);
+ }
+
+ public void testBadPointcuts() throws Exception
+ {
+ Executor e = new Executor();
+ e.parseBadPointcut("execution(*->*()");
+ checkFailures(e.failures);
+ }
+
+ private void checkFailures(ArrayList failures)
+ {
+ StringBuffer buf = new StringBuffer();
+ if (failures.size() > 0)
+ {
+ buf.append("======= Did not pass validation ===========\n\n");
+ for (Iterator it = failures.iterator() ; it.hasNext() ; )
+ {
+ buf.append((String)it.next());
+ buf.append("\n");
+ }
+
+ fail(buf.toString());
+ }
+ }
+
+ private static class Executor
+ {
+ ArrayList failures = new ArrayList();
+
+ private void parseGoodPointcut(String pointcut) throws Exception
+ {
+ parsePointcut(pointcut, false);
+ }
+
+ private void parseBadPointcut(String pointcut) throws Exception
+ {
+ parsePointcut(pointcut, true);
+ }
+
+ private void parsePointcut(String pointcut, boolean expectFailure) throws Exception
+ {
+ StringReader reader = new StringReader(pointcut);
+ PointcutExpressionParser t = new PointcutExpressionParser(reader);
+
+ try
+ {
+ ASTStart n = t.Start();
+ PointcutExpressionParserVisitor v = new EmptyPointcutVisitor();
+ n.jjtAccept(v, null);
+ if (expectFailure)
+ {
+ failures.add("- Should not have passed: " + pointcut);
+ }
+ }
+ catch (Exception e)
+ {
+ if (!expectFailure)
+ {
+ failures.add("+ Should have passed: " + pointcut);
+ }
+ }
+ }
+ }
+}
+
Deleted: projects/aop/trunk/aop/src/test/org/jboss/test/aop/pointcut/PointcutTester.java
===================================================================
--- projects/aop/trunk/aop/src/test/org/jboss/test/aop/pointcut/PointcutTester.java 2007-01-23 15:52:26 UTC (rev 59942)
+++ projects/aop/trunk/aop/src/test/org/jboss/test/aop/pointcut/PointcutTester.java 2007-01-23 16:21:23 UTC (rev 59943)
@@ -1,133 +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.pointcut;
-
-
-import java.io.StringReader;
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import org.jboss.aop.pointcut.ast.ASTStart;
-import org.jboss.aop.pointcut.ast.PointcutExpressionParser;
-import org.jboss.aop.pointcut.ast.PointcutExpressionParserVisitor;
-import org.jboss.test.aop.AOPTestWithSetup;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * Tests an annotated introduction
- *
- * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
- * @version $Revision: 45977 $
- */
-public class PointcutTester extends AOPTestWithSetup
-{
- public static Test suite()
- {
- TestSuite suite = new TestSuite("PointcutTester");
- suite.addTestSuite(PointcutTester.class);
- return suite;
- }
-
- public PointcutTester(String name)
- {
- super(name);
- }
-
- public void testPassingPointcuts() throws Exception
- {
- Executor e = new Executor();
- e.parseGoodPointcut("execution(public * *->*())");
- e.parseGoodPointcut("execution(* *->*())");
- e.parseGoodPointcut("execution(* $instanceof{a}->$implements{a}())");
- e.parseGoodPointcut("execution(* $instanceof{a.b}->$implements{a.b}())");
- e.parseGoodPointcut("execution(* $instanceof{@a.b}->$implements{@a.b}())");
- e.parseGoodPointcut("execution(* $instanceof{a}->$implementing{a}())");
- e.parseGoodPointcut("execution(* $instanceof{a.b}->$implementing{a.b}())");
- e.parseGoodPointcut("execution(* $instanceof{@a.b}->$implementing{@a.b}())");
- checkFailures(e.failures);
- }
-
- public void testBadPointcuts() throws Exception
- {
- Executor e = new Executor();
- e.parseBadPointcut("execution(*->*()");
- checkFailures(e.failures);
- }
-
- private void checkFailures(ArrayList failures)
- {
- StringBuffer buf = new StringBuffer();
- if (failures.size() > 0)
- {
- buf.append("======= Did not pass validation ===========\n\n");
- for (Iterator it = failures.iterator() ; it.hasNext() ; )
- {
- buf.append((String)it.next());
- buf.append("\n");
- }
-
- fail(buf.toString());
- }
- }
-
- private static class Executor
- {
- ArrayList failures = new ArrayList();
-
- private void parseGoodPointcut(String pointcut) throws Exception
- {
- parsePointcut(pointcut, false);
- }
-
- private void parseBadPointcut(String pointcut) throws Exception
- {
- parsePointcut(pointcut, true);
- }
-
- private void parsePointcut(String pointcut, boolean expectFailure) throws Exception
- {
- StringReader reader = new StringReader(pointcut);
- PointcutExpressionParser t = new PointcutExpressionParser(reader);
-
- try
- {
- ASTStart n = t.Start();
- PointcutExpressionParserVisitor v = new EmptyPointcutVisitor();
- n.jjtAccept(v, null);
- if (expectFailure)
- {
- failures.add("- Should not have passed: " + pointcut);
- }
- }
- catch (Exception e)
- {
- if (!expectFailure)
- {
- failures.add("+ Should have passed: " + pointcut);
- }
- }
- }
- }
-}
-
More information about the jboss-cvs-commits
mailing list