Skip to content
This repository has been archived by the owner on Jan 3, 2019. It is now read-only.

Commit

Permalink
Enable fcrepo-jms-indexer-webapp to run F4 in integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Woods committed Apr 11, 2014
1 parent 1e31325 commit 64871bb
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 22 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -14,3 +14,4 @@ ObjectStore/
*~
transaction.log
velocity.log
fcrepo4-data/
69 changes: 48 additions & 21 deletions fcrepo-jms-indexer-webapp/pom.xml
Expand Up @@ -90,6 +90,35 @@

<build>
<plugins>

<!--Bring in F4 webapp for integration testing-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.8</version>
<executions>
<execution>
<id>copy</id>
<phase>package</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.fcrepo</groupId>
<artifactId>fcrepo-webapp</artifactId>
<version>${project.version}</version>
<type>war</type>
<outputDirectory>${project.build.directory}</outputDirectory>
<destFileName>f4.war</destFileName>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<artifactId>maven-war-plugin</artifactId>
<configuration>
Expand Down Expand Up @@ -120,27 +149,6 @@
</configuration>
</plugin>

<plugin>
<!--ActiveMQ must start before Jetty, since the MessageConsumer blocks on-->
<!--JMS connection-->
<groupId>org.apache.activemq.tooling</groupId>
<artifactId>maven-activemq-plugin</artifactId>
<version>5.7.0</version>
<executions>
<execution>
<id>start-activemq</id>
<phase>pre-integration-test</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<configUri>broker:(tcp://localhost:${jms.port})</configUri>
<fork>true</fork>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
Expand All @@ -149,10 +157,12 @@
<stopKey>STOP</stopKey>
<webApp>
<contextPath>${test.context.path}</contextPath>
<allowDuplicateFragmentNames>true</allowDuplicateFragmentNames>
</webApp>

</configuration>
<executions>

<execution>
<id>start-jetty</id>
<phase>pre-integration-test</phase>
Expand All @@ -174,9 +184,26 @@
<name>jms.port</name>
<value>${jms.port}</value>
</systemProperty>
<systemProperty>
<name>fcrepo.port</name>
<value>${test.port}</value>
</systemProperty>
<systemProperty>
<name>fcrepo.context</name>
<value>/f4/</value>
</systemProperty>
</systemProperties>

<contextHandlers>
<contextHandler implementation="org.eclipse.jetty.webapp.WebAppContext">
<war>${project.build.directory}/f4.war</war>
<contextPath>/f4</contextPath>
</contextHandler>
</contextHandlers>

</configuration>
</execution>

<execution>
<id>stop-jetty</id>
<phase>post-integration-test</phase>
Expand Down
Expand Up @@ -9,7 +9,8 @@
<context:property-placeholder/>

<bean id="connectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
<property name="brokerURL" value="failover:tcp://${jms.host:localhost}:${jms.port:61616}"/>
<!--The Reconnect query params allow the broker not to block on start-up-->
<property name="brokerURL" value="failover:(tcp://${jms.host:localhost}:${jms.port:61616})?startupMaxReconnectAttempts=1&amp;initialReconnectDelay=1"/>
</bean>

<!-- ActiveMQ queue to listen for events -->
Expand Down

0 comments on commit 64871bb

Please sign in to comment.