You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Jonathan Share (JIRA)" <ji...@codehaus.org> on 2006/08/24 14:29:48 UTC

[jira] Created: (MNGECLIPSE-189) JUnit runner does not process resource filters before running

JUnit runner does not process resource filters before running
-------------------------------------------------------------

                 Key: MNGECLIPSE-189
                 URL: http://jira.codehaus.org/browse/MNGECLIPSE-189
             Project: Maven 2.x Extension for Eclipse
          Issue Type: Bug
    Affects Versions: 0.0.9
         Environment: Eclipse 3.1.2 Linux
            Reporter: Jonathan Share
         Assigned To: Eugene Kuleshov


I have a project that uses a resource filter to set the path to some files depending on what platform the developer is on. Using maven on the command line this is processed correctly and the Unit tests pass. However, I wish to use the JUnit runner within eclipse however as my resources do not get filtered before the tests try to load them I get exceptions creating URL objects with ${news.image.url} in them.

Desired behaviour
===============
This plugin should provide a launcher for the junit runner that first runs the process-resources (apologies if this is wrong, writing from memory here) target and ensure the classpath is configured correctly so that the non processed resources are not available to the JUnit runner before running the JUnit tests.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (MNGECLIPSE-189) JUnit runner does not process resource filters before running

Posted by "Jonathan Share (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNGECLIPSE-189?page=all ]

Jonathan Share updated MNGECLIPSE-189:
--------------------------------------

    Attachment: filter-test.zip

The requested test case, sorry for the delay.
 
 When run from the command line the test case passes due to the process-filters target being run.
 
 When run from the eclipse jUnit runner, with or without the m2eclipse plugin as there is not integration with the filters provided by maven the test case fails.

> JUnit runner does not process resource filters before running
> -------------------------------------------------------------
>
>                 Key: MNGECLIPSE-189
>                 URL: http://jira.codehaus.org/browse/MNGECLIPSE-189
>             Project: Maven 2.x Extension for Eclipse
>          Issue Type: Bug
>    Affects Versions: 0.0.9
>         Environment: Eclipse 3.1.2 Linux
>            Reporter: Jonathan Share
>         Assigned To: Eugene Kuleshov
>            Priority: Trivial
>         Attachments: filter-test.zip
>
>
> I have a project that uses a resource filter to set the path to some files depending on what platform the developer is on. Using maven on the command line this is processed correctly and the Unit tests pass. However, I wish to use the JUnit runner within eclipse however as my resources do not get filtered before the tests try to load them I get exceptions creating URL objects with ${news.image.url} in them.
> Desired behaviour
> ===============
> This plugin should provide a launcher for the junit runner that first runs the process-resources (apologies if this is wrong, writing from memory here) target and ensure the classpath is configured correctly so that the non processed resources are not available to the JUnit runner before running the JUnit tests.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Closed: (MNGECLIPSE-189) JUnit runner does not process resource filters before running

Posted by "Eugene Kuleshov (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNGECLIPSE-189?page=all ]

Eugene Kuleshov closed MNGECLIPSE-189.
--------------------------------------

    Resolution: Incomplete

Closing since additional requiested information is not provided. Feel free to reopen and provide requested info. Thanks.

> JUnit runner does not process resource filters before running
> -------------------------------------------------------------
>
>                 Key: MNGECLIPSE-189
>                 URL: http://jira.codehaus.org/browse/MNGECLIPSE-189
>             Project: Maven 2.x Extension for Eclipse
>          Issue Type: Bug
>    Affects Versions: 0.0.9
>         Environment: Eclipse 3.1.2 Linux
>            Reporter: Jonathan Share
>         Assigned To: Eugene Kuleshov
>            Priority: Trivial
>
> I have a project that uses a resource filter to set the path to some files depending on what platform the developer is on. Using maven on the command line this is processed correctly and the Unit tests pass. However, I wish to use the JUnit runner within eclipse however as my resources do not get filtered before the tests try to load them I get exceptions creating URL objects with ${news.image.url} in them.
> Desired behaviour
> ===============
> This plugin should provide a launcher for the junit runner that first runs the process-resources (apologies if this is wrong, writing from memory here) target and ensure the classpath is configured correctly so that the non processed resources are not available to the JUnit runner before running the JUnit tests.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (MNGECLIPSE-189) JUnit runner does not process resource filters before running

