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 187875 - "Run | Test file" (test-single) doesn't do anything
Summary: "Run | Test file" (test-single) doesn't do anything
Status: NEW
Alias: None
Product: contrib
Classification: Unclassified
Component: Scala (show other bugs)
Version: 7.0
Hardware: PC Linux
: P3 normal (vote)
Assignee: _ dcaoyuan
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-21 09:23 UTC by bertvv
Modified: 2010-10-13 15:15 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Patch for J2SEActionProvider.java (1.00 KB, patch)
2010-10-13 15:09 UTC, bertvv
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description bertvv 2010-06-21 09:23:06 UTC
Testing a single file doesn't do anything. The Test Results pane only shows "No tests executed."

The Ant build target for do-test-run-single seems to look ok, as far as I can tell (see below), so I don't know what's wrong...

<target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single">
  <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
  <scalaProject1:junit excludes="" includes="${test.includes}"/>
</target>
Comment 1 bertvv 2010-10-13 15:09:09 UTC
Created attachment 102395 [details]
Patch for J2SEActionProvider.java
Comment 2 bertvv 2010-10-13 15:15:41 UTC
I investigated this a bit further and found the cause of the problem. When running the test with debug output (Tools|Options|Ant, Verbosity Level = debug), I see something like the following:


[...]
-do-test-run-single:
[...]
fileset: Setup scanner in dir /path/to/Project/build/test/classes with patternSet{ includes: [project/BTest.scala] excludes: [] }
[...]


So ant looks for source files in the output directory and obviously doesn't find any.


I think this can be fixed in scala.project/src/org/netbeans/modules/scala/project/J2SEActionProvider.java

The problem is in method setupTestSingle(). If the content of setupDebugTestSingle() (the one below) is copied to setupTestSingle(), I think it will work. The ant target -do-test-run-single in build.xml will also have to be modified, but I don't know enough about that to be able to rewrite it myself.


I hope this helps to fix this issue quickly. I put a patch for J2SEActionProvider.java in attachment.

Keep up the excellent work!

bert