Bug#126455: marked as done (ant's junit test doesn't always capture stdout/stderr)

Debian Bug Tracking System owner at bugs.debian.org
Mon Aug 8 14:03:16 UTC 2005


Your message dated Mon, 08 Aug 2005 15:51:32 +0200
with message-id <42F76364.3050107 at gmx.de>
and subject line ant's junit test doesn't always capture stdout/stderr
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--------------------------------------
Received: (at submit) by bugs.debian.org; 26 Dec 2001 00:38:52 +0000
>From doogie at debian.org Tue Dec 25 18:38:52 2001
Return-path: <doogie at debian.org>
Received: from 12-238-101-237.client.attbi.com (yakko.doogie.org) [12.238.101.237] (uucp)
	by master.debian.org with esmtp (Exim 3.12 1 (Debian))
	id 16J25r-0004wF-00; Tue, 25 Dec 2001 18:38:51 -0600
Received: from localhost [127.0.0.1] (uucp)
	by yakko.doogie.org with esmtp (Exim 3.33 1 (Debian))
	id 16J24g-0003nl-00; Tue, 25 Dec 2001 18:37:38 -0600
Date: Tue, 25 Dec 2001 18:37:37 -0600 (CST)
From: Adam Heath <doogie at brainfood.com>
X-X-Sender:  <adam at yakko.doogie.org>
To:  <submit at bugs.debian.org>
Subject: ant's junit test doesn't always capture stdout/stderr
Message-ID: <Pine.LNX.4.33.0112251830070.684-100000 at yakko.doogie.org>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Delivered-To: submit at bugs.debian.org

Package: ant
Version: 1.4.1-1

If I have junit run inside a separate vm(fork="yes"), then the output of the
test(both stdout and stderr) are *NOT* captured into the result output file.

See the ant runs below, and note that the second run, which has fork=yes, does
not capture the output.

==
adam at gradall:~/brainfood/brainfood/base/src/java$ grep '<batchtest' build.xml
                        <batchtest fork="no" todir="${junit.test.dir}">
adam at gradall:~/brainfood/brainfood/base/src/java$ ant tests
...
tests:
    [junit] Running com.brainfood.util.deb.tests.DebVersionTest
    [junit] Tests run: 2, Failures: 0, Errors: 0, Time elapsed: 0.385 sec
    [junit] Output:
    [junit] foo
    [junit] foo
...
adam at gradall:~/brainfood/brainfood/base/src/java$ grep -A 2 '<system-o' build/junit-tests/TEST-com.brainfood.util.deb.tests.DebVersionTest.xml
  <system-out>foo
foo
</system-out>
==


==
adam at gradall:~/brainfood/brainfood/base/src/java$ grep '<batchtest' build.xml
                        <batchtest fork="yes" todir="${junit.test.dir}">
adam at gradall:~/brainfood/brainfood/base/src/java$ ant tests
...
tests:
    [junit] Running com.brainfood.util.deb.tests.DebVersionTest
    [junit] foo
    [junit] foo
    [junit] Tests run: 2, Failures: 0, Errors: 0, Time elapsed: 0.381 sec
...
adam at gradall:~/brainfood/brainfood/base/src/java$ grep -A 2 '<system-o' build/junit-tests/TEST-com.brainfood.util.deb.tests.DebVersionTest.xml
  <system-out></system-out>
  <system-err></system-err>
</testsuite>
==



---------------------------------------
Received: (at 126455-done) by bugs.debian.org; 8 Aug 2005 13:51:32 +0000
>From WBaer at gmx.de Mon Aug 08 06:51:32 2005
Return-path: <WBaer at gmx.de>
Received: from imap.gmx.net (mail.gmx.net) [213.165.64.20] 
	by spohr.debian.org with smtp (Exim 3.36 1 (Debian))
	id 1E282O-0005Tw-00; Mon, 08 Aug 2005 06:51:32 -0700
Received: (qmail invoked by alias); 08 Aug 2005 13:51:00 -0000
Received: from unknown (EHLO [131.173.86.164]) [131.173.86.164]
  by mail.gmx.net (mp018) with SMTP; 08 Aug 2005 15:51:00 +0200
X-Authenticated: #1941950
Message-ID: <42F76364.3050107 at gmx.de>
Date: Mon, 08 Aug 2005 15:51:32 +0200
From: Wolfgang Baer <WBaer at gmx.de>
User-Agent: Debian Thunderbird 1.0.6 (X11/20050802)
X-Accept-Language: en-us, en
MIME-Version: 1.0
To: 126455-done at bugs.debian.org
CC: doogie at brainfood.com
Subject: ant's junit test doesn't always capture stdout/stderr
Content-Type: multipart/mixed;
 boundary="------------060606060409070105030002"
X-Y-GMX-Trusted: 0
Delivered-To: 126455-done at bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02 
	(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Level: 
X-Spam-Status: No, hits=-1.3 required=4.0 tests=BAYES_00,HTML_30_40 
	autolearn=no version=2.60-bugs.debian.org_2005_01_02

This is a multi-part message in MIME format.
--------------060606060409070105030002
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Hi Adam,

ant 1.6.5 is uploaded and I am going through the remaining bug reports.

I created a testcase for your reported problem and it seems this was
solved somewhere between 1.4.1 and 1.6.5 release of ant. I tested it
with SUN JDK 1.4, sablevm (unstable) and gij 4.0 (unstable) and it
captured the output of system.out and system.err for both modes
(fork=yes and fork=no).

If you don't think it is solved - please reopen it.
Maybe my created testcase is not exactly the problem you reported.

Regards,
Wolfgang

--------------060606060409070105030002
Content-Type: text/x-java;
 name="BugTest.java"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="BugTest.java"

import junit.framework.TestCase;
/*
 * Sourcecode of the Researchproject
 * "Development of Component-Software for the Internet-Based
 * Access to Geo-Database Services"
 *
 * University of Vechta
 * Research Center for Geoinformatics and Remote Sensing
 *
 * Copyright (C) 2002-2005 Researchgroup Prof. Dr. Martin Breunig
 *
 * File BugTest.java - created on  08.08.2005
 */

/**
 * <p>
 * 
 * <br><br>
 * @author wbaer
 *</p>
 * Revision:<br>
 */
public class BugTest extends TestCase {

	public static void main(String[] args) {
		junit.textui.TestRunner.run(BugTest.class);
	}
	
	
	public void testOutput() {
		System.out.println("System.out works");
	}

	public void testErrorOutput() {
		System.err.println("System.err works");
	}
	

}

--------------060606060409070105030002
Content-Type: text/xml;
 name="build.xml"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="build.xml"

<?xml version="1.0"?>

<project default="test_fork_yes" basedir=".">

  <target name="compile">
    <javac srcdir="${basedir}" 
	   destdir="${basedir}" target="1.3"/>
  </target>

  <target name="test_fork_no" depends="compile">
    <junit>
      <formatter type="xml" usefile="true"/>
      <batchtest fork="no">
        <fileset dir="${basedir}">
          <include name="**/*Test.java"/>
        </fileset>
      </batchtest>
      <classpath>
        <pathelement location="${basedir}"/>
      </classpath>
    </junit>
  </target>

  <target name="test_fork_yes" depends="compile">
    <junit>
      <formatter type="xml" usefile="true"/>
      <batchtest fork="yes">
        <fileset dir="${basedir}">
          <include name="**/*Test.java"/>
        </fileset>
      </batchtest>
      <classpath>
        <pathelement location="${basedir}"/>
      </classpath>
    </junit>
  </target>

</project>

--------------060606060409070105030002--



More information about the pkg-java-maintainers mailing list