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 189103 - Problems with CoS test execution
Summary: Problems with CoS test execution
Status: RESOLVED FIXED
Alias: None
Product: projects
Classification: Unclassified
Component: Maven (show other bugs)
Version: 7.0
Hardware: PC Linux
: P3 normal (vote)
Assignee: Milos Kleint
URL:
Keywords:
: 182751 187120 188673 (view as bug list)
Depends on:
Blocks: 204907
  Show dependency tree
 
Reported: 2010-07-30 21:19 UTC by Jesse Glick
Modified: 2012-11-04 02:50 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2010-07-30 21:19:23 UTC
Not a new bug, just did not get to reporting it until now. CoS execution of tests (the default option) does not work reliably; there is something wrong with the detection of the timestamps.

1. If I change, say, a constructor signature in src/main/java, and change my usage of it in src/test/java accordingly, and run the test, it fails with a NoSuchMethodError. I have to build the project first.

2. Run Focused Test at this point calls mvn, i.e. does not use JavaRunner. It runs surefire-test with -Dnb.single.run.methodName=... -Dtest=..., which does not work properly - surefire ignore the NB property (unsurprisingly) and runs all the tests.

3. R.F.T. a second time now runs just the one requested test, with JavaRunner, and loads the modified main source class as expected.

These things are not problems for j2seproject's that I know of.
Comment 1 Jesse Glick 2010-08-02 19:20:10 UTC
*** Bug 188673 has been marked as a duplicate of this bug. ***
Comment 2 Jesse Glick 2010-08-02 19:40:48 UTC
Possibly related to bug #182751.
Comment 3 Jesse Glick 2010-08-19 00:00:08 UTC
*** Bug 187120 has been marked as a duplicate of this bug. ***
Comment 4 Jesse Glick 2010-08-19 00:00:50 UTC
*** Bug 182751 has been marked as a duplicate of this bug. ***
Comment 5 Milos Kleint 2012-09-10 13:51:57 UTC
re 1. I suppose  the root of the problem is that the combo in project properties dialog not only denotes what gets executed by JavaRunner (by the IDE) but also what source roots get CoS-ed. If just Test is selected only the test source root is CoS enabled. That's most likely wrong, but AFAIK was chosen to be careful about dropping IDE's own class files to the project main artifact.

re 2. AFAIK fixed in 7.2 timeframe for with introduction of surefire plugin 2.12.x.
Comment 6 Jesse Glick 2012-09-10 13:58:34 UTC
(In reply to comment #5)
> re 2. AFAIK fixed in 7.2 timeframe

Right, this part is obsolete. Not sure about the rest.
Comment 7 Milos Kleint 2012-11-02 14:47:49 UTC
http://hg.netbeans.org/core-main/rev/101634892108

when only tests are CoS enabled, we now before running check that some of the sources in main source roots have changed and if so, we skip JavaRunner and execute proper maven build, which ultimately runs the compilation
Comment 8 Quality Engineering 2012-11-04 02:50:59 UTC
Integrated into 'main-golden', will be available in build *201211040001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/101634892108
User: Milos Kleint <mkleint@netbeans.org>
Log: #189103 when main source files get changed and we have CoS for tests only, we need to run maven build, not CoS