Posted by "Eugene Kuleshov (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNGECLIPSE-189?page=all ]

Eugene Kuleshov updated MNGECLIPSE-189:
---------------------------------------

    Priority: Trivial  (was: Major)

Please attach an example project that can be used to reproduce this issue. Thanks.

> JUnit runner does not process resource filters before running
> -------------------------------------------------------------
>
>                 Key: MNGECLIPSE-189
>                 URL: http://jira.codehaus.org/browse/MNGECLIPSE-189
>             Project: Maven 2.x Extension for Eclipse
>          Issue Type: Bug
>    Affects Versions: 0.0.9
>         Environment: Eclipse 3.1.2 Linux
>            Reporter: Jonathan Share
>         Assigned To: Eugene Kuleshov
>            Priority: Trivial
>
> I have a project that uses a resource filter to set the path to some files depending on what platform the developer is on. Using maven on the command line this is processed correctly and the Unit tests pass. However, I wish to use the JUnit runner within eclipse however as my resources do not get filtered before the tests try to load them I get exceptions creating URL objects with ${news.image.url} in them.
> Desired behaviour
> ===============
> This plugin should provide a launcher for the junit runner that first runs the process-resources (apologies if this is wrong, writing from memory here) target and ensure the classpath is configured correctly so that the non processed resources are not available to the JUnit runner before running the JUnit tests.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MNGECLIPSE-189) JUnit runner does not process resource filters before running

Posted by "Eugene Kuleshov (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNGECLIPSE-189?page=comments#action_77051 ] 
            
Eugene Kuleshov commented on MNGECLIPSE-189:
--------------------------------------------

Folks. Please calm down and reread my last comment. Currently resources are copied to target directory by Eclipse compiler and there is no way to add any filtering in there (without altering Eclipse). So, your best bet is to add Maven builder that would run after Eclipse compiler (Project properties / Builders / Add / Maven builder).

PS: btw, Spring has its own mechanisms to substitute variables, so you may as well use it and leave your spring configs unchanged.

PPS: fyi, if you need to run just one test with maven you can use mvn -Dtest=TestCircle test command. You can even substitute currently selected file in Maven launch configuration. So, size won't matter.

> JUnit runner does not process resource filters before running
> -------------------------------------------------------------
>
>                 Key: MNGECLIPSE-189
>                 URL: http://jira.codehaus.org/browse/MNGECLIPSE-189
>             Project: Maven 2.x Extension for Eclipse
>          Issue Type: Bug
>    Affects Versions: 0.0.9
>         Environment: Eclipse 3.1.2 Linux
>            Reporter: Jonathan Share
>         Assigned To: Eugene Kuleshov
>            Priority: Trivial
>         Attachments: filter-test.zip
>
>
> I have a project that uses a resource filter to set the path to some files depending on what platform the developer is on. Using maven on the command line this is processed correctly and the Unit tests pass. However, I wish to use the JUnit runner within eclipse however as my resources do not get filtered before the tests try to load them I get exceptions creating URL objects with ${news.image.url} in them.
> Desired behaviour
> ===============
> This plugin should provide a launcher for the junit runner that first runs the process-resources (apologies if this is wrong, writing from memory here) target and ensure the classpath is configured correctly so that the non processed resources are not available to the JUnit runner before running the JUnit tests.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MNGECLIPSE-189) JUnit runner does not process resource filters before running

Posted by "Eugene Kuleshov (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNGECLIPSE-189?page=comments#action_75276 ] 
            
Eugene Kuleshov commented on MNGECLIPSE-189:
--------------------------------------------

