jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
Signup
Maven 2 & 3
  • Maven 2 & 3
  • MNG-32

Plugin test harness

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Task Task
  • Status: Closed Closed
  • Priority: Blocker Blocker
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: Design, Patterns & Best Practices, Plugin API, Sites & Reporting
  • Labels:
    None
  • Number of attachments :
    5
  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. Text File
    compiler-harness.patch
    15/Mar/06 8:12 PM
    15 kB
    Jesse McConnell
  2. Text File
    jar-harness.patch
    15/Mar/06 8:12 PM
    4 kB
    Jesse McConnell
  3. Hide
    Java Archive File
    maven-compiler-plugin.jar
    10/Mar/06 12:54 PM
    86 kB
    Jesse McConnell
    1. File
      META-INF/MANIFEST.MF 0.1 kB
    2. File
      maven-compiler-plugin/.classpath 1 kB
    3. File
      maven-compiler-plugin/.pom.xml.swp 12 kB
    4. File
      maven-compiler-plugin/.project 0.3 kB
    5. File
      maven-compiler-plugin/.svn/dir-prop-base 0.1 kB
    6. File
      maven-compiler-plugin/.svn/dir-props 0.1 kB
    7. File
      maven-compiler-plugin/.svn/dir-wcprops 0.1 kB
    8. File
      maven-compiler-plugin/.svn/empty-file 0.0 kB
    9. File
      maven-compiler-plugin/.svn/entries 0.7 kB
    10. File
      maven-compiler-plugin/.svn/format 0.0 kB
    11. File
      maven-compiler-plugin/.../pom.xml.svn-base 0.1 kB
    12. File
      maven-compiler-plugin/.../pom.xml.svn-work 0.1 kB
    13. Text File
      maven-compiler-plugin/.svn/README.txt 0.1 kB
    14. File
      maven-compiler-plugin/.../pom.xml.svn-base 1 kB
    15. File
      maven-compiler-plugin/.../pom.xml.svn-work 0.1 kB
    16. File
      maven-compiler-plugin/cobertura.ser 13 kB
    17. File
      maven-compiler-plugin/maven-compiler-plugin.iml 11 kB
    18. File
      maven-compiler-plugin/maven-compiler-plugin.ipr 4 kB
    19. File
      maven-compiler-plugin/maven-compiler-plugin.iws 16 kB
    20. XML File
      maven-compiler-plugin/pom.xml 2 kB
    21. File
      maven-compiler-plugin/src/.../dir-wcprops 0.1 kB
    22. File
      maven-compiler-plugin/src/.../empty-file 0.0 kB
    23. File
      maven-compiler-plugin/src/.svn/entries 0.4 kB
    24. File
      maven-compiler-plugin/src/.svn/format 0.0 kB
    25. Text File
      maven-compiler-plugin/src/.../README.txt 0.1 kB
    26. File
      maven-compiler-plugin/src/.../dir-wcprops 0.1 kB
    27. File
      maven-compiler-plugin/src/.../empty-file 0.0 kB
    28. File
      maven-compiler-plugin/src/.../.svn/entries 0.4 kB
    29. File
      maven-compiler-plugin/src/.../.svn/format 0.0 kB
    30. Text File
      maven-compiler-plugin/src/.../README.txt 0.1 kB
    Showing 30 of 110 items Download Zip
    Show
    Java Archive File
    maven-compiler-plugin.jar
    10/Mar/06 12:54 PM
    86 kB
    Jesse McConnell
  4. Hide
    Java Archive File
    maven-jar-plugin.jar
    10/Mar/06 12:55 PM
    134 kB
    Jesse McConnell
    1. File
      META-INF/MANIFEST.MF 0.1 kB
    2. File
      maven-jar-plugin/.classpath 2 kB
    3. File
      maven-jar-plugin/.project 0.3 kB
    4. File
      maven-jar-plugin/.svn/dir-prop-base 0.1 kB
    5. File
      maven-jar-plugin/.svn/dir-props 0.1 kB
    6. File
      maven-jar-plugin/.svn/dir-wcprops 0.1 kB
    7. File
      maven-jar-plugin/.svn/empty-file 0.0 kB
    8. File
      maven-jar-plugin/.svn/entries 0.7 kB
    9. File
      maven-jar-plugin/.svn/format 0.0 kB
    10. File
      maven-jar-plugin/.svn/.../pom.xml.svn-base 0.1 kB
    11. File
      maven-jar-plugin/.svn/.../pom.xml.svn-work 0.1 kB
    12. Text File
      maven-jar-plugin/.svn/README.txt 0.1 kB
    13. File
      maven-jar-plugin/.svn/.../pom.xml.svn-base 1 kB
    14. File
      maven-jar-plugin/.svn/.../pom.xml.svn-work 0.1 kB
    15. File
      maven-jar-plugin/maven-jar-plugin.iml 6 kB
    16. File
      maven-jar-plugin/maven-jar-plugin.ipr 4 kB
    17. File
      maven-jar-plugin/maven-jar-plugin.iws 15 kB
    18. XML File
      maven-jar-plugin/pom.xml 2 kB
    19. File
      maven-jar-plugin/src/.svn/dir-wcprops 0.1 kB
    20. File
      maven-jar-plugin/src/.svn/empty-file 0.0 kB
    21. File
      maven-jar-plugin/src/.svn/entries 0.5 kB
    22. File
      maven-jar-plugin/src/.svn/format 0.0 kB
    23. Text File
      maven-jar-plugin/src/.svn/README.txt 0.1 kB
    24. File
      maven-jar-plugin/src/.../.svn/dir-wcprops 0.1 kB
    25. File
      maven-jar-plugin/src/.../.svn/empty-file 0.0 kB
    26. File
      maven-jar-plugin/src/main/.svn/entries 0.4 kB
    27. File
      maven-jar-plugin/src/main/.svn/format 0.0 kB
    28. Text File
      maven-jar-plugin/src/.../.svn/README.txt 0.1 kB
    29. File
      maven-jar-plugin/src/.../.svn/dir-wcprops 0.1 kB
    30. File
      maven-jar-plugin/src/.../.svn/empty-file 0.0 kB
    Showing 30 of 185 items Download Zip
    Show
    Java Archive File
    maven-jar-plugin.jar
    10/Mar/06 12:55 PM
    134 kB
    Jesse McConnell
  5. Text File
    maven-project.patch
    17/Mar/06 11:48 AM
    0.5 kB
    Jesse McConnell

