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 62207 - Do not display <...> instead of parts of compared strings.
Summary: Do not display <...> instead of parts of compared strings.
Status: VERIFIED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: JUnit (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker with 1 vote (vote)
Assignee: Marian Petras
URL:
Keywords:
Depends on: 73237
Blocks:
  Show dependency tree
 
Reported: 2005-08-12 09:56 UTC by Max Sauer
Modified: 2006-10-30 09:21 UTC (History)
0 users

See Also:
Issue Type: TASK
Exception Reporter:


Attachments
screenshot (4.41 KB, image/png)
2005-08-12 09:56 UTC, Max Sauer
Details
test project (9.66 KB, application/x-gzip)
2005-08-12 09:58 UTC, Max Sauer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Max Sauer 2005-08-12 09:56:25 UTC
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]
Comment 1 Max Sauer 2005-08-12 09:56:51 UTC
Created attachment 23749 [details]
screenshot
Comment 2 Max Sauer 2005-08-12 09:58:45 UTC
Created attachment 23750 [details]
test project
Comment 3 tboerkel 2005-12-07 14:01:05 UTC
This is annoying.
Comment 4 Marian Petras 2005-12-07 15:10:04 UTC
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".
Comment 5 Max Sauer 2005-12-09 08:41:00 UTC
OK, that makes sense, thanks for eval.
Comment 6 Marian Petras 2006-03-04 16:07:42 UTC
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.
Comment 7 Marian Petras 2006-03-04 16:47:22 UTC
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).
Comment 8 Marian Petras 2006-04-10 16:57:51 UTC
I just upgraded the JUnit library distributed with NetBeans to version 3.8.2
(issue #73237) so this issue should be fixed now.
Comment 9 Marian Petras 2006-04-10 16:58:29 UTC
I forgot to note that I made the change to the trunk.
Comment 10 Max Sauer 2006-10-30 09:21:04 UTC
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