Milos, we spawn JVM for Maven launcher and set current dir set to pom location, so it would be kinda surprising. But I'll check it once you and Jason will be done with the Embedder...

> JUnit runner does not process resource filters before running
> -------------------------------------------------------------
>
>                 Key: MNGECLIPSE-189
>                 URL: http://jira.codehaus.org/browse/MNGECLIPSE-189
>             Project: Maven 2.x Extension for Eclipse
>          Issue Type: Bug
>    Affects Versions: 0.0.9
>         Environment: Eclipse 3.1.2 Linux
>            Reporter: Jonathan Share
>         Assigned To: Eugene Kuleshov
>            Priority: Trivial
>         Attachments: filter-test.zip
>
>
> I have a project that uses a resource filter to set the path to some files depending on what platform the developer is on. Using maven on the command line this is processed correctly and the Unit tests pass. However, I wish to use the JUnit runner within eclipse however as my resources do not get filtered before the tests try to load them I get exceptions creating URL objects with ${news.image.url} in them.
> Desired behaviour
> ===============
> This plugin should provide a launcher for the junit runner that first runs the process-resources (apologies if this is wrong, writing from memory here) target and ensure the classpath is configured correctly so that the non processed resources are not available to the JUnit runner before running the JUnit tests.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MNGECLIPSE-189) JUnit runner does not process resource filters before running

Posted by "Kenney Westerhof (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNGECLIPSE-189?page=comments#action_77003 ] 
            
Kenney Westerhof commented on MNGECLIPSE-189:
---------------------------------------------

I agree - resources should be filtered. Aren't resources automatically copied after modification (i.e. running the process-resources phase), using filtering if enabled in the pom?

I thought the m2eclipse plugin keeps the target/ up-to-date continuously, like eclipse itself does. 

If it doesn't, then adding a pre-goal to JUnit that depends on the phase before 'test' (however that's done in eclipse) would be nice..?

> JUnit runner does not process resource filters before running
> -------------------------------------------------------------
>
>                 Key: MNGECLIPSE-189
>                 URL: http://jira.codehaus.org/browse/MNGECLIPSE-189
>             Project: Maven 2.x Extension for Eclipse
>          Issue Type: Bug
>    Affects Versions: 0.0.9
>         Environment: Eclipse 3.1.2 Linux
>            Reporter: Jonathan Share
>         Assigned To: Eugene Kuleshov
>            Priority: Trivial
>         Attachments: filter-test.zip
>
>
> I have a project that uses a resource filter to set the path to some files depending on what platform the developer is on. Using maven on the command line this is processed correctly and the Unit tests pass. However, I wish to use the JUnit runner within eclipse however as my resources do not get filtered before the tests try to load them I get exceptions creating URL objects with ${news.image.url} in them.
> Desired behaviour
> ===============
> This plugin should provide a launcher for the junit runner that first runs the process-resources (apologies if this is wrong, writing from memory here) target and ensure the classpath is configured correctly so that the non processed resources are not available to the JUnit runner before running the JUnit tests.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MNGECLIPSE-189) JUnit runner does not process resource filters before running

Posted by "Eugene Kuleshov (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNGECLIPSE-189?page=comments#action_77085 ] 
            
Eugene Kuleshov commented on MNGECLIPSE-189:
--------------------------------------------

It this moment I am not convinced that it will be a good idea. This is not needed for the projects that are not using properties rewrting, but in general we can't tell that without scanning all the properties (which is sounds like a hack to me). More over, some other projects may want to tweak such builder and add some other goals, for example to generate sources.

Also, running maven on the whole source tree on every change of the single resource seem an overkill, so we would need some additional hooks into Maven to have better control on what resources it should run. As well as allow to launch Maven in the same VM as Eclipse...

So, once again, please raise an objective objections against closing this issue as "worksome".

> JUnit runner does not process resource filters before running
> -------------------------------------------------------------
>
>                 Key: MNGECLIPSE-189
>                 URL: http://jira.codehaus.org/browse/MNGECLIPSE-189
>             Project: Maven 2.x Extension for Eclipse
>          Issue Type: Bug
>    Affects Versions: 0.0.9
>         Environment: Eclipse 3.1.2 Linux
>            Reporter: Jonathan Share
>         Assigned To: Eugene Kuleshov
>            Priority: Trivial
>         Attachments: filter-test.zip
>
>
> I have a project that uses a resource filter to set the path to some files depending on what platform the developer is on. Using maven on the command line this is processed correctly and the Unit tests pass. However, I wish to use the JUnit runner within eclipse however as my resources do not get filtered before the tests try to load them I get exceptions creating URL objects with ${news.image.url} in them.
> Desired behaviour
> ===============
> This plugin should provide a launcher for the junit runner that first runs the process-resources (apologies if this is wrong, writing from memory here) target and ensure the classpath is configured correctly so that the non processed resources are not available to the JUnit runner before running the JUnit tests.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MNGECLIPSE-189) JUnit runner does not process resource filters before running

Posted by "Eugene Kuleshov (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNGECLIPSE-189?page=comments#action_76977 ] 
            
Eugene Kuleshov commented on MNGECLIPSE-189:
--------------------------------------------

As of properties... you can always use system properties to specify what params to use or what property file to read, but that is matter of choice of course. In my experience, generated property files rather annoying.

Anyways, if there is no objections, I am going to close this issue.

> JUnit runner does not process resource filters before running
> -------------------------------------------------------------
>
>                 Key: MNGECLIPSE-189
>                 URL: http://jira.codehaus.org/browse/MNGECLIPSE-189
>             Project: Maven 2.x Extension for Eclipse
>          Issue Type: Bug
>    Affects Versions: 0.0.9
>         Environment: Eclipse 3.1.2 Linux
>            Reporter: Jonathan Share
>         Assigned To: Eugene Kuleshov
>            Priority: Trivial
>         Attachments: filter-test.zip
>
>
> I have a project that uses a resource filter to set the path to some files depending on what platform the developer is on. Using maven on the command line this is processed correctly and the Unit tests pass. However, I wish to use the JUnit runner within eclipse however as my resources do not get filtered before the tests try to load them I get exceptions creating URL objects with ${news.image.url} in them.
> Desired behaviour
> ===============
> This plugin should provide a launcher for the junit runner that first runs the process-resources (apologies if this is wrong, writing from memory here) target and ensure the classpath is configured correctly so that the non processed resources are not available to the JUnit runner before running the JUnit tests.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MNGECLIPSE-189) JUnit runner does not process resource filters before running

Posted by "Eugene Kuleshov (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNGECLIPSE-189?page=comments#action_76965 ] 
            
Eugene Kuleshov commented on MNGECLIPSE-189:
--------------------------------------------

I don't think we are going to do anything special here. You basically have two options:

-- Use maven launcher to run your tests (note that you can still put breakpoints in your code and debug trough)

-- Register project maven builder that will process and transform property files (eg. using process-resources and process-test-resources goals). Then run your unit tests.

-- Bonus 3rd option. Change your tests to not depend on generated properties. It is always a good idea.

> JUnit runner does not process resource filters before running
> -------------------------------------------------------------
>
>                 Key: MNGECLIPSE-189
>                 URL: http://jira.codehaus.org/browse/MNGECLIPSE-189
>             Project: Maven 2.x Extension for Eclipse
>          Issue Type: Bug
>    Affects Versions: 0.0.9
>         Environment: Eclipse 3.1.2 Linux
>            Reporter: Jonathan Share
>         Assigned To: Eugene Kuleshov
>            Priority: Trivial
>         Attachments: filter-test.zip
>
>
> I have a project that uses a resource filter to set the path to some files depending on what platform the developer is on. Using maven on the command line this is processed correctly and the Unit tests pass. However, I wish to use the JUnit runner within eclipse however as my resources do not get filtered before the tests try to load them I get exceptions creating URL objects with ${news.image.url} in them.
> Desired behaviour
> ===============
> This plugin should provide a launcher for the junit runner that first runs the process-resources (apologies if this is wrong, writing from memory here) target and ensure the classpath is configured correctly so that the non processed resources are not available to the JUnit runner before running the JUnit tests.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Reopened: (MNGECLIPSE-189) JUnit runner does not process resource filters before running

Posted by "Jonathan Share (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNGECLIPSE-189?page=all ]

Jonathan Share reopened MNGECLIPSE-189:
---------------------------------------

             
Sorry for the delay providing a test case, I have been ill and overloaded at work. :-D

> JUnit runner does not process resource filters before running
> -------------------------------------------------------------
>
>                 Key: MNGECLIPSE-189
>                 URL: http://jira.codehaus.org/browse/MNGECLIPSE-189
>             Project: Maven 2.x Extension for Eclipse
>          Issue Type: Bug
>    Affects Versions: 0.0.9
>         Environment: Eclipse 3.1.2 Linux
>            Reporter: Jonathan Share
>         Assigned To: Eugene Kuleshov
>            Priority: Trivial
>
> I have a project that uses a resource filter to set the path to some files depending on what platform the developer is on. Using maven on the command line this is processed correctly and the Unit tests pass. However, I wish to use the JUnit runner within eclipse however as my resources do not get filtered before the tests try to load them I get exceptions creating URL objects with ${news.image.url} in them.
> Desired behaviour
> ===============
> This plugin should provide a launcher for the junit runner that first runs the process-resources (apologies if this is wrong, writing from memory here) target and ensure the classpath is configured correctly so that the non processed resources are not available to the JUnit runner before running the JUnit tests.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MNGECLIPSE-189) JUnit runner does not process resource filters before running

Posted by "Jonathan Share (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNGECLIPSE-189?page=comments#action_77005 ] 
            
Jonathan Share commented on MNGECLIPSE-189:
-------------------------------------------

1) This would be a pita when the test suite reaches a particular size.

2) This sounds like what I want, but I have no idea where to start myself. When the IDEA maven plugin sees a resources directory that has a filter specified it does not add it as a source directory leaving all of the work to the process-resources and process-test-resources of maven. This works most of the time, but occasionaly it seems that the runner doesn't spot that the source files have been changed.

3) I generate a properties file for a simple test case. The real use case is my spring config files, currently I have 2 developers on windows, I run on Linux and the deployment environment is Linux (and I use different paths for some things depending on whether it is a test deployment or production deployment). There is no way I want to maintain separate spring config files for all of these scenarios.

> JUnit runner does not process resource filters before running
> -------------------------------------------------------------
>
>                 Key: MNGECLIPSE-189
>                 URL: http://jira.codehaus.org/browse/MNGECLIPSE-189
>             Project: Maven 2.x Extension for Eclipse
>          Issue Type: Bug
>    Affects Versions: 0.0.9
>         Environment: Eclipse 3.1.2 Linux
>            Reporter: Jonathan Share
>         Assigned To: Eugene Kuleshov
>            Priority: Trivial
>         Attachments: filter-test.zip
>
>
> I have a project that uses a resource filter to set the path to some files depending on what platform the developer is on. Using maven on the command line this is processed correctly and the Unit tests pass. However, I wish to use the JUnit runner within eclipse however as my resources do not get filtered before the tests try to load them I get exceptions creating URL objects with ${news.image.url} in them.
> Desired behaviour
> ===============
> This plugin should provide a launcher for the junit runner that first runs the process-resources (apologies if this is wrong, writing from memory here) target and ensure the classpath is configured correctly so that the non processed resources are not available to the JUnit runner before running the JUnit tests.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MNGECLIPSE-189) JUnit runner does not process resource filters before running

Posted by "Sami Dalouche (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNGECLIPSE-189?page=comments#action_76961 ] 
            
Sami Dalouche commented on MNGECLIPSE-189:
------------------------------------------

I am using Eclipse 3.2 on Linux.

Just to confirm that adding ${basedir}/resource/dir does not help. So, the problem must come from somewhere else...

Sami Dalouche

> JUnit runner does not process resource filters before running
> -------------------------------------------------------------
>
>                 Key: MNGECLIPSE-189
>                 URL: http://jira.codehaus.org/browse/MNGECLIPSE-189
>             Project: Maven 2.x Extension for Eclipse
>          Issue Type: Bug
>    Affects Versions: 0.0.9
>         Environment: Eclipse 3.1.2 Linux
>            Reporter: Jonathan Share
>         Assigned To: Eugene Kuleshov
>            Priority: Trivial
>         Attachments: filter-test.zip
>
>
> I have a project that uses a resource filter to set the path to some files depending on what platform the developer is on. Using maven on the command line this is processed correctly and the Unit tests pass. However, I wish to use the JUnit runner within eclipse however as my resources do not get filtered before the tests try to load them I get exceptions creating URL objects with ${news.image.url} in them.
> Desired behaviour
> ===============
> This plugin should provide a launcher for the junit runner that first runs the process-resources (apologies if this is wrong, writing from memory here) target and ensure the classpath is configured correctly so that the non processed resources are not available to the JUnit runner before running the JUnit tests.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MNGECLIPSE-189) JUnit runner does not process resource filters before running

Posted by "Walco van Loon (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNGECLIPSE-189?page=comments#action_77000 ] 
            
Walco van Loon commented on MNGECLIPSE-189:
-------------------------------------------

Eugene: I'm a bit surprised by your POV. Resource filtering is a base Maven feature. The fact that it's not supported by m2eclipse leads to environmental differences between maven and eclipse - I thought that eliminating that gap is all m2eclipse is about. Why would keeping resources in sync any different than keeping the classpath in sync? 

> JUnit runner does not process resource filters before running
> -------------------------------------------------------------
>
>                 Key: MNGECLIPSE-189
>                 URL: http://jira.codehaus.org/browse/MNGECLIPSE-189
>             Project: Maven 2.x Extension for Eclipse
>          Issue Type: Bug
>    Affects Versions: 0.0.9
>         Environment: Eclipse 3.1.2 Linux
>            Reporter: Jonathan Share
>         Assigned To: Eugene Kuleshov
>            Priority: Trivial
>         Attachments: filter-test.zip
>
>
> I have a project that uses a resource filter to set the path to some files depending on what platform the developer is on. Using maven on the command line this is processed correctly and the Unit tests pass. However, I wish to use the JUnit runner within eclipse however as my resources do not get filtered before the tests try to load them I get exceptions creating URL objects with ${news.image.url} in them.
> Desired behaviour
> ===============
> This plugin should provide a launcher for the junit runner that first runs the process-resources (apologies if this is wrong, writing from memory here) target and ensure the classpath is configured correctly so that the non processed resources are not available to the JUnit runner before running the JUnit tests.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MNGECLIPSE-189) JUnit runner does not process resource filters before running

Posted by "Jonathan Share (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNGECLIPSE-189?page=comments#action_77053 ] 
            
Jonathan Share commented on MNGECLIPSE-189:
-------------------------------------------

Thanks for the input on how to add a Builder. This appears to solve my problem. Is it not possible for the m2eclipse plugin to add this builder automatically when you "enable" m2 on a project ?

> JUnit runner does not process resource filters before running
> -------------------------------------------------------------
>
>                 Key: MNGECLIPSE-189
>                 URL: http://jira.codehaus.org/browse/MNGECLIPSE-189
>             Project: Maven 2.x Extension for Eclipse
>          Issue Type: Bug
>    Affects Versions: 0.0.9
>         Environment: Eclipse 3.1.2 Linux
>            Reporter: Jonathan Share
>         Assigned To: Eugene Kuleshov
>            Priority: Trivial
>         Attachments: filter-test.zip
>
>
> I have a project that uses a resource filter to set the path to some files depending on what platform the developer is on. Using maven on the command line this is processed correctly and the Unit tests pass. However, I wish to use the JUnit runner within eclipse however as my resources do not get filtered before the tests try to load them I get exceptions creating URL objects with ${news.image.url} in them.
> Desired behaviour
> ===============
> This plugin should provide a launcher for the junit runner that first runs the process-resources (apologies if this is wrong, writing from memory here) target and ensure the classpath is configured correctly so that the non processed resources are not available to the JUnit runner before running the JUnit tests.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MNGECLIPSE-189) JUnit runner does not process resource filters before running

Posted by "Sami Dalouche (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNGECLIPSE-189?page=comments#action_76976 ] 
            
Sami Dalouche commented on MNGECLIPSE-189:
------------------------------------------

Hi,

Concerning the 1st option : thanks for the option, always good to know we can debug tests that way :)

Concerning the 2nd option... I guess it is doable. I am going to try that. Seems like a good compromise to me.

Concerning the 3rd option : actually, it is not always possible not to depend on generated properties.. Consider a case where there are several Profiles, and each profile defines a set of options (database connection, etc), that is different from the other environments. 
So, in that case (which is sadly mine), it is not possible to hard code the  values inside the configuration files...



> JUnit runner does not process resource filters before running
> -------------------------------------------------------------
>
>                 Key: MNGECLIPSE-189
>                 URL: http://jira.codehaus.org/browse/MNGECLIPSE-189
>             Project: Maven 2.x Extension for Eclipse
>          Issue Type: Bug
>    Affects Versions: 0.0.9
>         Environment: Eclipse 3.1.2 Linux
>            Reporter: Jonathan Share
>         Assigned To: Eugene Kuleshov
>            Priority: Trivial
>         Attachments: filter-test.zip
>
>
> I have a project that uses a resource filter to set the path to some files depending on what platform the developer is on. Using maven on the command line this is processed correctly and the Unit tests pass. However, I wish to use the JUnit runner within eclipse however as my resources do not get filtered before the tests try to load them I get exceptions creating URL objects with ${news.image.url} in them.
> Desired behaviour
> ===============
> This plugin should provide a launcher for the junit runner that first runs the process-resources (apologies if this is wrong, writing from memory here) target and ensure the classpath is configured correctly so that the non processed resources are not available to the JUnit runner before running the JUnit tests.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MNGECLIPSE-189) JUnit runner does not process resource filters before running

Posted by "Milos Kleint (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNGECLIPSE-189?page=comments#action_75275 ] 
            
Milos Kleint commented on MNGECLIPSE-189:
-----------------------------------------

Eugene, probably a duplicate of MRESOURCES-32. 
The problem is the resource's basedir property value. In embedded environment relative paths fail when passed to DirectoryScanner. a workaround is to include ${basedir} variable..



> JUnit runner does not process resource filters before running
> -------------------------------------------------------------
>
>                 Key: MNGECLIPSE-189
>                 URL: http://jira.codehaus.org/browse/MNGECLIPSE-189
>             Project: Maven 2.x Extension for Eclipse
>          Issue Type: Bug
>    Affects Versions: 0.0.9
>         Environment: Eclipse 3.1.2 Linux
>            Reporter: Jonathan Share
>         Assigned To: Eugene Kuleshov
>            Priority: Trivial
>         Attachments: filter-test.zip
>
>
> I have a project that uses a resource filter to set the path to some files depending on what platform the developer is on. Using maven on the command line this is processed correctly and the Unit tests pass. However, I wish to use the JUnit runner within eclipse however as my resources do not get filtered before the tests try to load them I get exceptions creating URL objects with ${news.image.url} in them.
> Desired behaviour
> ===============
> This plugin should provide a launcher for the junit runner that first runs the process-resources (apologies if this is wrong, writing from memory here) target and ensure the classpath is configured correctly so that the non processed resources are not available to the JUnit runner before running the JUnit tests.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira