You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Tibor Digana (JIRA)" <ji...@apache.org> on 2015/12/21 18:19:46 UTC

[jira] [Comment Edited] (SUREFIRE-1210) Load test-classes and test dependencies into isolated loader

    [ https://issues.apache.org/jira/browse/SUREFIRE-1210?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15066721#comment-15066721 ] 

Tibor Digana edited comment on SUREFIRE-1210 at 12/21/15 5:18 PM:
------------------------------------------------------------------

>>This can cause problems if the test classes contains mocks classes with the same name as artifact classes that aren't intended for use by all tests.

This is not Maven Surefire problem.
Your project then needs an architect.



>>The test classes and test dependencies should be placed in their own classloader

This would maybe fit to your use cases but I would like to hear other users.
Can you open discussion at LinkedIn or Maven Mailing list and we will see how many users really need this feature.
In our code, TestNG, JUnit it is always a risk to work with other than current ClassLoader.
Maybe we will have a chance to create abstraction in Surefire 3.x with class loaders but currently you or Users Group did not provide us with working concept.


was (Author: tibor17):
>>This can cause problems if the test classes contains mocks classes with the same name as artifact classes that aren't intended for use by all tests.

This is not Maven Surefire problem.
Your project then needs an architect.



>>The test classes and test dependencies should be placed in their own classloader

This would maybe fit to your use cases but I would like to hear other users.
Can you open discussion at LinkedIn or Maven Mailing list and we will see how many users really need this feature.
In our code, TestNG, JUnit it is always a risk to work with other than current ClassLoader.
Maybe we will have a chance to create abstraction in Surefire 3.x with class loaders but currently you or Users Group did not provided us with working concept.

> Load test-classes and test dependencies into isolated loader
> ------------------------------------------------------------
>
>                 Key: SUREFIRE-1210
>                 URL: https://issues.apache.org/jira/browse/SUREFIRE-1210
>             Project: Maven Surefire
>          Issue Type: Improvement
>          Components: Maven Surefire Plugin
>    Affects Versions: 2.18.1
>            Reporter: mike duigou
>
> Currently both the artifact and it's tests are loaded in to the same classloader. The test-classes and test dependencies are also placed ahead of the artifact classes in the search path. This can cause problems if the test classes contains mocks classes with the same name as artifact classes that aren't intended for use by all tests.
> The test classes and test dependencies should be placed in their own classloader, a child of whichever classloader is being used for the artifact and run dependencies.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)