ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martijn Kruithof <mart...@kruithof.xs4all.nl>
Subject [PATCH] 12390 junit-noframes.html generated without content when frames report is requested via default.
Date Mon, 09 Sep 2002 20:30:56 GMT
A patch and a testcase has been added to the bug report

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12390

The bug is that if in the junitreport task no report format is specified 
and therefore a framed format is chosen, still a junit-noframes.html is 
generated, without content though. This can be resolved by applying the 
patch included in the bug report. The condition can be verified to occur 
  by running the testcase provided in the bug report. (xalan.jar 
needed). The condition does not occur anymore when the patch is applied.

patch reproduced here:

Index: 
src/main/org/apache/tools/ant/taskdefs/optional/junit/XalanExecutor.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/opt
ional/junit/XalanExecutor.java,v
retrieving revision 1.6
diff -u -r1.6 XalanExecutor.java
--- src/main/org/apache/tools/ant/taskdefs/optional/junit/XalanExecutor.java
15 Aug 2002 10:25:42 -0000      1.6
+++ src/main/org/apache/tools/ant/taskdefs/optional/junit/XalanExecutor.java
9 Sep 2002 20:17:34 -0000
@@ -78,12 +78,15 @@

      /** get the appropriate stream based on the format 
(frames/noframes) */
      protected OutputStream getOutputStream() throws IOException {
-        if (caller.FRAMES.equals(caller.format)){
+        // martijn@kruithof.xs4all.nl
+        // switch condition as FRAMES is default and therefore
+        // need not be defined while FRAMES is active
+        if (caller.NOFRAMES.equals(caller.format)){
+            return new FileOutputStream(new File(caller.toDir, 
"junit-noframes.
html"));
+        } else {
              // dummy output for the framed report
              // it's all done by extension...
              return new ByteArrayOutputStream();
-        } else {
-            return new FileOutputStream(new File(caller.toDir, 
"junit-noframes.
html"));
          }
      }


--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message