Maven Plugin Testing
  1. Maven Plugin Testing
  2. MPLUGINTESTING-23

Provide a way to create fully configured mojo instance

    Details

    • Type: New Feature New Feature
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-alpha-1
    • Fix Version/s: 2.0
    • Component/s: plugin-testing-harness
    • Labels:
      None
    • Number of attachments :
      0

      Description

      As of version 2.0-alpha-1, plugin-testing only provides a way to lookup and instantiate uninitialized mojo instances, which means significant amount of explicit configuration in test pom.xml files and in test java code is required in order to be able to execute the mojo. It would be nice to be able to request fully configured mojo instances, that are initialized according to mojo parameter expressions and default values, thus saving the overhead of maintaining the manual mojo configuration.

        Issue Links

          Activity

          Hide
          Igor Fedorenko added a comment -

          Introduced new AbstractMojoTestCase.lookupConfiguredMojo. which returns fully configured Mojo instance. Unlike other lookupMojo methods, lookupConfiguredMojo uses maven plugin parameter default values, so test can use much smaller and
          easier to maintain pom.xml files.

          Also introduced AbstractMojoTestCase newMavenSession and newMojoExecution helper methods. These helpers are used by lookupConfiguredMojo but should be useful in other cases.

          http://svn.apache.org/viewvc?view=revision&revision=1185951

          Show
          Igor Fedorenko added a comment - Introduced new AbstractMojoTestCase.lookupConfiguredMojo. which returns fully configured Mojo instance. Unlike other lookupMojo methods, lookupConfiguredMojo uses maven plugin parameter default values, so test can use much smaller and easier to maintain pom.xml files. Also introduced AbstractMojoTestCase newMavenSession and newMojoExecution helper methods. These helpers are used by lookupConfiguredMojo but should be useful in other cases. http://svn.apache.org/viewvc?view=revision&revision=1185951

            People

            • Assignee:
              Igor Fedorenko
              Reporter:
              Igor Fedorenko
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: