You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by "fabrizio giustina (JIRA)" <ji...@codehaus.org> on 2005/11/04 10:10:06 UTC

[jira] Created: (MNG-1421) provide a way to test plugins without installing them

provide a way to test plugins without installing them
-----------------------------------------------------

         Key: MNG-1421
         URL: http://jira.codehaus.org/browse/MNG-1421
     Project: Maven 2
        Type: Improvement
  Components: maven-core  
    Versions: 2.0    
    Reporter: fabrizio giustina


Sometimes unit tests for plugins can't be really affordable (other than harder to write) when not using a "real" maven execution. Manually setting needed properties in the Mojo and calling execute() is error prone, doesn't test real parameters from pom.xml, and it's hard to deal wih multiprojects...

Maven should provide a way to test plugins without installing them and a base class for testing. Ideally, plugins found on the classpath should always be used instead of the currently installed version. (btw, that's how also the Eclipse plugin environment work: when a plugin is found on the classpath, it's loaded and the currently installed version is ignored).

A plugin test should be easy to write just like:
MavenTest maven = new MavenTest(); // load a new maven test instances, plugins found in classpath override installed ones
maven.setBaseDir(basedir);
maven.setProfile(myprofile);
maven.execute("eclipse:eclipse")

At the moment this is really needed in the site plugin and eclipse plugin (actually some tests are performed executing maven from command line)



-- 
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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


[jira] Commented: (MNG-1421) provide a way to test plugins without installing them

Posted by "Jason van Zyl (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-1421?page=comments#action_50108 ] 

Jason van Zyl commented on MNG-1421:
------------------------------------

This a candidate for best practices on testing plugins i.e. let's put it in the "best practices" component.

> provide a way to test plugins without installing them
> -----------------------------------------------------
>
>          Key: MNG-1421
>          URL: http://jira.codehaus.org/browse/MNG-1421
>      Project: Maven 2
>         Type: Improvement
>   Components: maven-core
>     Versions: 2.0
>     Reporter: fabrizio giustina

>
>
> Sometimes unit tests for plugins can't be really affordable (other than harder to write) when not using a "real" maven execution. Manually setting needed properties in the Mojo and calling execute() is error prone, doesn't test real parameters from pom.xml, and it's hard to deal wih multiprojects...
> Maven should provide a way to test plugins without installing them and a base class for testing. Ideally, plugins found on the classpath should always be used instead of the currently installed version. (btw, that's how also the Eclipse plugin environment work: when a plugin is found on the classpath, it's loaded and the currently installed version is ignored).
> A plugin test should be easy to write just like:
> MavenTest maven = new MavenTest(); // load a new maven test instances, plugins found in classpath override installed ones
> maven.setBaseDir(basedir);
> maven.setProfile(myprofile);
> maven.execute("eclipse:eclipse")
> At the moment this is really needed in the site plugin and eclipse plugin (actually some tests are performed executing maven from command line)

-- 
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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


[jira] Commented: (MNG-1421) provide a way to test plugins without installing them

Posted by "fabrizio giustina (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-1421?page=comments#action_50076 ] 

fabrizio giustina commented on MNG-1421:
----------------------------------------

Thanks for the pointer Vincent

however, apart from the missing settings support, it seems that when using MavenEmbedder I can't run a multiproject build: modules included in the parsed pom are ignored, and passing a list of poms has a totally different result (no reactor build). Is this supported in some way?

> provide a way to test plugins without installing them
> -----------------------------------------------------
>
>          Key: MNG-1421
>          URL: http://jira.codehaus.org/browse/MNG-1421
>      Project: Maven 2
>         Type: Improvement
>   Components: maven-core
>     Versions: 2.0
>     Reporter: fabrizio giustina

>
>
> Sometimes unit tests for plugins can't be really affordable (other than harder to write) when not using a "real" maven execution. Manually setting needed properties in the Mojo and calling execute() is error prone, doesn't test real parameters from pom.xml, and it's hard to deal wih multiprojects...
> Maven should provide a way to test plugins without installing them and a base class for testing. Ideally, plugins found on the classpath should always be used instead of the currently installed version. (btw, that's how also the Eclipse plugin environment work: when a plugin is found on the classpath, it's loaded and the currently installed version is ignored).
> A plugin test should be easy to write just like:
> MavenTest maven = new MavenTest(); // load a new maven test instances, plugins found in classpath override installed ones
> maven.setBaseDir(basedir);
> maven.setProfile(myprofile);
> maven.execute("eclipse:eclipse")
> At the moment this is really needed in the site plugin and eclipse plugin (actually some tests are performed executing maven from command line)

-- 
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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


[jira] Commented: (MNG-1421) provide a way to test plugins without installing them

Posted by "Vincent Massol (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-1421?page=comments#action_50027 ] 

Vincent Massol commented on MNG-1421:
-------------------------------------

Hi Fabrizio,

