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.
When running a Unit test I get the following error: java.lang.RuntimeException: Uncompilable source code at com.test.MyTestCase.testMyTest(MyTestCase.java:192) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:297) at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:672) at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:567) Test com.test.MyTestCase FAILED
Reassigning to junit component
I get the same exception message when I try to access an inner Enum class. When I run the following code I get a RuntimeException with the message "Uncompilable source code", but only if I run it from the Netbeans IDE. If I make a JAR file and run it from outside the IDE I do not get the exception. Exception: Exception in thread "main" java.lang.RuntimeException: Uncompilable source code at enumbug.Main$Col.values(Main.java) at enumbug.Main.main(Main.java:30) Code: public class Main { enum Col {NAME ("Name"), ID ("Skill ID"), SCHOOL ("School"), COUNT ("Count"); String desc; Col(String desc) { this.desc = desc; } public String getDescription() { return desc; } } public static void main(String[] args) { int numColumns = Col.values().length; } }
Assigning issues from Michael to Andrey.
The same here in a maven project, it disappeared when compile on save was disabled. Found the hint in a comment on http://www.netbeans.org/issues/show_bug.cgi?id=153840
Can't reproduce this issue. From the stack trace looks like the cause is at com.test.MyTestCase.testMyTest(MyTestCase.java:192) First of all please check this works outside of IDE and attach the source code.
I have also encountered this problem. Using 6.7RC2. It occurred for me and a colleague when running an individual test file (ctrl F6). Although for each of us this was a different test file, and the exception was caused elsewhere in our code (in different places for each of us). When running all tests no problems are seen, it is only when running just one test file. When the error occurs it persists on that one file through a clear of the netbeans cache and through "clean and build" of the project. Switching off the "compile on save" for tests solved the problem. It occurred in different code places for both of us and I can't see any connection between the occurrences. I am unable to supply the code, and doubt it would be reproducible for you anyway: as I say it doesn't seem to occur in the same place for different developers. I have moved to RC3 and not seen this issue yet.
Product Version: NetBeans IDE 6.8 Beta (Build 200910020947) Java: 1.6.0_16; Java HotSpot(TM) Client VM 14.2-b01 System: Windows XP version 5.1 running on x86; Cp1250; cs_CZ (nb) I was not able to reproduce this problem on recent build. As there is no additional info since June, I am closing this issue as WORKSFORME (hopefully the problem was fixed). However, if the problem persists, please reopen. Thanks