You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by ca...@apache.org on 2004/07/08 13:27:58 UTC
cvs commit: maven-plugins/aspectj/src/plugin-test maven.xml
carlos 2004/07/08 04:27:58
Modified: aspectj/src/plugin-test/src/aspect/org/apache/maven/aspectj
Sample.aj
aspectj/src/plugin-test/src/test/org/apache/maven/aspectj
AspectTest.java
aspectj/src/plugin-test maven.xml
Log:
Added test for aspectj:test-compile
Revision Changes Path
1.2 +9 -2 maven-plugins/aspectj/src/plugin-test/src/aspect/org/apache/maven/aspectj/Sample.aj
Index: Sample.aj
===================================================================
RCS file: /home/cvs/maven-plugins/aspectj/src/plugin-test/src/aspect/org/apache/maven/aspectj/Sample.aj,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Sample.aj 7 May 2004 23:09:22 -0000 1.1
+++ Sample.aj 8 Jul 2004 11:27:58 -0000 1.2
@@ -19,11 +19,18 @@
public aspect Sample
{
- pointcut testPointcut() :
+ pointcut srcPointcut() :
execution(public * org.apache.maven.aspectj.Dummy.someMethod());
+ pointcut testPointcut() :
+ execution(public * org.apache.maven.aspectj.AspectTest.someMethod());
+
+ before() : srcPointcut()
+ {
+ throw new RuntimeException("test exception voluntarily raised and that should be caught in the test case");
+ }
before() : testPointcut()
{
- throw new RuntimeException("test exception voluntarily raised and that should caught in the test case");
+ throw new RuntimeException("test exception voluntarily raised and that should be caught in the test case");
}
}
1.2 +22 -3 maven-plugins/aspectj/src/plugin-test/src/test/org/apache/maven/aspectj/AspectTest.java
Index: AspectTest.java
===================================================================
RCS file: /home/cvs/maven-plugins/aspectj/src/plugin-test/src/test/org/apache/maven/aspectj/AspectTest.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- AspectTest.java 7 May 2004 23:09:22 -0000 1.1
+++ AspectTest.java 8 Jul 2004 11:27:58 -0000 1.2
@@ -20,7 +20,11 @@
public class AspectTest extends TestCase
{
- public void testAspectIsCorrectlyWeaved()
+
+ private static final String EXCEPTION_MESSAGE = "test exception " +
+ "voluntarily raised and that should be caught in the test case";
+
+ public void testSourceIsCorrectlyWeaved()
{
Dummy dummy = new Dummy();
try
@@ -29,8 +33,23 @@
fail("The Aspect should have thrown an exception");
} catch (Exception expected)
{
- assertEquals("test exception voluntarily raised and that should "
- + "caught in the test case", expected.getMessage());
+ assertEquals(EXCEPTION_MESSAGE, expected.getMessage());
}
+ }
+
+ public void testTestIsCorrectlyWeaved()
+ {
+ try
+ {
+ this.someMethod();
+ fail("The Aspect should have thrown an exception");
+ } catch (Exception expected)
+ {
+ assertEquals(EXCEPTION_MESSAGE, expected.getMessage());
+ }
+ }
+
+ public void someMethod()
+ {
}
}
1.2 +5 -2 maven-plugins/aspectj/src/plugin-test/maven.xml
Index: maven.xml
===================================================================
RCS file: /home/cvs/maven-plugins/aspectj/src/plugin-test/maven.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- maven.xml 7 May 2004 23:09:22 -0000 1.1
+++ maven.xml 8 Jul 2004 11:27:58 -0000 1.2
@@ -17,10 +17,13 @@
-->
<project xmlns:util="jelly:util" xmlns:j="jelly:core">
- <goal name="testPlugin" prereqs="clean,test-aspectj-weave">
+ <goal name="testPlugin" prereqs="clean,test-aspectj-compile">
</goal>
- <goal name="test-aspectj-weave" prereqs="java:compile,aspectj:compile,test:test">
+ <goal name="test-aspectj-compile">
+ <attainGoal name="aspectj:test-compile"/>
+ <attainGoal name="test:test"/>
+ <attainGoal name="clean"/>
</goal>
</project>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org