This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 159017 - outputs are lost in "JUnit Test Results" window infrequently when stderr is used
Summary: outputs are lost in "JUnit Test Results" window infrequently when stderr is used
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: JUnit (show other bugs)
Version: 6.x
Hardware: Macintosh All
: P3 blocker (vote)
Assignee: Andrey Yamkovoy
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-23 22:59 UTC by Masaki Katakai
Modified: 2009-03-11 14:43 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
screenshot : "p10 log" is not displayed (60.32 KB, image/png)
2009-02-23 23:02 UTC, Masaki Katakai
Details
sample project (11.76 KB, application/x-compressed)
2009-02-23 23:04 UTC, Masaki Katakai
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Masaki Katakai 2009-02-23 22:59:49 UTC
Product Version: NetBeans IDE 6.5 (Build 200811100001)
Java: 1.6.0_07; Java HotSpot(TM) 64-Bit Server VM 1.6.0_07-b06-57
System: Mac OS X version 10.5.6 running on x86_64; SJIS; en (nb)

It seems that when we use stderr for displaying logs in JUnit tests,
some lines will be lost rarely. I'll attach sample project and
screenshot later.

"MainTest.java" is simple. It will display "p1" ~ "p10" and "p1 log" ~ "p10 log".
"p?" to stdout, "p? log" to stderr.

Main.java:
	public String p1() {
		System.err.println("p1 log");
		return "p1";
	}


MainTest.java
	@Test
	public void testP1() {
		System.out.println("p1");
		Main instance = new Main();
		String expResult = "";
		String result = instance.p1();
		assertEquals(expResult, result);
		fail("The test case is a prototype.");
	}

On "JUnit Test Results" window, "p10 log" was lost in this case.

---
main
p1
p1 log
p2
p2 log
p3 log
p3
p4
p4 log
p5
p5 log
p6 log
p6
p7
p7 log
p8 log
p8
p9 log
p9
p10
---

"p10 log" should be displayed at the end.

It does not happen always. Please try 5 ~ 10 times.

In the "Output" window, it looks correct. "p10 log" is displayed properly.

----
init:
deps-jar:
compile:
compile-test-single:
Testsuite: javaapplication11.MainTest
main
p1
p1 log
p2
p2 log
p3 log
p3
p4
p4 log
p5
p5 log
p6 log
p6
p7
p7 log
p8 log
p8
p9 log
p9
p10 log
p10
Tests run: 11, Failures: 1, Errors: 10, Time elapsed: 0.164 sec

------------- Standard Output ---------------
main
p1
p2
p3
p4
p5
p6
p7
p8
p9
p10
------------- ---------------- ---------------
------------- Standard Error -----------------
p1 log
p2 log
p3 log
p4 log
p5 log
p6 log
p7 log
p8 log
p9 log
p10 log
------------- ---------------- ---------------
---
Comment 1 Masaki Katakai 2009-02-23 23:02:27 UTC
Created attachment 77265 [details]
screenshot : "p10 log" is not displayed
Comment 2 Masaki Katakai 2009-02-23 23:04:24 UTC
Created attachment 77266 [details]
sample project
Comment 3 Alexei Mokeev 2009-03-05 13:50:04 UTC
Assigning issues from Michael to Andrey.
Comment 4 Andrey Yamkovoy 2009-03-11 14:43:33 UTC
Not reproducible anymore. Looks like was fixed while rewriting ant events parser and switching to the Common Test Runner
API.