EOA Extension Plugin

Overview

Defines several goals, each of which is automatically mapped to the specific phases of an EOA extension project's lifecycle, i.e. the resources, compile, package, unit test, unit test resources, integration test, integration test resources and install phases.

Configurable Parameters

Name Description Default
maven.test.skip Name of system property, which if set, skips all tests - both unit tests and integration tests. None
maven.surefire.it.suite Identifies integration test suite(s) to be processed within the associated project's 'install' phase. Usage from command line: mvn install -Dmaven.surefire.it.suite="myitsuite" All
maven.surefire.debug Name of system property, which if set, signals forked jvm, i.e. unit tests fork, to wait for a jwdp attachment via port 5005. Usage from command line: mvn install -Dmaven.surefire.it.debug None
maven.surefire.it.debug Name of system property, which if set, signals forked jvm, i.e. system integration test fork, to wait for a jwdp attachment via port 5005. Usage from command line: mvn install -Dmaven.surefire.it.debug None
maven.surefire.it.client.debug Name of system property, which if set, signals forked jvm, i.e. client integration test fork, to wait for a jwdp attachment via port 5005. Usage from command line: mvn install -Dmaven.surefire.it.client.debug None

Examples

Enabling The Plugin

This plugin is enabled by defining it within the plugin section of your EOA extension POM (note that the extensions tag must be set to true.) The project type must be one of 'eoa-component', 'eoa-factory' or 'eoa-feature.' Note that this plugin is enabled by default within the EOA project archetype. Note also, for repeatable builds, you should 'peg' the plugin to a specific version as shown in the example below.

...
<build>
  <plugins>
    <plugin>
      <groupId>org.bluestemsoftware.open.maven.plugin</groupId>
      <artifactId>maven-eoa-plugin</artifactId>
      <version>1.0.0.0</version>
      <extensions>true</extensions>
    </plugin>
  </plugins>
</build>
...

Configuring Test Classpaths

The configuration example below demonstrates how to control which artifacts with test scope defined by a project are included within the various 'tests' classpaths. There are two types of tests - unit tests which are executed when 'mvn test' is run, and integration tests which execute when 'mvn install' is run. Integration tests require the existence of other extensions/components (which should be mocked and/or stubbed) in addition to the 'extension under test' all of which execute within the context of a running EOA system instance, e.g. alakai.

Integration tests consist of an optional set of 'client' tests, which execute in a separate jvm and which exercise extensions/components which execute within a running EOA system instance, i.e. by sending messages. The tests which run within the system jvm instance are called 'system' tests. Note that artifacts defined within the unit test 'tests classpath' and system test 'tests classpath' augment the artifacts scoped to the extension/component's deployment classpath.

To distinguish which artifacts with 'test' scope are to be included within the client tests classpath vs. the system tests classpath, you define the dependencies within the plugin configuration as indicated below. Note that the dependencies identified within the configuration section must also be listed as dependencies within the dependencies section and must have scope 'test'.

In the example below, the 'ext-client-test' and 'commons-httpclient' artifacts would be added to the tests classpath in the forked client tests jvm and would be excluded from the unit tests classpath and the system integration tests classpath. By default, if no configuration is defined, all artifacts with scope 'test' would be included in the tests classpath for all unit tests, client integration tests and system integration tests.

...
<build>
  <plugins>
    <plugin>
      <groupId>org.bluestemsoftware.open.maven.plugin</groupId>
      <artifactId>maven-eoa-plugin</artifactId>
      <extensions>true</extensions>
      <configuration>
        <test>
          <system>
            <dependency>
              <groupId>junit</groupId>
              <artifactId>junit</artifactId>
            </dependency>
            <dependency>
              <groupId>org.bluestemsoftware.open.eoa.ext</groupId>
              <artifactId>ext-system-test</artifactId>
            </dependency>
          </system>
          <client>
            <dependency>
              <groupId>junit</groupId>
              <artifactId>junit</artifactId>
            </dependency>
            <dependency>
              <groupId>org.bluestemsoftware.open.eoa.ext</groupId>
              <artifactId>ext-client-test</artifactId>
            </dependency>
            <dependency>
              <groupId>commons-httpclient</groupId>
              <artifactId>commons-httpclient</artifactId>
            </dependency>
          </client>
        </test>
      </configuration>
    </plugin>
  </plugins>
</build>
<dependencies>
  <dependency>
    <groupId>junit</groupId>
    <artifactId>junit</artifactId>
    <version>4.2</version>
    <scope>test</scope>
  </dependency>
  <dependency>
    <groupId>org.bluestemsoftware.open.eoa.ext</groupId>
    <artifactId>ext-system-test</artifactId>
    <version>SNAPSHOT</version>
    <scope>test</scope>
  </dependency>
  <dependency>
    <groupId>org.bluestemsoftware.open.eoa.ext</groupId>
    <artifactId>ext-client-test</artifactId>
    <version>SNAPSHOT</version>
    <scope>test</scope>
  </dependency>
  <dependency>
    <groupId>commons-httpclient</groupId>
    <artifactId>commons-httpclient</artifactId>
    <version>3.0.1</version>
    <scope>test</scope>
    <exclusions>
      <exclusion>
        <groupId>commons-logging</groupId>
        <artifactId>commons-logging</artifactId>
      </exclusion>
    </exclusions>
  </dependency>
  ...
</dependencies>
...