Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
Bug 199204 - Errors displayed in JUnit test code
Errors displayed in JUnit test code
Status: RESOLVED INCOMPLETE
Product: projects
Classification: Unclassified
Component: Maven
7.0.1
PC Windows XP
: P3 (vote)
: TBD
Assigned To: Jesse Glick
issues@projects
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-06-06 15:53 UTC by aquaglia
Modified: 2011-08-26 21:38 UTC (History)
0 users

See Also:
Issue Type: DEFECT
:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description aquaglia 2011-06-06 15:53:21 UTC
Working with NB 7.0.1 Dev 201106020000

Occasionally but not rarely, several unit test source files are marked red in the editor because some classes are not found.

Even restarting NB or clean-recompiling the whole project does not solve the issue.

The only solution is to open the classes that are marked in red, make a dummy modification and save them.
After a while the red marks disappear in the unit test code.
Comment 1 Jesse Glick 2011-06-06 17:28:40 UTC
Without a test case I cannot say whether this is a bug in the Maven support or the Java parser infrastructure.
Comment 2 aquaglia 2011-06-06 17:46:19 UTC
Of course, but the problem is there.
I will add more details as soon as I can identify the reproducible testcase.
Do you have suggestions on what I can do to further diagnose the issue when I encounter it?
If you do not give me any assistance, the problem will remain there unsolved.
Comment 3 Jesse Glick 2011-06-06 18:06:00 UTC
(In reply to comment #2)
> I will add more details as soon as I can identify the reproducible testcase.

Well, reopen if and when you come up with this information.

> Do you have suggestions on what I can do to further diagnose the issue when I
> encounter it?

Using the NetBeans Project Metadata Inspector module (on Auto Update / Plugin Portal) you can see whether the classpath for src/test/java includes everything it should. If not, there may be an issue in the Maven support (presumably triggered somehow by your project setup and the content of your local repository). If so, there is probably an issue in the Java parser, though something like bug #192647 could also be to blame. It is tricky to say since the bug appears to be worked around by refreshes. If shutting down the IDE, deleting $userdir/var/cache/index/, restarting the IDE, and waiting for scanning to finish clears the errors, then a bug in the Java parser seems most likely.
Comment 4 aquaglia 2011-08-26 20:01:29 UTC
A huge number of files in the Windows temp directory might have been the cause.
Comment 5 Jesse Glick 2011-08-26 21:38:58 UTC
Hmm. I cannot think of any good reason offhand why that would result in spurious errors in the Java editor. Perhaps some code tried to create a temp file in the course of some computation, was denied, and then "recovered" from the error without logging it properly, but I have no guesses at what that code could have been.


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo