bodewig 01/11/09 05:45:04
Modified: src/testcases/org/apache/tools/ant BuildFileTest.java
Log:
targets are not tasks
Revision Changes Path
1.2 +30 -19
jakarta-ant/src/testcases/org/apache/tools/ant/BuildFileTest.java
Index: BuildFileTest.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/testcases/org/apache/tools/ant/BuildFileTest.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- BuildFileTest.java 2001/11/05 13:07:32 1.1
+++ BuildFileTest.java 2001/11/09 13:45:04 1.2
@@ -82,41 +82,52 @@
super(name);
}
+ protected void expectBuildException(String target, String cause) {
+ expectSpecificBuildException(target, cause, null);
+ }
+
+ /**
+ * Assert that the given message has been logged with a priority
+ * >= INFO when running the given target.
+ */
+ protected void expectLog(String target, String log) {
+ executeTarget(target);
+ String realLog = getLog();
+ assertEquals(log, realLog);
+ }
+
protected String getLog() {
return logBuffer.toString();
}
- protected String getFullLog() {
- return fullLogBuffer.toString();
+ /**
+ * Assert that the given message has been logged with a priority
+ * >= DEBUG when running the given target.
+ */
+ protected void expectDebuglog(String target, String log) {
+ executeTarget(target);
+ String realLog = getFullLog();
+ assertEquals(log, realLog);
}
-
-
- protected void expectBuildException(String taskname, String cause) {
- expectSpecificBuildException(taskname, cause, null);
+ protected String getFullLog() {
+ return fullLogBuffer.toString();
}
- protected void expectOutput(String taskname, String output) {
- executeTarget(taskname);
+ protected void expectOutput(String target, String output) {
+ executeTarget(target);
String realOutput = getOutput();
assertEquals(output, realOutput);
}
- protected void expectOutputAndError(String taskname, String output,
String error) {
- executeTarget(taskname);
+ protected void expectOutputAndError(String target, String output, String
error) {
+ executeTarget(target);
String realOutput = getOutput();
assertEquals(output, realOutput);
String realError = getError();
assertEquals(error, realError);
}
- protected void expectLog(String taskname, String log) {
- executeTarget(taskname);
- String realLog = getLog();
- assertEquals(log, realLog);
- }
-
-
protected String getOutput() {
return cleanBuffer(outBuffer);
}
@@ -185,9 +196,9 @@
return project.getBaseDir();
}
- protected void expectSpecificBuildException(String taskname, String
cause, String msg) {
+ protected void expectSpecificBuildException(String target, String cause,
String msg) {
try {
- executeTarget(taskname);
+ executeTarget(target);
} catch (org.apache.tools.ant.BuildException ex) {
if ((null != msg) && (ex.getMessage() != msg)) {
fail("Should throw BuildException because '" + cause + "'
with message '" + msg + "' (received message '" + ex.getMessage() + "'
instead)");
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>