[ 
https://jira.codehaus.org/browse/MNBMODULE-138?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=292480#comment-292480
 ] 

Frantisek Mantlik commented on MNBMODULE-138:
---------------------------------------------

Sorry, I can't provide self-contained example because I am not able to locate 
exactly source of the problem. In general, functional tests of the project run, 
of course, in test scope, but test modules dependencies, including 
org-netbeans-libs-junit4, have to be declared as normal dependencies (without 
test scope) and included in regular clusters in order to be enabled at the 
right moment. Here is more detailed description:

The project under question has complicated dependency tree with several 
hundreds of modules including external and native libraries. Order of 
activation of modules seems to be important for proper operation of the 
application. Approx. 1 year ago, after several weeks of unsuccessful attempts 
to set-up functional testing, this setting proved itself as working and stable:

{code}
    public static Test suite() {
        NbModuleSuite.Configuration conf = 
NbModuleSuite.emptyConfiguration().enableClasspathModules(false);
        conf = conf.honorAutoloadEager(false);
        conf = conf.clusters(".*");
        conf = conf.enableModules("appcluster", ".*");
        conf = conf.enableModules("org.netbeans.libs.junit4");
        conf = conf.enableModules("org.netbeans.modules.nbjunit");
        conf = conf.enableModules("harness", "org.netbeans.modules.jemmy");
        conf = conf.enableModules("ide", "org.netbeans.modules.jellytools.ide");
        conf = conf.enableModules("harness", 
"org.netbeans.modules.jellytools.platform");
        conf = conf.addTest(
                MyTest.class, "test1", "test2",
                "test3");
        return conf.suite();
}
{code}

To make this work, test application has to be built with dependencies on 
testing libraries, i.e. Jemmy, jellytools, nbjunit and junit4. Test scope does 
not work because enableModules can't locate and enable the modules.

Any other settings, e.g. with enableClasspathModules(true) and test scope 
dependencies did not work for this project. Even if a test was started 
successfully, test run was unstable with unpredictable class loading errors 
depending among others e.g. on the order of activation of different factory 
methods in the application.

Functional tests created this way are stable and reliable on all our computers 
(both Linux and Windows) and can be run from Hudson (Tomcat) as well. The only 
disadvantage is that functional test application needs special build with 
modified dependencies (in a specialized profile). Now, with 13781 
"improvement", my test application build fails with "not yet implemented" 
error. With previous version of MNB plugin tests are working fine.
                
> Support *.external entries in NBMs
> ----------------------------------
>
>                 Key: MNBMODULE-138
>                 URL: https://jira.codehaus.org/browse/MNBMODULE-138
>             Project: Maven NetBeans Module Plugin
>          Issue Type: Task
>    Affects Versions: 3.5
>            Reporter: Jesse Glick
>            Assignee: Jesse Glick
>            Priority: Minor
>
> After https://netbeans.org/bugzilla/show_bug.cgi?id=195041 an NBM can include 
> references to external contents, but {{nbm-maven-plugin}} does not yet 
> support this. Example: add to app POM
> {noformat}
>         <repository>
>             <id>netbeans-snapshot</id>
>             <url>http://bits.netbeans.org/netbeans/trunk/maven-snapshot/</url>
>         </repository>
> ...
>         <dependency>
>             <groupId>org.netbeans.api</groupId>
>             <artifactId>org-netbeans-libs-junit4</artifactId>
>             <version>SNAPSHOT</version>
>         </dependency>
> {noformat}
> (or just use {{RELEASE70}} version from regular repo when available) and 
> build; you get a 
> {{application/target/.../platform/modules/ext/junit-4.8.2.jar.external}} text 
> file, which is wrong.
> Not a high priority since the only two current uses are in 
> {{org-netbeans-libs-junit4}}, which would not normally be included in an app 
> (other than in test scope), and {{org-netbeans-modules-junitlib}} which is 
> not published in the Maven repo.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to