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

Summary: Test Results report "passed" on error
Product: utilities Reporter: m35
Component: Test RunnerAssignee: Theofanis Oikonomou <theofanis>
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: 8.0.2   
Hardware: PC   
OS: Windows 7   
Issue Type: DEFECT Exception Reporter:

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.