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 213978 - Classes from another test root not executed
Summary: Classes from another test root not executed
Status: REOPENED
Alias: None
Product: projects
Classification: Unclassified
Component: Maven (show other bugs)
Version: 7.2
Hardware: PC Windows 7
: P2 normal (vote)
Assignee: Tomas Danek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-11 13:52 UTC by mienamoo
Modified: 2012-08-22 07:09 UTC (History)
2 users (show)

See Also:
Issue Type: TASK
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description mienamoo 2012-06-11 13:52:30 UTC
NetBeans build 201206100001
JDK 7u3 32-bit

I was running through the Maven test spec [1] when I noticed that the "classes from another test root" test fails. See test suite 12, test 3 of the linked test spec [1] for the steps to reproduce.

[1] http://wiki.netbeans.org/TS_72_Maven
Comment 1 mienamoo 2012-06-11 13:58:11 UTC
Here is the direct link to test suite 12 [2] for convenience. :)

[2] http://wiki.netbeans.org/TS_72_Maven#Test_suite:_Functional_tests
Comment 2 Milos Kleint 2012-06-13 08:39:00 UTC
the test specification is totally flawed. the maven surefire plugin has no idea whatsoever that there are tests in target/generated-test-sources/foo. It's not even compiled by maven, because the source root is not on maven's source path. it is on netbeans source path, because we take everything we find in target/generated-sources and target/generated-test-sources. I can't even think how it could ever work. Maybe in some compile on save scenario.

typically you would need to add the additional source root to maven, eg. using the [1] configuration in the pom

musilt2 : please change the test specification.

[1] http://mojo.codehaus.org/build-helper-maven-plugin/add-test-source-mojo.html
Comment 3 Tomas Danek 2012-06-13 09:56:36 UTC
(In reply to comment #2)
> I can't even think how it could ever work. Maybe in some compile on save scenario.

It was ment to work like this with CoS on (and it really worked) since 7.1, see http://wiki.netbeans.org/NewAndNoteworthyNB71#Generated_test_sources , or at least I understood so. 
The point is that in 7.1 was CoS on by default, which "enabled" this feature. In 7.2 is CoS by default off for tests, and in such a case must be another test root really defined in pom.xml. 

> musilt2 : please change the test specification.

Added into testspec that CoS mut be on for test execution.
Verified that this testcase passes then.
Comment 4 Jesse Glick 2012-06-13 17:21:03 UTC
Both the test spec and the IDE are wrong. Manually creating target/generated-test-sources/foo without any corresponding plugin configuration is not a valid use case. It may happen to work with CoS enabled, but that is by accident and will not be fixed (since the IDE has to assume that any directory with this naming pattern is supposed to be used).

So either delete this section from the test specification, or do it right by adding a plugin which would actually generate test sources by some mechanism (in which case it will also work with CoS disabled).