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 233521 - Allow setting monospace font on Test Results pane used by Junit test runner
Summary: Allow setting monospace font on Test Results pane used by Junit test runner
Status: NEW
Alias: None
Product: utilities
Classification: Unclassified
Component: Test Runner (show other bugs)
Version: 7.4
Hardware: PC Windows 7
: P3 normal with 1 vote (vote)
Assignee: Theofanis Oikonomou
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-26 21:11 UTC by dirt_dog
Modified: 2015-02-11 13:55 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description dirt_dog 2013-07-26 21:11:07 UTC
The Test Results window used to display results from the JUnit test runner does not allow a way to set the font.

This distorts a very useful feature provided by Groovy assertions, used by the (excellent) spock test framework. When a assertion fails, Groovy displays the values of each part of the assertion in a very informative format that requires a monospaced font. Otherwise, the values are not displayed under the correct expressions.

Spock uses the JUnit test runner.

For example, the following spock test:
   def "simple failing test"() {
       expect:
            Math.max(2, Math.min(3, 4)) == 4
   }

Produces this output:
Condition not satisfied:

Math.max(2, Math.min(3, 4)) == 4
     |           |          |
     3           3          false

Note, how by reporting the values of each part of the condition, you can often tell immediately why a test failed without having to debug.

This looks great in some IDEs, but gets all shifted around in Netbean's Test Results window because there doesn't seem to be a way to use a monospaced font. Sounds like a frill, but that makes this feature less valuable because you have to kind of guess which value goes with which subexpression.

Please allow a way to set the font for the Test Results window.

Thanks,

BTW, check out the spock test framework. Very concise and clear.
Comment 1 pniederw 2013-07-26 22:20:14 UTC
Some minor clarifications:

* Spock *implements* a JUnit test runner.
* This feature is crucial both to make the output of Groovy's assert statements legible, and to make the output of Spock conditions (which are an improved version of Groovy asserts) legible.

IntelliJ uses a monospace font for JUnit output by default. Eclipse supports a monospace font since Eclipse 4.4 M1, driven by desire to solve the Groovy/Spock issue. (In earlier versions of Eclipse, the Groovy Eclipse plugin provides this feature.)