Issue Links

is depended upon by

Improvement - An improvement or enhancement to an existing feature or task. MCLEAN-8 conversion of the existing unit tests to use the AbstractMojoTestCase from the plugin testing harness

  • Major - Major loss of function.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Brett Porter added a comment - 11/Apr/05 9:05 AM

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

Show
Brett Porter added a comment - 11/Apr/05 9:05 AM any clues on what you wanted here? is it covered by the integration testing?
Hide
Permalink
Dave Sag added a comment - 11/Nov/05 8:28 AM

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 - 11/Nov/05 8:28 AM 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
Permalink
Corridor Software Developer added a comment - 16/Nov/05 9:44 AM

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 - 16/Nov/05 9:44 AM 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
Permalink
Jerome Lacoste added a comment - 05/Mar/06 3:52 AM

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

Show
Jerome Lacoste added a comment - 05/Mar/06 3:52 AM Strangely, this issue doesn't have a priority (priority.none).
Hide
Permalink
Jesse McConnell added a comment - 10/Mar/06 12:53 PM

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 - 10/Mar/06 12:53 PM 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
Permalink
Jesse McConnell added a comment - 10/Mar/06 12:58 PM

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 - 10/Mar/06 12:58 PM 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
Hide
Permalink
Jesse McConnell added a comment - 10/Mar/06 1:53 PM

http://docs.codehaus.org/display/MAVEN/Maven+Plugin+Harness

Show
Jesse McConnell added a comment - 10/Mar/06 1:53 PM http://docs.codehaus.org/display/MAVEN/Maven+Plugin+Harness
Hide
Permalink
Jesse McConnell added a comment - 13/Mar/06 12:56 PM

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 - 13/Mar/06 12:56 PM 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
Permalink
Jesse McConnell added a comment - 15/Mar/06 8:12 PM

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 - 15/Mar/06 8:12 PM 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
Permalink
Jesse McConnell added a comment - 17/Mar/06 11:48 AM

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 - 17/Mar/06 11:48 AM 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
Permalink
Brett Porter added a comment - 23/Mar/06 9:43 PM

imported to sandbox

Show
Brett Porter added a comment - 23/Mar/06 9:43 PM imported to sandbox

People

  • Assignee:
    Jesse McConnell
    Reporter:
    Jason van Zyl
Vote (0)
Watch (1)

Dates

  • Created:
    22/Jul/04 12:12 PM
    Updated:
    17/Jun/07 7:44 PM
    Resolved:
    23/Mar/06 9:43 PM
  • Atlassian JIRA (v5.2.7#850-sha1:b2af0c8)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.