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.
Summary: | Cannot compile test for method throwing exceptions | ||
---|---|---|---|
Product: | java | Reporter: | zikmund <zikmund> |
Component: | JUnit | Assignee: | Marian Petras <mpetras> |
Status: | VERIFIED FIXED | ||
Severity: | blocker | ||
Priority: | P3 | ||
Version: | 5.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: |
Description
zikmund
2005-06-15 14:15:54 UTC
The correct solution is to make the exceptions reported by the test method, and thus pass them to the framework, which will report them as errors. Accepted. I will use the solution suggested by Ondrej Rypacek, i.e. I will just add the throws-clause to the header of the test method. The throws-clause will simply declare throwing of 'java.lang.Exception'. Fixed in the trunk. If the tested method declares to throw at least one exception other than java.lang.RuntimeException or its subclass, the test method declares to throw java.lang.Exception. Modified file: junit/src/org/netbeans/modules/junit/TestCreator.java (1.52) Diff: http://junit.netbeans.org/source/browse/junit/src/org/netbeans/modules/junit/TestCreator.java?r1=1.51&r2=1.52&diff_format=u Verified in 20050902-0547. |