This is already possible using either the maven-it-plugin (in the sandbbox) or using the Maven embedder in your test (see for example: http://svn.cargo.codehaus.org/cargo/trunk/samples/extensions/maven2/src/test/it/org/codehaus/cargo/samples/maven2/)

> provide a way to test plugins without installing them
> -----------------------------------------------------
>
>          Key: MNG-1421
>          URL: http://jira.codehaus.org/browse/MNG-1421
>      Project: Maven 2
>         Type: Improvement
>   Components: maven-core
>     Versions: 2.0
>     Reporter: fabrizio giustina

>
>
> Sometimes unit tests for plugins can't be really affordable (other than harder to write) when not using a "real" maven execution. Manually setting needed properties in the Mojo and calling execute() is error prone, doesn't test real parameters from pom.xml, and it's hard to deal wih multiprojects...
> Maven should provide a way to test plugins without installing them and a base class for testing. Ideally, plugins found on the classpath should always be used instead of the currently installed version. (btw, that's how also the Eclipse plugin environment work: when a plugin is found on the classpath, it's loaded and the currently installed version is ignored).
> A plugin test should be easy to write just like:
> MavenTest maven = new MavenTest(); // load a new maven test instances, plugins found in classpath override installed ones
> maven.setBaseDir(basedir);
> maven.setProfile(myprofile);
> maven.execute("eclipse:eclipse")
> At the moment this is really needed in the site plugin and eclipse plugin (actually some tests are performed executing maven from command line)

-- 
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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


[jira] Commented: (MNG-1421) provide a way to test plugins without installing them

Posted by "Vincent Massol (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-1421?page=comments#action_50028 ] 

Vincent Massol commented on MNG-1421:
-------------------------------------

Just a note: The embedder currently does not support setting profiles but I believe Jason is working on it...

> provide a way to test plugins without installing them
> -----------------------------------------------------
>
>          Key: MNG-1421
>          URL: http://jira.codehaus.org/browse/MNG-1421
>      Project: Maven 2
>         Type: Improvement
>   Components: maven-core
>     Versions: 2.0
>     Reporter: fabrizio giustina

>
>
> Sometimes unit tests for plugins can't be really affordable (other than harder to write) when not using a "real" maven execution. Manually setting needed properties in the Mojo and calling execute() is error prone, doesn't test real parameters from pom.xml, and it's hard to deal wih multiprojects...
> Maven should provide a way to test plugins without installing them and a base class for testing. Ideally, plugins found on the classpath should always be used instead of the currently installed version. (btw, that's how also the Eclipse plugin environment work: when a plugin is found on the classpath, it's loaded and the currently installed version is ignored).
> A plugin test should be easy to write just like:
> MavenTest maven = new MavenTest(); // load a new maven test instances, plugins found in classpath override installed ones
> maven.setBaseDir(basedir);
> maven.setProfile(myprofile);
> maven.execute("eclipse:eclipse")
> At the moment this is really needed in the site plugin and eclipse plugin (actually some tests are performed executing maven from command line)

-- 
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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


[jira] Commented: (MNG-1421) provide a way to test plugins without installing them

Posted by "Vincent Massol (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-1421?page=comments#action_50096 ] 

Vincent Massol commented on MNG-1421:
-------------------------------------

Yes, the embedder still has some limitations. See http://jira.codehaus.org/secure/IssueNavigator.jspa?reset=true&mode=hide&pid=10500&sorter/order=DESC&sorter/field=priority&resolution=-1&component=11850

Jason is working on them. WRT to your last point, I think Jason said he might need to turn a flag on to activate this.

> provide a way to test plugins without installing them
> -----------------------------------------------------
>
>          Key: MNG-1421
>          URL: http://jira.codehaus.org/browse/MNG-1421
>      Project: Maven 2
>         Type: Improvement
>   Components: maven-core
>     Versions: 2.0
>     Reporter: fabrizio giustina

>
>
> Sometimes unit tests for plugins can't be really affordable (other than harder to write) when not using a "real" maven execution. Manually setting needed properties in the Mojo and calling execute() is error prone, doesn't test real parameters from pom.xml, and it's hard to deal wih multiprojects...
> Maven should provide a way to test plugins without installing them and a base class for testing. Ideally, plugins found on the classpath should always be used instead of the currently installed version. (btw, that's how also the Eclipse plugin environment work: when a plugin is found on the classpath, it's loaded and the currently installed version is ignored).
> A plugin test should be easy to write just like:
> MavenTest maven = new MavenTest(); // load a new maven test instances, plugins found in classpath override installed ones
> maven.setBaseDir(basedir);
> maven.setProfile(myprofile);
> maven.execute("eclipse:eclipse")
> At the moment this is really needed in the site plugin and eclipse plugin (actually some tests are performed executing maven from command line)

-- 
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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


[jira] Closed: (MNG-1421) provide a way to test plugins without installing them

Posted by "fabrizio giustina (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-1421?page=all ]
     
fabrizio giustina closed MNG-1421:
----------------------------------

    Resolution: Duplicate

this issue can be closed, missing features in embedder are already traked by
MNG-1181 MavenEmbedder.execute() doesn't run reactor modules
MNG-1083 Provide read/write methods for manipulating Maven settings

> provide a way to test plugins without installing them
> -----------------------------------------------------
>
>          Key: MNG-1421
>          URL: http://jira.codehaus.org/browse/MNG-1421
>      Project: Maven 2
>         Type: Improvement
>   Components: maven-core
>     Versions: 2.0
>     Reporter: fabrizio giustina

>
>
> Sometimes unit tests for plugins can't be really affordable (other than harder to write) when not using a "real" maven execution. Manually setting needed properties in the Mojo and calling execute() is error prone, doesn't test real parameters from pom.xml, and it's hard to deal wih multiprojects...
> Maven should provide a way to test plugins without installing them and a base class for testing. Ideally, plugins found on the classpath should always be used instead of the currently installed version. (btw, that's how also the Eclipse plugin environment work: when a plugin is found on the classpath, it's loaded and the currently installed version is ignored).
> A plugin test should be easy to write just like:
> MavenTest maven = new MavenTest(); // load a new maven test instances, plugins found in classpath override installed ones
> maven.setBaseDir(basedir);
> maven.setProfile(myprofile);
> maven.execute("eclipse:eclipse")
> At the moment this is really needed in the site plugin and eclipse plugin (actually some tests are performed executing maven from command line)

-- 
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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org