servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r405792 - /incubator/servicemix/trunk/servicemix-eip/src/test/java/org/apache/servicemix/eip/
Date Wed, 10 May 2006 16:34:12 GMT
Author: gnodet
Date: Wed May 10 09:34:07 2006
New Revision: 405792

URL: http://svn.apache.org/viewcvs?rev=405792&view=rev
Log:
Fix servicemix-eip tests

Modified:
    incubator/servicemix/trunk/servicemix-eip/src/test/java/org/apache/servicemix/eip/AbstractEIPTest.java
    incubator/servicemix/trunk/servicemix-eip/src/test/java/org/apache/servicemix/eip/ContentBasedRouterTest.java
    incubator/servicemix/trunk/servicemix-eip/src/test/java/org/apache/servicemix/eip/MessageFilterTest.java
    incubator/servicemix/trunk/servicemix-eip/src/test/java/org/apache/servicemix/eip/PipelineTest.java
    incubator/servicemix/trunk/servicemix-eip/src/test/java/org/apache/servicemix/eip/SplitAggregatorTest.java
    incubator/servicemix/trunk/servicemix-eip/src/test/java/org/apache/servicemix/eip/StaticRecipientListTest.java
    incubator/servicemix/trunk/servicemix-eip/src/test/java/org/apache/servicemix/eip/StaticRoutingSlipTest.java
    incubator/servicemix/trunk/servicemix-eip/src/test/java/org/apache/servicemix/eip/WireTapJmsFlowTest.java
    incubator/servicemix/trunk/servicemix-eip/src/test/java/org/apache/servicemix/eip/WireTapTest.java
    incubator/servicemix/trunk/servicemix-eip/src/test/java/org/apache/servicemix/eip/XPathSplitterTest.java

Modified: incubator/servicemix/trunk/servicemix-eip/src/test/java/org/apache/servicemix/eip/AbstractEIPTest.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-eip/src/test/java/org/apache/servicemix/eip/AbstractEIPTest.java?rev=405792&r1=405791&r2=405792&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-eip/src/test/java/org/apache/servicemix/eip/AbstractEIPTest.java
(original)
+++ incubator/servicemix/trunk/servicemix-eip/src/test/java/org/apache/servicemix/eip/AbstractEIPTest.java
Wed May 10 09:34:07 2006
@@ -16,6 +16,9 @@
 package org.apache.servicemix.eip;
 
 import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.ObjectOutputStream;
 
 import javax.jbi.messaging.ExchangeStatus;
 import javax.jbi.messaging.Fault;
@@ -32,7 +35,9 @@
 import org.apache.servicemix.client.DefaultServiceMixClient;
 import org.apache.servicemix.components.util.ComponentSupport;
 import org.apache.servicemix.eip.support.ExchangeTarget;
+import org.apache.servicemix.id.IdGenerator;
 import org.apache.servicemix.jbi.container.JBIContainer;
+import org.apache.servicemix.store.memory.MemoryStore;
 import org.apache.servicemix.tck.ExchangeCompletedListener;
 import org.apache.servicemix.tck.ReceiverComponent;
 
@@ -65,6 +70,16 @@
     
     protected void configureContainer() throws Exception {
         jbi.setFlowName("st");
+    }
+    
+    protected void configurePattern(EIPEndpoint endpoint) {
+        endpoint.setStore(new MemoryStore(new IdGenerator()) {
+            public void store(String id, Object exchange) throws IOException {
+                ByteArrayOutputStream baos = new ByteArrayOutputStream();
+                new ObjectOutputStream(baos).writeObject(exchange);
+                super.store(id, exchange);
+            }
+        });
     }
     
     protected ExchangeTarget createServiceExchangeTarget(QName name) {

Modified: incubator/servicemix/trunk/servicemix-eip/src/test/java/org/apache/servicemix/eip/ContentBasedRouterTest.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-eip/src/test/java/org/apache/servicemix/eip/ContentBasedRouterTest.java?rev=405792&r1=405791&r2=405792&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-eip/src/test/java/org/apache/servicemix/eip/ContentBasedRouterTest.java
(original)
+++ incubator/servicemix/trunk/servicemix-eip/src/test/java/org/apache/servicemix/eip/ContentBasedRouterTest.java
Wed May 10 09:34:07 2006
@@ -15,21 +15,15 @@
  */
 package org.apache.servicemix.eip;
 
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.ObjectOutputStream;
-
 import javax.jbi.messaging.ExchangeStatus;
 import javax.jbi.messaging.InOnly;
 import javax.jbi.messaging.InOut;
 import javax.xml.namespace.QName;
 
-import org.apache.activemq.util.IdGenerator;
 import org.apache.servicemix.eip.patterns.ContentBasedRouter;
 import org.apache.servicemix.eip.support.RoutingRule;
 import org.apache.servicemix.eip.support.XPathPredicate;
 import org.apache.servicemix.jbi.jaxp.SourceTransformer;
-import org.apache.servicemix.store.memory.MemoryStore;
 import org.apache.servicemix.tck.ReceiverComponent;
 import org.w3c.dom.Node;
 
@@ -52,18 +46,8 @@
                         null,
                         createServiceExchangeTarget(new QName("target3")))
         });
-        configureRouter();
+        configurePattern(router);
         activateComponent(router, "router");
-    }
-    
-    protected void configureRouter() throws Exception {
-        router.setStore(new MemoryStore(new IdGenerator()) {
-            public void store(String id, Object exchange) throws IOException {
-                ByteArrayOutputStream baos = new ByteArrayOutputStream();
-                new ObjectOutputStream(baos).writeObject(exchange);
-                super.store(id, exchange);
-            }
-        });
     }
     
     public void testInOnly() throws Exception {

Modified: incubator/servicemix/trunk/servicemix-eip/src/test/java/org/apache/servicemix/eip/MessageFilterTest.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-eip/src/test/java/org/apache/servicemix/eip/MessageFilterTest.java?rev=405792&r1=405791&r2=405792&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-eip/src/test/java/org/apache/servicemix/eip/MessageFilterTest.java
(original)
+++ incubator/servicemix/trunk/servicemix-eip/src/test/java/org/apache/servicemix/eip/MessageFilterTest.java
Wed May 10 09:34:07 2006
@@ -15,19 +15,13 @@
  */
 package org.apache.servicemix.eip;
 
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.ObjectOutputStream;
-
 import javax.jbi.messaging.ExchangeStatus;
 import javax.jbi.messaging.InOnly;
 import javax.jbi.messaging.InOut;
 import javax.xml.namespace.QName;
 
-import org.apache.activemq.util.IdGenerator;
 import org.apache.servicemix.eip.patterns.MessageFilter;
 import org.apache.servicemix.eip.support.XPathPredicate;
-import org.apache.servicemix.store.memory.MemoryStore;
 import org.apache.servicemix.tck.ReceiverComponent;
 
 public class MessageFilterTest extends AbstractEIPTest {
@@ -40,20 +34,10 @@
         messageFilter = new MessageFilter();
         messageFilter.setFilter(new XPathPredicate("/hello/@id = '1'"));
         messageFilter.setTarget(createServiceExchangeTarget(new QName("target")));
-        configureMessageFilter();
+        configurePattern(messageFilter);
         activateComponent(messageFilter, "messageFilter");
     }
     
-    protected void configureMessageFilter() throws Exception {
-        messageFilter.setStore(new MemoryStore(new IdGenerator()) {
-            public void store(String id, Object exchange) throws IOException {
-                ByteArrayOutputStream baos = new ByteArrayOutputStream();
-                new ObjectOutputStream(baos).writeObject(exchange);
-                super.store(id, exchange);
-            }
-        });
-    }
-
     public void testInOnly() throws Exception {
         ReceiverComponent rec = activateReceiver("target");
         

Modified: incubator/servicemix/trunk/servicemix-eip/src/test/java/org/apache/servicemix/eip/PipelineTest.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-eip/src/test/java/org/apache/servicemix/eip/PipelineTest.java?rev=405792&r1=405791&r2=405792&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-eip/src/test/java/org/apache/servicemix/eip/PipelineTest.java
(original)
+++ incubator/servicemix/trunk/servicemix-eip/src/test/java/org/apache/servicemix/eip/PipelineTest.java
Wed May 10 09:34:07 2006
@@ -15,10 +15,6 @@
  */
 package org.apache.servicemix.eip;
 
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.ObjectOutputStream;
-
 import javax.jbi.messaging.ExchangeStatus;
 import javax.jbi.messaging.InOnly;
 import javax.jbi.messaging.InOptionalOut;
@@ -26,9 +22,7 @@
 import javax.jbi.messaging.RobustInOnly;
 import javax.xml.namespace.QName;
 
-import org.apache.activemq.util.IdGenerator;
 import org.apache.servicemix.eip.patterns.Pipeline;
-import org.apache.servicemix.store.memory.MemoryStore;
 import org.apache.servicemix.tck.ReceiverComponent;
 
 public class PipelineTest extends AbstractEIPTest {
@@ -41,20 +35,10 @@
         pipeline = new Pipeline();
         pipeline.setTransformer(createServiceExchangeTarget(new QName("transformer")));
         pipeline.setTarget(createServiceExchangeTarget(new QName("target")));
-        configurePipeline();
+        configurePattern(pipeline);
         activateComponent(pipeline, "pipeline");
     }
     
-    protected void configurePipeline() throws Exception {
-        pipeline.setStore(new MemoryStore(new IdGenerator()) {
-            public void store(String id, Object exchange) throws IOException {
-                ByteArrayOutputStream baos = new ByteArrayOutputStream();
-                new ObjectOutputStream(baos).writeObject(exchange);
-                super.store(id, exchange);
-            }
-        });
-    }
-
     public void testInOut() throws Exception {
         InOut me = client.createInOutExchange();
         me.setService(new QName("pipeline"));

Modified: incubator/servicemix/trunk/servicemix-eip/src/test/java/org/apache/servicemix/eip/SplitAggregatorTest.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-eip/src/test/java/org/apache/servicemix/eip/SplitAggregatorTest.java?rev=405792&r1=405791&r2=405792&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-eip/src/test/java/org/apache/servicemix/eip/SplitAggregatorTest.java
(original)
+++ incubator/servicemix/trunk/servicemix-eip/src/test/java/org/apache/servicemix/eip/SplitAggregatorTest.java
Wed May 10 09:34:07 2006
@@ -15,18 +15,12 @@
  */
 package org.apache.servicemix.eip;
 
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.ObjectOutputStream;
-
 import javax.jbi.messaging.InOnly;
 import javax.jbi.messaging.NormalizedMessage;
 import javax.xml.namespace.QName;
 
-import org.apache.activemq.util.IdGenerator;
 import org.apache.servicemix.eip.patterns.SplitAggregator;
 import org.apache.servicemix.eip.support.AbstractSplitter;
-import org.apache.servicemix.store.memory.MemoryStore;
 import org.apache.servicemix.tck.ReceiverComponent;
 
 public class SplitAggregatorTest extends AbstractEIPTest {
@@ -38,18 +32,8 @@
 
         aggregator = new SplitAggregator();
         aggregator.setTarget(createServiceExchangeTarget(new QName("target")));
-        configureAggregator();
+        configurePattern(aggregator);
         activateComponent(aggregator, "aggregator");
-    }
-    
-    protected void configureAggregator() throws Exception {
-        aggregator.setStore(new MemoryStore(new IdGenerator()) {
-            public void store(String id, Object exchange) throws IOException {
-                ByteArrayOutputStream baos = new ByteArrayOutputStream();
-                new ObjectOutputStream(baos).writeObject(exchange);
-                super.store(id, exchange);
-            }
-        });
     }
     
     protected NormalizedMessage testRun(boolean[] msgs) throws Exception {

Modified: incubator/servicemix/trunk/servicemix-eip/src/test/java/org/apache/servicemix/eip/StaticRecipientListTest.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-eip/src/test/java/org/apache/servicemix/eip/StaticRecipientListTest.java?rev=405792&r1=405791&r2=405792&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-eip/src/test/java/org/apache/servicemix/eip/StaticRecipientListTest.java
(original)
+++ incubator/servicemix/trunk/servicemix-eip/src/test/java/org/apache/servicemix/eip/StaticRecipientListTest.java
Wed May 10 09:34:07 2006
@@ -15,10 +15,6 @@
  */
 package org.apache.servicemix.eip;
 
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.ObjectOutputStream;
-
 import javax.jbi.messaging.ExchangeStatus;
 import javax.jbi.messaging.InOnly;
 import javax.jbi.messaging.InOptionalOut;
@@ -26,10 +22,8 @@
 import javax.jbi.messaging.RobustInOnly;
 import javax.xml.namespace.QName;
 
-import org.apache.activemq.util.IdGenerator;
 import org.apache.servicemix.eip.patterns.StaticRecipientList;
 import org.apache.servicemix.eip.support.ExchangeTarget;
-import org.apache.servicemix.store.memory.MemoryStore;
 import org.apache.servicemix.tck.ReceiverComponent;
 
 public class StaticRecipientListTest extends AbstractEIPTest {
@@ -46,20 +40,10 @@
                         createServiceExchangeTarget(new QName("recipient2")),
                         createServiceExchangeTarget(new QName("recipient3"))
                 });
-        configureRecipientList();
+        configurePattern(recipientList);
         activateComponent(recipientList, "recipientList");
     }
 
-    protected void configureRecipientList() {
-        recipientList.setStore(new MemoryStore(new IdGenerator()) {
-            public void store(String id, Object exchange) throws IOException {
-                ByteArrayOutputStream baos = new ByteArrayOutputStream();
-                new ObjectOutputStream(baos).writeObject(exchange);
-                super.store(id, exchange);
-            }
-        });
-    }
-    
     public void testInOut() throws Exception {
         InOut me = client.createInOutExchange();
         me.setService(new QName("recipientList"));

Modified: incubator/servicemix/trunk/servicemix-eip/src/test/java/org/apache/servicemix/eip/StaticRoutingSlipTest.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-eip/src/test/java/org/apache/servicemix/eip/StaticRoutingSlipTest.java?rev=405792&r1=405791&r2=405792&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-eip/src/test/java/org/apache/servicemix/eip/StaticRoutingSlipTest.java
(original)
+++ incubator/servicemix/trunk/servicemix-eip/src/test/java/org/apache/servicemix/eip/StaticRoutingSlipTest.java
Wed May 10 09:34:07 2006
@@ -15,10 +15,6 @@
  */
 package org.apache.servicemix.eip;
 
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.ObjectOutputStream;
-
 import javax.jbi.messaging.ExchangeStatus;
 import javax.jbi.messaging.InOnly;
 import javax.jbi.messaging.InOptionalOut;
@@ -26,10 +22,8 @@
 import javax.jbi.messaging.RobustInOnly;
 import javax.xml.namespace.QName;
 
-import org.apache.activemq.util.IdGenerator;
 import org.apache.servicemix.eip.patterns.StaticRoutingSlip;
 import org.apache.servicemix.eip.support.ExchangeTarget;
-import org.apache.servicemix.store.memory.MemoryStore;
 
 
 public class StaticRoutingSlipTest extends AbstractEIPTest {
@@ -46,20 +40,10 @@
                         createServiceExchangeTarget(new QName("target2")),
                         createServiceExchangeTarget(new QName("target3"))
                 });
-        configureRoutingSlip();
+        configurePattern(routingSlip);
         activateComponent(routingSlip, "routingSlip");
     }
 
-    protected void configureRoutingSlip() {
-        routingSlip.setStore(new MemoryStore(new IdGenerator()) {
-            public void store(String id, Object exchange) throws IOException {
-                ByteArrayOutputStream baos = new ByteArrayOutputStream();
-                new ObjectOutputStream(baos).writeObject(exchange);
-                super.store(id, exchange);
-            }
-        });
-    }
-    
     public void testInOnly() throws Exception {
         InOnly me = client.createInOnlyExchange();
         me.setService(new QName("routingSlip"));

Modified: incubator/servicemix/trunk/servicemix-eip/src/test/java/org/apache/servicemix/eip/WireTapJmsFlowTest.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-eip/src/test/java/org/apache/servicemix/eip/WireTapJmsFlowTest.java?rev=405792&r1=405791&r2=405792&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-eip/src/test/java/org/apache/servicemix/eip/WireTapJmsFlowTest.java
(original)
+++ incubator/servicemix/trunk/servicemix-eip/src/test/java/org/apache/servicemix/eip/WireTapJmsFlowTest.java
Wed May 10 09:34:07 2006
@@ -15,13 +15,7 @@
  */
 package org.apache.servicemix.eip;
 
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.ObjectOutputStream;
-
 import org.apache.activemq.broker.BrokerService;
-import org.apache.activemq.util.IdGenerator;
-import org.apache.servicemix.store.memory.MemoryStore;
 
 
 public class WireTapJmsFlowTest extends WireTapTest {
@@ -40,16 +34,6 @@
     protected void tearDown() throws Exception {
         super.tearDown();
         broker.stop();
-    }
-    
-    protected void configureWireTap() throws Exception {
-        wireTap.setStore(new MemoryStore(new IdGenerator()) {
-            public void store(String id, Object exchange) throws IOException {
-                ByteArrayOutputStream baos = new ByteArrayOutputStream();
-                new ObjectOutputStream(baos).writeObject(exchange);
-                super.store(id, exchange);
-            }
-        });
     }
     
     protected void configureContainer() throws Exception {

Modified: incubator/servicemix/trunk/servicemix-eip/src/test/java/org/apache/servicemix/eip/WireTapTest.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-eip/src/test/java/org/apache/servicemix/eip/WireTapTest.java?rev=405792&r1=405791&r2=405792&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-eip/src/test/java/org/apache/servicemix/eip/WireTapTest.java
(original)
+++ incubator/servicemix/trunk/servicemix-eip/src/test/java/org/apache/servicemix/eip/WireTapTest.java
Wed May 10 09:34:07 2006
@@ -15,10 +15,6 @@
  */
 package org.apache.servicemix.eip;
 
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.ObjectOutputStream;
-
 import javax.jbi.messaging.ExchangeStatus;
 import javax.jbi.messaging.Fault;
 import javax.jbi.messaging.InOnly;
@@ -27,9 +23,7 @@
 import javax.jbi.messaging.RobustInOnly;
 import javax.xml.namespace.QName;
 
-import org.apache.activemq.util.IdGenerator;
 import org.apache.servicemix.eip.patterns.WireTap;
-import org.apache.servicemix.store.memory.MemoryStore;
 import org.apache.servicemix.tck.ReceiverComponent;
 
 public class WireTapTest extends AbstractEIPTest {
@@ -50,18 +44,8 @@
         wireTap.setOutListener(createServiceExchangeTarget(new QName("out")));
         wireTap.setFaultListener(createServiceExchangeTarget(new QName("fault")));
         wireTap.setTarget(createServiceExchangeTarget(new QName("target")));
-        configureWireTap();
+        configurePattern(wireTap);
         activateComponent(wireTap, "wireTap");
-    }
-    
-    protected void configureWireTap() throws Exception {
-        wireTap.setStore(new MemoryStore(new IdGenerator()) {
-            public void store(String id, Object exchange) throws IOException {
-                ByteArrayOutputStream baos = new ByteArrayOutputStream();
-                new ObjectOutputStream(baos).writeObject(exchange);
-                super.store(id, exchange);
-            }
-        });
     }
     
     public void testInOnly() throws Exception {

Modified: incubator/servicemix/trunk/servicemix-eip/src/test/java/org/apache/servicemix/eip/XPathSplitterTest.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-eip/src/test/java/org/apache/servicemix/eip/XPathSplitterTest.java?rev=405792&r1=405791&r2=405792&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-eip/src/test/java/org/apache/servicemix/eip/XPathSplitterTest.java
(original)
+++ incubator/servicemix/trunk/servicemix-eip/src/test/java/org/apache/servicemix/eip/XPathSplitterTest.java
Wed May 10 09:34:07 2006
@@ -15,18 +15,12 @@
  */
 package org.apache.servicemix.eip;
 
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.ObjectOutputStream;
-
 import javax.jbi.messaging.ExchangeStatus;
 import javax.jbi.messaging.InOnly;
 import javax.jbi.messaging.InOut;
 import javax.xml.namespace.QName;
 
-import org.apache.activemq.util.IdGenerator;
 import org.apache.servicemix.eip.patterns.XPathSplitter;
-import org.apache.servicemix.store.memory.MemoryStore;
 import org.apache.servicemix.tck.ReceiverComponent;
 
 public class XPathSplitterTest extends AbstractEIPTest {
@@ -39,18 +33,8 @@
         splitter = new XPathSplitter();
         splitter.setTarget(createServiceExchangeTarget(new QName("target")));
         splitter.setXPath("/hello/*");
-        configureSplitter();
+        configurePattern(splitter);
         activateComponent(splitter, "splitter");
-    }
-    
-    protected void configureSplitter() throws Exception {
-        splitter.setStore(new MemoryStore(new IdGenerator()) {
-            public void store(String id, Object exchange) throws IOException {
-                ByteArrayOutputStream baos = new ByteArrayOutputStream();
-                new ObjectOutputStream(baos).writeObject(exchange);
-                super.store(id, exchange);
-            }
-        });
     }
     
     public void testInOnly() throws Exception {



Mime
View raw message