Class TestMojo

  • All Implemented Interfaces:
    org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

    @Mojo(name="test",
          defaultPhase=INTEGRATION_TEST,
          requiresDependencyResolution=RUNTIME)
    public class TestMojo
    extends org.apache.maven.plugin.AbstractMojo

    Executes tests in an OSGi runtime.

    The goal launches an OSGi runtime and executes the project's tests in that runtime. The "test runtime" consists of the bundle built in this project and its transitive dependencies, plus some Equinox and test harness bundles. The bundles are resolved from the target platform of the project. Note that the test runtime does typically not contain the entire target platform. If there are implicitly required bundles (e.g. org.eclipse.equinox.ds to make declarative services work), they need to be added manually through an extraRequirements configuration on the target-platform-configuration plugin.

    • Constructor Detail

      • TestMojo

        public TestMojo()
    • Method Detail

      • execute

        public void execute()
                     throws org.apache.maven.plugin.MojoExecutionException,
                            org.apache.maven.plugin.MojoFailureException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
        org.apache.maven.plugin.MojoFailureException
      • shouldSkip

        protected boolean shouldSkip()
      • newBundleDependency

        protected org.apache.maven.model.Dependency newBundleDependency​(String bundleId)
      • getMergedProviderProperties

        protected Properties getMergedProviderProperties()
                                                  throws org.apache.maven.plugin.MojoExecutionException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • scanForTests

        protected org.apache.maven.surefire.util.ScanResult scanForTests()
      • getToolchain

        protected org.apache.maven.toolchain.Toolchain getToolchain()
                                                             throws org.apache.maven.plugin.MojoExecutionException
        Throws:
        org.apache.maven.plugin.MojoExecutionException