You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bu...@apache.org on 2002/09/07 16:39:07 UTC

DO NOT REPLY [Bug 12390] New: - junit-noframes.html generated whithout content when frames report is requested via default.

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12390>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

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

junit-noframes.html generated whithout content when frames report is requested via default.

           Summary: junit-noframes.html generated whithout content when
                    frames report is requested via default.
           Product: Ant
           Version: 1.5
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Optional Tasks
        AssignedTo: ant-dev@jakarta.apache.org
        ReportedBy: ant@kruithof.xs4all.nl


When invoking the junitreport in the following form:
         <junitreport todir="${reportdir}" tofile="${unitreport}">
             <fileset dir="${reportdir}">
                 <include name="TEST-*.xml"/>
             </fileset>
            <report todir="${reportdir}/html/unit"/>
         </junitreport>
an empty file is created named junit-noframes.html
This is because the format is an optional field defaulting to FRAMES. This error
is still present in the current CVS version. The following patch fixes this.

[jkf@user junit]$ cvs diff -u XalanExecutor.java
Index: XalanExecutor.java
===================================================================
RCS file:
/home/cvspublic/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/XalanExecutor.java,v
retrieving revision 1.6
diff -u -r1.6 XalanExecutor.java
--- XalanExecutor.java  15 Aug 2002 10:25:42 -0000      1.6
+++ XalanExecutor.java  7 Sep 2002 14:16:50 -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:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>