[
https://issues.apache.org/jira/browse/ACCUMULO-1030?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13640770#comment-13640770
]
Christopher Tubbs commented on ACCUMULO-1030:
---------------------------------------------
[~elserj] wrote:
{quote}Do you have any ideas about how to isolate configuration changes,
existing tables, etc from different integration tests?{quote}
MiniAccumuloCluster could have options to generate table names or user names
that are unique, so integration tests could leverage that (or one could use
JUnit's ability to generate unique temporary file names).
If you need to isolate the tests further, you could specify multiple executions
of MiniAccumuloCluster in the pre-integration-test phase, with different
configuration properties (from a properties file specified in the configuration
of the plugin), and integration tests can be programmed to connect to one or
another by reading its corresponding properties file.
What I'm imagining is something like:
{code:xml}
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<executions>
<execution>
<id>run-integration-tests</id>
<goals>
<goal>integration-test</goal>
</goals>
<phase>integration-test</phase>
</execution>
<execution>
<id>verify-integration-tests</id>
<goals>
<goal>verify</goal>
</goals>
<phase>verify</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>integration-tests-with-accumulo</id>
<activation>
<property>
<name>!skipTests</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.accumulo</groupId>
<artifactId>accumulo-maven-plugin</artifactId>
<version>1.6.0</version>
<executions>
<execution>
<id>start-accumulo-1</id>
<goals>
<goal>start</goal>
</goals>
<phase>pre-integration-test</phase>
<configuration>
<file>src/test/resources/accumulo-it-1.properties</file>
</configuration>
</execution>
<execution>
<id>start-accumulo-2</id>
<goals>
<goal>start</goal>
</goals>
<phase>pre-integration-test</phase>
<configuration>
<file>src/test/resources/accumulo-it-2.properties</file>
</configuration>
</execution>
<execution>
<id>stop-accumulo-1</id>
<goals>
<goal>stop</goal>
</goals>
<phase>post-integration-test</phase>
<configuration>
<file>src/test/resources/accumulo-it-1.properties</file>
</configuration>
</execution>
<execution>
<id>stop-accumulo-2</id>
<goals>
<goal>stop</goal>
</goals>
<phase>post-integration-test</phase>
<configuration>
<file>src/test/resources/accumulo-it-2.properties</file>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
{code}
These settings could be combined with other plugins to reserve network ports
and write the properties files.
> Create a Maven plugin to run MiniAccumuloCluster for integration testing
> ------------------------------------------------------------------------
>
> Key: ACCUMULO-1030
> URL: https://issues.apache.org/jira/browse/ACCUMULO-1030
> Project: Accumulo
> Issue Type: New Feature
> Reporter: Christopher Tubbs
> Assignee: Christopher Tubbs
> Fix For: 1.6.0
>
>
> It would be great for users to be able to start up MiniAccumuloCluster with a
> maven plugin, so that they can test their code against Accumulo during the
> integration test phase of the Maven lifecycle.
> MiniAccumuloCluster can be started during the pre-integration-test phase of
> the build lifecycle, then shut down during the post-integration-test phase.
> This would satisfy use cases similar to how one might start up the
> jetty-maven-plugin to test a webapp.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira