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 252317 - Test Results report "passed" on error
Summary: Test Results report "passed" on error
Status: NEW
Alias: None
Product: utilities
Classification: Unclassified
Component: Test Runner (show other bugs)
Version: 8.0.2
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Theofanis Oikonomou
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-09 09:41 UTC by m35
Modified: 2015-05-28 14:21 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description m35 2015-05-09 09:41:54 UTC
If a test throws an exception that will in turn throw another exception when its message is retrieved, Netbeans stops all tests and reports "passed".
I have observed this behavior since before version 8.0.


## Steps to reproduce.
1. Create a new Netbeans project with a main class
2. Right-click the main class file and select Tools->Create/Update Tests
3. Select JUnit 4.x and create the test file
4. Replace the test file code with the following:

import org.junit.Test;

public class JavaApplication1Test {

    private static class BadException extends Exception {
        @Override
        public String getMessage() {
            throw new RuntimeException();
        }
    }

    @Test
    public void test() throws Exception {
        throw new BadException();
    }
}

5. Right click in the editor and select Test File

## Expected result.
Netbeans Test Results panel indicates the test failed.

## Actual result.
Netbeans Test Results panel indicates the test passed.