You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by cc...@apache.org on 2009/10/13 10:10:58 UTC

svn commit: r824629 - in /servicemix/components/engines/servicemix-eip/trunk: ./ src/test/java/org/apache/servicemix/eip/ src/test/resources/org/apache/servicemix/eip/

Author: ccustine
Date: Tue Oct 13 08:10:58 2009
New Revision: 824629

URL: http://svn.apache.org/viewvc?rev=824629&view=rev
Log:
SMXCOMP-647 - Use dynamic ports for tests
- servicemix-eip

Modified:
    servicemix/components/engines/servicemix-eip/trunk/pom.xml
    servicemix/components/engines/servicemix-eip/trunk/src/test/java/org/apache/servicemix/eip/AbstractEIPTest.java
    servicemix/components/engines/servicemix-eip/trunk/src/test/java/org/apache/servicemix/eip/AbstractEIPTransactionalTest.java
    servicemix/components/engines/servicemix-eip/trunk/src/test/java/org/apache/servicemix/eip/WireTapJmsFlowTest.java
    servicemix/components/engines/servicemix-eip/trunk/src/test/resources/org/apache/servicemix/eip/spring.xml

Modified: servicemix/components/engines/servicemix-eip/trunk/pom.xml
URL: http://svn.apache.org/viewvc/servicemix/components/engines/servicemix-eip/trunk/pom.xml?rev=824629&r1=824628&r2=824629&view=diff
==============================================================================
--- servicemix/components/engines/servicemix-eip/trunk/pom.xml (original)
+++ servicemix/components/engines/servicemix-eip/trunk/pom.xml Tue Oct 13 08:10:58 2009
@@ -195,8 +195,33 @@
             <!-- exclude abstract test cases -->
             <exclude>**/Abstract*.*</exclude>
           </excludes>
+          <systemProperties>
+            <property>
+                <name>activemq.port1</name>
+                <value>${activemq.port1}</value>
+            </property>
+          </systemProperties>
         </configuration>
       </plugin>
+        <plugin>
+            <groupId>org.codehaus.mojo</groupId>
+            <artifactId>build-helper-maven-plugin</artifactId>
+            <version>1.4</version>
+            <executions>
+                <execution>
+                    <id>reserve-network-port</id>
+                    <goals>
+                        <goal>reserve-network-port</goal>
+                    </goals>
+                    <phase>process-resources</phase>
+                    <configuration>
+                        <portNames>
+                            <portName>activemq.port1</portName>
+                        </portNames>
+                    </configuration>
+                </execution>
+            </executions>
+        </plugin>
     </plugins>
   </build>
 </project>

Modified: servicemix/components/engines/servicemix-eip/trunk/src/test/java/org/apache/servicemix/eip/AbstractEIPTest.java
URL: http://svn.apache.org/viewvc/servicemix/components/engines/servicemix-eip/trunk/src/test/java/org/apache/servicemix/eip/AbstractEIPTest.java?rev=824629&r1=824628&r2=824629&view=diff
==============================================================================
--- servicemix/components/engines/servicemix-eip/trunk/src/test/java/org/apache/servicemix/eip/AbstractEIPTest.java (original)
+++ servicemix/components/engines/servicemix-eip/trunk/src/test/java/org/apache/servicemix/eip/AbstractEIPTest.java Tue Oct 13 08:10:58 2009
@@ -32,6 +32,7 @@
 
 import junit.framework.TestCase;
 
+import org.apache.activemq.broker.BrokerService;
 import org.apache.servicemix.JbiConstants;
 import org.apache.servicemix.MessageExchangeListener;
 import org.apache.servicemix.client.DefaultServiceMixClient;
@@ -40,6 +41,7 @@
 import org.apache.servicemix.executors.impl.ExecutorFactoryImpl;
 import org.apache.servicemix.id.IdGenerator;
 import org.apache.servicemix.jbi.container.JBIContainer;
+import org.apache.servicemix.jbi.nmr.DefaultBroker;
 import org.apache.servicemix.store.memory.MemoryStore;
 import org.apache.servicemix.tck.ExchangeCompletedListener;
 import org.apache.servicemix.tck.ReceiverComponent;
@@ -47,6 +49,7 @@
 public abstract class AbstractEIPTest extends TestCase {
 
     protected JBIContainer jbi;
+    protected BrokerService broker;
     protected DefaultServiceMixClient client;
     protected ExchangeCompletedListener listener;
 

Modified: servicemix/components/engines/servicemix-eip/trunk/src/test/java/org/apache/servicemix/eip/AbstractEIPTransactionalTest.java
URL: http://svn.apache.org/viewvc/servicemix/components/engines/servicemix-eip/trunk/src/test/java/org/apache/servicemix/eip/AbstractEIPTransactionalTest.java?rev=824629&r1=824628&r2=824629&view=diff
==============================================================================
--- servicemix/components/engines/servicemix-eip/trunk/src/test/java/org/apache/servicemix/eip/AbstractEIPTransactionalTest.java (original)
+++ servicemix/components/engines/servicemix-eip/trunk/src/test/java/org/apache/servicemix/eip/AbstractEIPTransactionalTest.java Tue Oct 13 08:10:58 2009
@@ -48,7 +48,7 @@
         broker = new BrokerService();
         broker.setUseJmx(false);
         broker.setPersistent(false);
-        broker.addConnector("tcp://localhost:61616");
+        broker.addConnector("tcp://localhost:" + System.getProperty("activemq.port1", "61616"));
         broker.start();
         
         tm = new GeronimoPlatformTransactionManager();
@@ -68,7 +68,8 @@
         store = storeFactory.open("store");
         
         jbi = new JBIContainer();
-        jbi.setFlows(new Flow[] {new SedaFlow(), new JCAFlow() });
+        jbi.setFlows(new Flow[] {new SedaFlow(),
+            new JCAFlow("tcp://localhost:" + System.getProperty("activemq.port1", "61616")) });
         jbi.setEmbedded(true);
         jbi.setUseMBeanServer(false);
         jbi.setCreateMBeanServer(false);

Modified: servicemix/components/engines/servicemix-eip/trunk/src/test/java/org/apache/servicemix/eip/WireTapJmsFlowTest.java
URL: http://svn.apache.org/viewvc/servicemix/components/engines/servicemix-eip/trunk/src/test/java/org/apache/servicemix/eip/WireTapJmsFlowTest.java?rev=824629&r1=824628&r2=824629&view=diff
==============================================================================
--- servicemix/components/engines/servicemix-eip/trunk/src/test/java/org/apache/servicemix/eip/WireTapJmsFlowTest.java (original)
+++ servicemix/components/engines/servicemix-eip/trunk/src/test/java/org/apache/servicemix/eip/WireTapJmsFlowTest.java Tue Oct 13 08:10:58 2009
@@ -26,7 +26,7 @@
     protected void setUp() throws Exception {
         broker = new BrokerService();
         broker.setPersistent(false);
-        broker.addConnector("tcp://localhost:61616");
+        broker.addConnector("tcp://localhost:" + System.getProperty("activemq.port1", "61616"));
         broker.start();
         
         super.setUp();
@@ -38,7 +38,7 @@
     }
     
     protected void configureContainer() throws Exception {
-        jbi.setFlowName("jms?jmsURL=tcp://localhost:61616");
+        jbi.setFlowName("jms?jmsURL=tcp://localhost:" + System.getProperty("activemq.port1", "61616"));
     }
     
 }

Modified: servicemix/components/engines/servicemix-eip/trunk/src/test/resources/org/apache/servicemix/eip/spring.xml
URL: http://svn.apache.org/viewvc/servicemix/components/engines/servicemix-eip/trunk/src/test/resources/org/apache/servicemix/eip/spring.xml?rev=824629&r1=824628&r2=824629&view=diff
==============================================================================
--- servicemix/components/engines/servicemix-eip/trunk/src/test/resources/org/apache/servicemix/eip/spring.xml (original)
+++ servicemix/components/engines/servicemix-eip/trunk/src/test/resources/org/apache/servicemix/eip/spring.xml Tue Oct 13 08:10:58 2009
@@ -22,6 +22,14 @@
 
   <!-- the JBI container -->
   <sm:container id="jbi" embedded="true" autoEnlistInTransaction="true">
+    <sm:flows>
+      <sm:sedaFlow />
+      <!--
+      <sm:jmsFlow jmsURL="tcp://localhost:${activemq.port1}" />
+      <sm:jcaFlow connectionManager="#connectionManager"
+      jmsURL="tcp://localhost:${activemq.port1}" />
+      -->
+    </sm:flows>
     <sm:transactionManager>
       <bean class="org.jencks.GeronimoPlatformTransactionManager" />  
     </sm:transactionManager>