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.
In attached test project, where I test a method which reads string from files, when the test failes (expected string does not match the one readed from file), three dots (<...>) are displayed instead of compared strings. See attached screenshoot. I'll attach a test project where you can try this. In 'obsahTest.java', the compared String is on line 50. [200508111800, JDK 1.5.0_05, solaris 10 / sparc]
Created attachment 23749 [details] screenshot
Created attachment 23750 [details] test project
This is annoying.
This is not a matter of the JUnit window but rather the JUnit library itself. It is the JUnit library which generates the dots (<...>) instead of actual text. Each series of three dots serves as a replacement for some longer text which is same both in the expected string and the string actually obtained by the test. To see how it works, look at http://www.purpletech.com/junit-patch/assertEqualsDiff.patch . In JUnit 3.8.1 (the latest stable release and also the one used in NetBeans), the algorithm for compacting texts (so that only the different parts are displayed) is defined in method junit.framework.ComparisonFailure.getMessage(). In JUnit 4 (under development), the algorithm is defined in class junit.framework.ComparisonCompactor. There is no way how to disable the compacting routine or how to get original (not compacted) strings in JUnit 3.8.1. In JUnit 4, it seems it might be possible to get the original compared strings so that they could be presented uncompacted or some other (defined in NetBeans) compacting routine could be used. Since this is not a bug of NetBeans and it is not possible to work-around it in NetBeans 5 timeframe (because JUnit 4 is quite far from release now), I change this issue to ENHANCEMENT and set the target to "future".
OK, that makes sense, thanks for eval.
As said earlier, this is a bug in the JUnit library NetBeans uses (JUnit 3.8.1). This JUnit bug had been fixed and a new version - JUnit 3.8.2 - was released just yesterday. All we need to do to fix this issue in NetBeans is replacing JUnit 3.8.1 with JUnit 3.8.2.
The JUnit issue is tracked as an SourceForge issue number 609972 (http://sourceforge.net/tracker/index.php?func=detail&aid=609972&group_id=15278&atid=115278). JUnit 3.8.2 contains enhanced mechanism for construction of string diff, similar to one described in SourceForge issue number 657593 (http://sourceforge.net/tracker/index.php?func=detail&aid=657593&group_id=15278&atid=315278).
I just upgraded the JUnit library distributed with NetBeans to version 3.8.2 (issue #73237) so this issue should be fixed now.
I forgot to note that I made the change to the trunk.
Verified. -- NetBeans IDE Dev (Build 061030) 1.6.0-rc; Java HotSpot(TM) Server VM 1.6.0-rc-b103 Linux version 2.6.12-1.1390_FC4smp running on i386 en_US (nb); UTF-8