mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-07 10:04:21 +00:00
[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:
@@ -114,10 +114,6 @@
|
|||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
<plugin>
|
|
||||||
<artifactId>maven-failsafe-plugin</artifactId>
|
|
||||||
</plugin>
|
|
||||||
|
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
@@ -162,6 +158,18 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<artifactId>maven-dependency-plugin</artifactId>
|
<artifactId>maven-dependency-plugin</artifactId>
|
||||||
<version>2.8</version>
|
<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>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<id>setupTestEnvironment</id>
|
<id>setupTestEnvironment</id>
|
||||||
@@ -169,18 +177,13 @@
|
|||||||
<goals>
|
<goals>
|
||||||
<goal>unpack</goal>
|
<goal>unpack</goal>
|
||||||
</goals>
|
</goals>
|
||||||
<configuration>
|
</execution>
|
||||||
<outputDirectory>${project.build.directory}/testing</outputDirectory>
|
<execution>
|
||||||
<artifactItems>
|
<id>setupIntegrationTestEnvironment</id>
|
||||||
<artifactItem>
|
<phase>pre-integration-test</phase>
|
||||||
<groupId>org.dspace</groupId>
|
<goals>
|
||||||
<artifactId>dspace-parent</artifactId>
|
<goal>unpack</goal>
|
||||||
<version>${project.version}</version>
|
</goals>
|
||||||
<type>zip</type>
|
|
||||||
<classifier>testEnvironment</classifier>
|
|
||||||
</artifactItem>
|
|
||||||
</artifactItems>
|
|
||||||
</configuration>
|
|
||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
@@ -202,7 +205,7 @@
|
|||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<id>setproperty</id>
|
<id>setproperty</id>
|
||||||
<phase>generate-test-resources</phase>
|
<phase>generate-test-resources</phase> <!-- XXX I think this should be 'initialize' - MHW -->
|
||||||
<goals>
|
<goals>
|
||||||
<goal>execute</goal>
|
<goal>execute</goal>
|
||||||
</goals>
|
</goals>
|
||||||
@@ -284,7 +287,7 @@
|
|||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</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>
|
<plugin>
|
||||||
<artifactId>maven-surefire-plugin</artifactId>
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
<configuration>
|
<configuration>
|
||||||
@@ -296,6 +299,19 @@
|
|||||||
</systemPropertyVariables>
|
</systemPropertyVariables>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</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>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
|
@@ -34,10 +34,10 @@ import static org.hamcrest.CoreMatchers.*;
|
|||||||
*
|
*
|
||||||
* @author pvillega
|
* @author pvillega
|
||||||
*/
|
*/
|
||||||
public class CommunityCollectionIntegrationTest extends AbstractIntegrationTest
|
public class ITCommunityCollection extends AbstractIntegrationTest
|
||||||
{
|
{
|
||||||
/** log4j category */
|
/** 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 CommunityService communityService = ContentServiceFactory.getInstance().getCommunityService();
|
||||||
protected CollectionService collectionService = ContentServiceFactory.getInstance().getCollectionService();
|
protected CollectionService collectionService = ContentServiceFactory.getInstance().getCollectionService();
|
@@ -28,10 +28,10 @@ import static org.hamcrest.CoreMatchers.*;
|
|||||||
* This is an integration test to validate the metadata classes
|
* This is an integration test to validate the metadata classes
|
||||||
* @author pvillega
|
* @author pvillega
|
||||||
*/
|
*/
|
||||||
public class MetadataIntegrationTest extends AbstractIntegrationTest
|
public class ITMetadata extends AbstractIntegrationTest
|
||||||
{
|
{
|
||||||
/** log4j category */
|
/** 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();
|
protected CommunityService communityService = ContentServiceFactory.getInstance().getCommunityService();
|
1
pom.xml
1
pom.xml
@@ -30,6 +30,7 @@
|
|||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
<project.reporting.outputEncoding>${project.build.sourceEncoding}</project.reporting.outputEncoding>
|
||||||
<java.version>1.7</java.version>
|
<java.version>1.7</java.version>
|
||||||
<lucene.version>4.10.2</lucene.version>
|
<lucene.version>4.10.2</lucene.version>
|
||||||
<solr.version>4.10.2</solr.version>
|
<solr.version>4.10.2</solr.version>
|
||||||
|
Reference in New Issue
Block a user