You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cactus-dev@jakarta.apache.org by cm...@apache.org on 2003/05/14 00:14:41 UTC
cvs commit: jakarta-cactus/integration/ant/src/test-input/org/apache/cactus/integration/ant test-cactus.xml
cmlenz 2003/05/13 15:14:41
Modified: integration/ant/src/test/org/apache/cactus/integration/ant
TestCactusTask.java
integration/ant/src/test-input/org/apache/cactus/integration/ant
test-cactus.xml
Log:
Add tests that verify that BuildExceptions are thrown if either a specified 'earfile' doesn't contain a web-module, or doesn't contain a web-module with Cactus redirectors
Revision Changes Path
1.6 +42 -1 jakarta-cactus/integration/ant/src/test/org/apache/cactus/integration/ant/TestCactusTask.java
Index: TestCactusTask.java
===================================================================
RCS file: /home/cvs/jakarta-cactus/integration/ant/src/test/org/apache/cactus/integration/ant/TestCactusTask.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- TestCactusTask.java 13 May 2003 16:13:53 -0000 1.5
+++ TestCactusTask.java 13 May 2003 22:14:41 -0000 1.6
@@ -132,4 +132,45 @@
}
}
+ /**
+ * Verifies that the task throws an exception when the earfile attribute
+ * is set to an empty enterprise application archive.
+ *
+ * @throws Exception If an unexpected error occurs
+ */
+ public void testEarFileEmpty() throws Exception
+ {
+ try
+ {
+ executeTestTarget();
+ fail("Expected BuildException");
+ }
+ catch (BuildException expected)
+ {
+ assertEquals("Could not find cactified web module in the EAR",
+ expected.getMessage());
+ }
+ }
+
+ /**
+ * Verifies that the task throws an exception when the earfile attribute
+ * is set to an enterprise application archive that doesn't contain a web
+ * module with the definition of the test redirectors.
+ *
+ * @throws Exception If an unexpected error occurs
+ */
+ public void testEarFileNotCactified() throws Exception
+ {
+ try
+ {
+ executeTestTarget();
+ fail("Expected BuildException");
+ }
+ catch (BuildException expected)
+ {
+ assertEquals("Could not find cactified web module in the EAR",
+ expected.getMessage());
+ }
+ }
+
}
1.3 +8 -0 jakarta-cactus/integration/ant/src/test-input/org/apache/cactus/integration/ant/test-cactus.xml
Index: test-cactus.xml
===================================================================
RCS file: /home/cvs/jakarta-cactus/integration/ant/src/test-input/org/apache/cactus/integration/ant/test-cactus.xml,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- test-cactus.xml 12 May 2003 09:05:23 -0000 1.2
+++ test-cactus.xml 13 May 2003 22:14:41 -0000 1.3
@@ -10,4 +10,12 @@
<cactus warfile="idontexist.war"/>
</target>
+ <target name="testEarFileEmpty">
+ <cactus earfile="empty.ear"/>
+ </target>
+
+ <target name="testEarFileNotCactified">
+ <cactus earfile="notcactified.ear"/>
+ </target>
+
</project>
---------------------------------------------------------------------
To unsubscribe, e-mail: cactus-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: cactus-dev-help@jakarta.apache.org