Details

    1. compiler-harness.patch
      15 kB
      Jesse McConnell
    2. jar-harness.patch
      4 kB
      Jesse McConnell
    3. maven-compiler-plugin.jar
      86 kB
      Jesse McConnell
    4. maven-jar-plugin.jar
      134 kB
      Jesse McConnell
    5. maven-project.patch
      0.5 kB
      Jesse McConnell

      Issue Links

        Activity

        Hide
        Brett Porter added a comment -

        any clues on what you wanted here? is it covered by the integration testing?

        Show
        Brett Porter added a comment - any clues on what you wanted here? is it covered by the integration testing?
        Hide
        Dave Sag added a comment -

        I came to this topic looking for a way to test maven mojos. How are other people writing unit tests for their mojo code?

        dave

        Show
        Dave Sag added a comment - I came to this topic looking for a way to test maven mojos. How are other people writing unit tests for their mojo code? dave
        Hide
        Corridor Software Developer added a comment -

        I am Dave. Kenney Westerhof pointed me to the apache maven sandbox for an example test project runner maven-it-plugin used for integration tests:

        https://svn.apache.org/repos/asf/maven/sandbox/plugins/

        Still working on using it with the xmlbeans maven plugin.

        Show
        Corridor Software Developer added a comment - I am Dave. Kenney Westerhof pointed me to the apache maven sandbox for an example test project runner maven-it-plugin used for integration tests: https://svn.apache.org/repos/asf/maven/sandbox/plugins/ Still working on using it with the xmlbeans maven plugin.
        Hide
        Jerome Lacoste added a comment -

        Strangely, this issue doesn't have a priority (priority.none).

        Show
        Jerome Lacoste added a comment - Strangely, this issue doesn't have a priority (priority.none).
        Hide
        Jesse McConnell added a comment -

        oh handy, went looking for a jira ticket on this and there it is all assigned to me and everything.

        I think the plugin testing harness is moderately useful at this point with a couple of caveats...

        I have/or will be soon commiting something that will break it from building against 2.1-SNAPSHOT. That is because to get the StubMavenProject to be instantiated and populated we need an empty constructor on the MavenProject instance I am extending. I have the local change on that but will talk to brett or jason about getting that worked out when I see then again.

        On this issue I will also attach the working example of the maven-compiler-plugin where you can see it in action. I'll also attach the simple case for the maven-jar-plugin since that shows how to fill out the maven project stub

        I should also say the maven project stub is really dumb at this point and as functionality is needed on it we can implement that as we go.

        Show
        Jesse McConnell added a comment - oh handy, went looking for a jira ticket on this and there it is all assigned to me and everything. I think the plugin testing harness is moderately useful at this point with a couple of caveats... I have/or will be soon commiting something that will break it from building against 2.1-SNAPSHOT. That is because to get the StubMavenProject to be instantiated and populated we need an empty constructor on the MavenProject instance I am extending. I have the local change on that but will talk to brett or jason about getting that worked out when I see then again. On this issue I will also attach the working example of the maven-compiler-plugin where you can see it in action. I'll also attach the simple case for the maven-jar-plugin since that shows how to fill out the maven project stub I should also say the maven project stub is really dumb at this point and as functionality is needed on it we can implement that as we go.
        Hide
        Jesse McConnell added a comment -

        mojo/mojo-sandbox/maven-plugin-testing/maven-plugin-testing-harness

        that is the location of the actual plugin...

        I'll write up a confluence page on how to use it more and some things to consider and post the url here later

        Show
        Jesse McConnell added a comment - mojo/mojo-sandbox/maven-plugin-testing/maven-plugin-testing-harness that is the location of the actual plugin... I'll write up a confluence page on how to use it more and some things to consider and post the url here later
        Show
        Jesse McConnell added a comment - http://docs.codehaus.org/display/MAVEN/Maven+Plugin+Harness
        Hide
        Jesse McConnell added a comment -

        I was able to get the maven-site-plugin instantiated by adding the plugin harness test dependency and update the maven -site-plugin pom reference to maven-artifact.

        IMO that is going to be the biggest limiting factor to this approach, reconsiling the version of dependencies. I have added a mess of dependencies to the plugin-testing-harness pom but they are not used if the project in question has a different version of the dependency, like with the site plugin.

        At this point I think we are left with individual details for the framework on a per plugin basis. I implemented most of the maven project stub this morning so it is mostly useful, missing some things but for basic usage should be in decent shape.

        Show
        Jesse McConnell added a comment - I was able to get the maven-site-plugin instantiated by adding the plugin harness test dependency and update the maven -site-plugin pom reference to maven-artifact. IMO that is going to be the biggest limiting factor to this approach, reconsiling the version of dependencies. I have added a mess of dependencies to the plugin-testing-harness pom but they are not used if the project in question has a different version of the dependency, like with the site plugin. At this point I think we are left with individual details for the framework on a per plugin basis. I implemented most of the maven project stub this morning so it is mostly useful, missing some things but for basic usage should be in decent shape.
        Hide
        Jesse McConnell added a comment -

        two patches for the jar plugin and the compiler plugin to make use of the harness...

        added brett as a watcher since he said he would make release a snapshot of the harness and then apply these patchs as examples to work from.

        Show
        Jesse McConnell added a comment - two patches for the jar plugin and the compiler plugin to make use of the harness... added brett as a watcher since he said he would make release a snapshot of the harness and then apply these patchs as examples to work from.
        Hide
        Jesse McConnell added a comment -

        fyi:

        this will not compile util we get the MavenProject class to have an empty constructor, I had arranged to have that taken care of but it doesn't look like it has been yet so that is a bit of a hurdle to using this

        I'll include that patch to this issue and hopefully a kind individual can apply it to the trunk

        Show
        Jesse McConnell added a comment - fyi: this will not compile util we get the MavenProject class to have an empty constructor, I had arranged to have that taken care of but it doesn't look like it has been yet so that is a bit of a hurdle to using this I'll include that patch to this issue and hopefully a kind individual can apply it to the trunk
        Hide
        Brett Porter added a comment -

        imported to sandbox

        Show
        Brett Porter added a comment - imported to sandbox

          People

          • Assignee:
            Jesse McConnell
            Reporter:
            Jason van Zyl
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development