[DS-2397] Run 2 integration tests; fix problems uncovered thereby.

This makes Failsafe run conditional on maven.test.skip, ensures that
the test environment is unpacked for that phase, and configures
Failsafe as Surefire is.  Two *Test.java classes were renamed IT*.java
so that Failsafe would run them and Surefire wouldn't.
This commit is contained in:
Mark H. Wood
2015-09-25 16:15:23 -04:00
parent d4c4966535
commit 9b6b581d98
4 changed files with 39 additions and 22 deletions

View File

@@ -114,10 +114,6 @@
</executions>
</plugin>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
</plugin>
</plugins>
</build>
@@ -162,6 +158,18 @@
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.8</version>
<configuration>
<outputDirectory>${project.build.directory}/testing</outputDirectory>
<artifactItems>
<artifactItem>
<groupId>org.dspace</groupId>
<artifactId>dspace-parent</artifactId>
<version>${project.version}</version>
<type>zip</type>
<classifier>testEnvironment</classifier>
</artifactItem>
</artifactItems>
</configuration>
<executions>
<execution>
<id>setupTestEnvironment</id>
@@ -169,18 +177,13 @@
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/testing</outputDirectory>
<artifactItems>
<artifactItem>
<groupId>org.dspace</groupId>
<artifactId>dspace-parent</artifactId>
<version>${project.version}</version>
<type>zip</type>
<classifier>testEnvironment</classifier>
</artifactItem>
</artifactItems>
</configuration>
</execution>
<execution>
<id>setupIntegrationTestEnvironment</id>
<phase>pre-integration-test</phase>
<goals>
<goal>unpack</goal>
</goals>
</execution>
</executions>
</plugin>
@@ -202,7 +205,7 @@
<executions>
<execution>
<id>setproperty</id>
<phase>generate-test-resources</phase>
<phase>generate-test-resources</phase> <!-- XXX I think this should be 'initialize' - MHW -->
<goals>
<goal>execute</goal>
</goals>
@@ -284,7 +287,7 @@
</executions>
</plugin>
<!-- Run Unit/Integration Testing! This plugin just kicks off the tests (when enabled). -->
<!-- Run Unit Testing! This plugin just kicks off the tests (when enabled). -->
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
@@ -296,6 +299,19 @@
</systemPropertyVariables>
</configuration>
</plugin>
<!-- Run Integration Testing! This plugin just kicks off the tests (when enabled). -->
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<systemPropertyVariables>
<!-- Specify the dspace.cfg file to use for test environment -->
<dspace.configuration>${agnostic.build.dir}/testing/dspace/config/dspace.cfg</dspace.configuration>
<!-- Turn off any DSpace logging -->
<dspace.log.init.disable>true</dspace.log.init.disable>
</systemPropertyVariables>
</configuration>
</plugin>
</plugins>
</build>

View File

@@ -34,10 +34,10 @@ import static org.hamcrest.CoreMatchers.*;
*
* @author pvillega
*/
public class CommunityCollectionIntegrationTest extends AbstractIntegrationTest
public class ITCommunityCollection extends AbstractIntegrationTest
{
/** log4j category */
private static final Logger log = Logger.getLogger(CommunityCollectionIntegrationTest.class);
private static final Logger log = Logger.getLogger(ITCommunityCollection.class);
protected CommunityService communityService = ContentServiceFactory.getInstance().getCommunityService();
protected CollectionService collectionService = ContentServiceFactory.getInstance().getCollectionService();

View File

@@ -28,10 +28,10 @@ import static org.hamcrest.CoreMatchers.*;
* This is an integration test to validate the metadata classes
* @author pvillega
*/
public class MetadataIntegrationTest extends AbstractIntegrationTest
public class ITMetadata extends AbstractIntegrationTest
{
/** log4j category */
private static final Logger log = Logger.getLogger(MetadataIntegrationTest.class);
private static final Logger log = Logger.getLogger(ITMetadata.class);
protected CommunityService communityService = ContentServiceFactory.getInstance().getCommunityService();

View File

@@ -30,6 +30,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>${project.build.sourceEncoding}</project.reporting.outputEncoding>
<java.version>1.7</java.version>
<lucene.version>4.10.2</lucene.version>
<solr.version>4.10.2</solr.version>