Skip to content

Commit

Permalink
Hacky solution for integration tests with port conflicts; adding addi…
Browse files Browse the repository at this point in the history
…tional Maven build helper -assigned test port
  • Loading branch information
ajs6f committed Oct 14, 2014
1 parent d8df987 commit 5df8f0c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
Expand Up @@ -78,7 +78,7 @@ public void setLogger() {
logger = getLogger(this.getClass());
}

protected static final int SERVER_PORT = parseInt(System.getProperty(
protected static int SERVER_PORT = parseInt(System.getProperty(
"test.port", "8080"));

protected static final String HOSTNAME = "localhost";
Expand Down
Expand Up @@ -18,6 +18,7 @@
import static com.hp.hpl.jena.graph.Node.ANY;
import static com.hp.hpl.jena.graph.NodeFactory.createLiteral;
import static com.hp.hpl.jena.rdf.model.ResourceFactory.createResource;
import static java.lang.Integer.parseInt;
import static org.fcrepo.kernel.RdfLexicon.VERSIONING_POLICY;
import static org.junit.Assert.assertTrue;

Expand All @@ -35,6 +36,9 @@
@UseAutoVersioningConfiguration
public class FedoraAutoVersioningIT extends AbstractVersioningIT {

// avoid port collisions with other running (cacheable) test context
protected static int SERVER_PORT = parseInt(System.getProperty(
"test.port1", "8080"));
@Test
public void testRepositoryWideAutoVersioning() throws IOException {
final String objName = getRandomUniquePid();
Expand Down
4 changes: 3 additions & 1 deletion pom.xml
Expand Up @@ -586,6 +586,7 @@
<configuration>
<systemPropertyVariables>
<test.port>${test.port}</test.port>
<test.port1>${test.port1}</test.port1>
<test.context.path>${test.context.path}</test.context.path>
<com.arjuna.ats.arjuna.common.ObjectStoreEnvironmentBean.default.objectStoreDir>
${project.build.directory}/object-store-default
Expand Down Expand Up @@ -681,11 +682,12 @@
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.8</version>
<!-- reserve a port under the property ${test.port} for integration
<!-- reserve ports under the propertes ${test.port} or ${test.port1} for integration
tests -->
<configuration>
<portNames>
<portName>test.port</portName>
<portName>test.port1</portName>
</portNames>
</configuration>
<executions>
Expand Down

0 comments on commit 5df8f0c

Please sign in to comment.