Author: davsclaus
Date: Mon Aug 25 22:38:48 2008
New Revision: 688965

URL: http://svn.apache.org/viewvc?rev=688965&view=rev
Log:
CAMEL-847: camel-mina should be exchange pattern agnostic. default behavioir 
changed: option sync is now true (it is confusing for end users why camel will 
not wait for a response when its calling a remote server).

Added:
    
activemq/camel/trunk/components/camel-mina/src/test/java/org/apache/camel/component/mina/MinaInOnlyRouteTest.java
   (with props)
Modified:
    
activemq/camel/trunk/components/camel-mina/src/main/java/org/apache/camel/component/mina/MinaComponent.java
    
activemq/camel/trunk/components/camel-mina/src/main/java/org/apache/camel/component/mina/MinaConsumer.java
    
activemq/camel/trunk/components/camel-mina/src/main/java/org/apache/camel/component/mina/MinaEndpoint.java
    
activemq/camel/trunk/components/camel-mina/src/main/java/org/apache/camel/component/mina/MinaProducer.java
    
activemq/camel/trunk/components/camel-mina/src/test/java/org/apache/camel/component/mina/MinaEncodingTest.java
    
activemq/camel/trunk/components/camel-mina/src/test/java/org/apache/camel/component/mina/MinaLoggerOptionTest.java
    
activemq/camel/trunk/components/camel-mina/src/test/java/org/apache/camel/component/mina/MinaMulticastTest.java
    
activemq/camel/trunk/components/camel-mina/src/test/java/org/apache/camel/component/mina/MinaUdpTest.java
    
activemq/camel/trunk/components/camel-mina/src/test/java/org/apache/camel/component/mina/MinaUdpUsingTemplateTest.java
    
activemq/camel/trunk/components/camel-mina/src/test/java/org/apache/camel/component/mina/MinaVmTest.java

Modified: 
activemq/camel/trunk/components/camel-mina/src/main/java/org/apache/camel/component/mina/MinaComponent.java
URL: 
http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-mina/src/main/java/org/apache/camel/component/mina/MinaComponent.java?rev=688965&r1=688964&r2=688965&view=diff
==============================================================================
--- 
activemq/camel/trunk/components/camel-mina/src/main/java/org/apache/camel/component/mina/MinaComponent.java
 (original)
+++ 
activemq/camel/trunk/components/camel-mina/src/main/java/org/apache/camel/component/mina/MinaComponent.java
 Mon Aug 25 22:38:48 2008
@@ -60,13 +60,19 @@
  * Component for Apache MINA.
  *
  * @version $Revision$
- *
- * @see org.apache.camel.Component
  */
 public class MinaComponent extends DefaultComponent<MinaExchange> {
     private static final transient Log LOG = 
LogFactory.getLog(MinaComponent.class);
 
     private static final long DEFAULT_CONNECT_TIMEOUT = 30000;
+    boolean sync = true;
+    boolean textline;
+    String codec;
+    String encoding;
+    long timeout;
+    boolean lazySessionCreation;
+    boolean transferExchange;
+    boolean minaLogger;
 
     // encoder used for datagram
     private CharsetEncoder encoder;
@@ -84,6 +90,8 @@
             LOG.debug("Creating MinaEndpoint from uri: " + uri);
         }
 
+        setProperties(this, parameters);
+
         URI u = new URI(remaining);
 
         String protocol = u.getScheme();
@@ -101,11 +109,14 @@
         throw new IllegalArgumentException("Unrecognised MINA protocol: " + 
protocol + " for uri: " + uri);
     }
 
+    // Implementation methods
+    //-------------------------------------------------------------------------
+
     protected MinaEndpoint createVmEndpoint(String uri, URI connectUri) {
         IoAcceptor acceptor = new VmPipeAcceptor();
         SocketAddress address = new VmPipeAddress(connectUri.getPort());
         IoConnector connector = new VmPipeConnector();
-        return new MinaEndpoint(uri, this, address, acceptor, null, connector, 
null, false, 0, false);
+        return new MinaEndpoint(uri, this, address, acceptor, null, connector, 
null, false, 0, false, false);
     }
 
     protected MinaEndpoint createSocketEndpoint(String uri, URI connectUri, 
Map parameters) {
@@ -113,15 +124,6 @@
         SocketAddress address = new InetSocketAddress(connectUri.getHost(), 
connectUri.getPort());
         IoConnector connector = new SocketConnector();
 
-        boolean lazySessionCreation = getAndRemoveParameter(parameters, 
"lazySessionCreation", Boolean.class, false);
-        long timeout = getAndRemoveParameter(parameters, "timeout", 
Long.class, 0L);
-        boolean transferExchange = getAndRemoveParameter(parameters, 
"transferExchange", Boolean.class, false);
-        boolean sync = getAndRemoveParameter(parameters, "sync", 
Boolean.class, false);
-        boolean minaLogger = getAndRemoveParameter(parameters, "minaLogger", 
Boolean.class, false);
-        boolean textline = getAndRemoveParameter(parameters, "textline", 
Boolean.class, false);
-        String encoding = getAndRemoveParameter(parameters, "encoding", 
String.class);
-        String codec = getAndRemoveParameter(parameters, "codec", 
String.class);
-
         // connector config
         SocketConnectorConfig connectorConfig = new SocketConnectorConfig();
         configureSocketCodecFactory("MinaProducer", connectorConfig, textline, 
encoding, codec);
@@ -141,7 +143,7 @@
             acceptorConfig.getFilterChain().addLast("logger", new 
LoggingFilter());
         }
 
-        MinaEndpoint endpoint = new MinaEndpoint(uri, this, address, acceptor, 
acceptorConfig, connector, connectorConfig, lazySessionCreation, timeout, 
transferExchange);
+        MinaEndpoint endpoint = new MinaEndpoint(uri, this, address, acceptor, 
acceptorConfig, connector, connectorConfig, lazySessionCreation, timeout, 
transferExchange, sync);
 
         // set sync or async mode after endpoint is created
         if (sync) {
@@ -180,13 +182,9 @@
         SocketAddress address = new InetSocketAddress(connectUri.getHost(), 
connectUri.getPort());
         IoConnector connector = new DatagramConnector();
 
-        boolean lazySessionCreation = getAndRemoveParameter(parameters, 
"lazySessionCreation", Boolean.class, false);
-        long timeout = getAndRemoveParameter(parameters, "timeout", 
Long.class, 0L);
-        boolean transferExchange = false; // transfer exchange is not 
supported for datagram protocol
-        boolean sync = getAndRemoveParameter(parameters, "sync", 
Boolean.class, false);
-        boolean minaLogger = getAndRemoveParameter(parameters, "minaLogger", 
Boolean.class, false);
-        String encoding = getAndRemoveParameter(parameters, "encoding", 
String.class);
-        String codec = getAndRemoveParameter(parameters, "codec", 
String.class);
+        if (transferExchange) {
+            throw new IllegalArgumentException("transferExchange=true is not 
supported for datagram protocol");
+        }
 
         DatagramConnectorConfig connectorConfig = new 
DatagramConnectorConfig();
         configureDataGramCodecFactory("MinaProducer", connectorConfig, 
encoding, codec);
@@ -205,7 +203,7 @@
             acceptorConfig.getFilterChain().addLast("logger", new 
LoggingFilter());
         }
 
-        MinaEndpoint endpoint = new MinaEndpoint(uri, this, address, acceptor, 
acceptorConfig, connector, connectorConfig, lazySessionCreation, timeout, 
transferExchange);
+        MinaEndpoint endpoint = new MinaEndpoint(uri, this, address, acceptor, 
acceptorConfig, connector, connectorConfig, lazySessionCreation, timeout, 
transferExchange, sync);
 
         // set sync or async mode after endpoint is created
         if (sync) {
@@ -311,4 +309,70 @@
         config.getFilterChain().addLast("codec", new 
ProtocolCodecFilter(codecFactory));
     }
 
+    // Properties
+    //-------------------------------------------------------------------------
+
+    public boolean isSync() {
+        return sync;
+    }
+
+    public void setSync(boolean sync) {
+        this.sync = sync;
+    }
+
+    public boolean isTextline() {
+        return textline;
+    }
+
+    public void setTextline(boolean textline) {
+        this.textline = textline;
+    }
+
+    public String getCodec() {
+        return codec;
+    }
+
+    public void setCodec(String codec) {
+        this.codec = codec;
+    }
+
+    public String getEncoding() {
+        return encoding;
+    }
+
+    public void setEncoding(String encoding) {
+        this.encoding = encoding;
+    }
+
+    public long getTimeout() {
+        return timeout;
+    }
+
+    public void setTimeout(long timeout) {
+        this.timeout = timeout;
+    }
+
+    public boolean isLazySessionCreation() {
+        return lazySessionCreation;
+    }
+
+    public void setLazySessionCreation(boolean lazySessionCreation) {
+        this.lazySessionCreation = lazySessionCreation;
+    }
+
+    public boolean isTransferExchange() {
+        return transferExchange;
+    }
+
+    public void setTransferExchange(boolean transferExchange) {
+        this.transferExchange = transferExchange;
+    }
+
+    public boolean isMinaLogger() {
+        return minaLogger;
+    }
+
+    public void setMinaLogger(boolean minaLogger) {
+        this.minaLogger = minaLogger;
+    }
 }

Modified: 
activemq/camel/trunk/components/camel-mina/src/main/java/org/apache/camel/component/mina/MinaConsumer.java
URL: 
http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-mina/src/main/java/org/apache/camel/component/mina/MinaConsumer.java?rev=688965&r1=688964&r2=688965&view=diff
==============================================================================
--- 
activemq/camel/trunk/components/camel-mina/src/main/java/org/apache/camel/component/mina/MinaConsumer.java
 (original)
+++ 
activemq/camel/trunk/components/camel-mina/src/main/java/org/apache/camel/component/mina/MinaConsumer.java
 Mon Aug 25 22:38:48 2008
@@ -40,12 +40,14 @@
     private final MinaEndpoint endpoint;
     private final SocketAddress address;
     private final IoAcceptor acceptor;
+    private boolean sync;
 
     public MinaConsumer(final MinaEndpoint endpoint, Processor processor) {
         super(endpoint, processor);
         this.endpoint = endpoint;
         this.address = endpoint.getAddress();
         this.acceptor = endpoint.getAcceptor();
+        this.sync = endpoint.isSync();
     }
 
     @Override
@@ -94,8 +96,14 @@
             MinaExchange exchange = endpoint.createExchange(session, object);
             getProcessor().process(exchange);
 
-            if (ExchangeHelper.isOutCapable(exchange)) {
-                Object body = MinaPayloadHelper.getOut(endpoint, exchange);
+            // if sync then we should return a response
+            if (sync) {
+                Object body;
+                if (ExchangeHelper.isOutCapable(exchange)) {
+                    body = MinaPayloadHelper.getOut(endpoint, exchange);
+                } else {
+                    body = MinaPayloadHelper.getIn(endpoint, exchange);
+                }
                 boolean failed = exchange.isFailed();
 
                 if (failed) {
@@ -115,11 +123,7 @@
                     }
                     MinaHelper.writeBody(session, body, exchange);
                 }
-            } else {
-                if (LOG.isDebugEnabled()) {
-                    LOG.debug("Can not write body since this exchange is not 
out capable: " + exchange);
-                }
-            }
+            } 
         }
 
     }

Modified: 
activemq/camel/trunk/components/camel-mina/src/main/java/org/apache/camel/component/mina/MinaEndpoint.java
URL: 
http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-mina/src/main/java/org/apache/camel/component/mina/MinaEndpoint.java?rev=688965&r1=688964&r2=688965&view=diff
==============================================================================
--- 
activemq/camel/trunk/components/camel-mina/src/main/java/org/apache/camel/component/mina/MinaEndpoint.java
 (original)
+++ 
activemq/camel/trunk/components/camel-mina/src/main/java/org/apache/camel/component/mina/MinaEndpoint.java
 Mon Aug 25 22:38:48 2008
@@ -46,11 +46,12 @@
     private final IoConnectorConfig connectorConfig;
     private final boolean lazySessionCreation;
     private final boolean transferExchange;
+    private final boolean sync;
 
     public MinaEndpoint(String endpointUri, MinaComponent component, 
SocketAddress address,
                         IoAcceptor acceptor, IoAcceptorConfig acceptorConfig, 
IoConnector connector,
                         IoConnectorConfig connectorConfig, boolean 
lazySessionCreation, long timeout,
-                        boolean transferExchange) {
+                        boolean transferExchange, boolean sync) {
         super(endpointUri, component);
         this.address = address;
         this.acceptor = acceptor;
@@ -63,6 +64,7 @@
             this.timeout = timeout;
         }
         this.transferExchange = transferExchange;
+        this.sync = sync;
     }
 
     @SuppressWarnings({"unchecked"})
@@ -123,4 +125,7 @@
         return transferExchange;
     }
 
+    public boolean isSync() {
+        return sync;
+    }
 }

Modified: 
activemq/camel/trunk/components/camel-mina/src/main/java/org/apache/camel/component/mina/MinaProducer.java
URL: 
http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-mina/src/main/java/org/apache/camel/component/mina/MinaProducer.java?rev=688965&r1=688964&r2=688965&view=diff
==============================================================================
--- 
activemq/camel/trunk/components/camel-mina/src/main/java/org/apache/camel/component/mina/MinaProducer.java
 (original)
+++ 
activemq/camel/trunk/components/camel-mina/src/main/java/org/apache/camel/component/mina/MinaProducer.java
 Mon Aug 25 22:38:48 2008
@@ -54,8 +54,9 @@
     public MinaProducer(MinaEndpoint endpoint) {
         super(endpoint);
         this.endpoint = endpoint;
-        this.lazySessionCreation = this.endpoint.isLazySessionCreation();
-        this.timeout = this.endpoint.getTimeout();
+        this.lazySessionCreation = endpoint.isLazySessionCreation();
+        this.timeout = endpoint.getTimeout();
+        this.sync = endpoint.isSync();
     }
 
     public void process(Exchange exchange) throws Exception {
@@ -73,7 +74,6 @@
         }
 
         // if sync is true then we should also wait for a response 
(synchronous mode)
-        sync = ExchangeHelper.isOutCapable(exchange);
         if (sync) {
             // only initialize latch if we should get a response
             latch = new CountDownLatch(1);
@@ -97,7 +97,12 @@
             if (handler.getCause() != null) {
                 throw new CamelException("Response Handler had an exception", 
handler.getCause());
             } else {
-                MinaPayloadHelper.setOut(exchange, handler.getMessage());
+                // set the result on either IN or OUT on the original exchange 
depending on its pattern
+                if (ExchangeHelper.isOutCapable(exchange)) {
+                    MinaPayloadHelper.setOut(exchange, handler.getMessage());
+                } else {
+                    MinaPayloadHelper.setIn(exchange, handler.getMessage());
+                }
             }
         }
     }

Modified: 
activemq/camel/trunk/components/camel-mina/src/test/java/org/apache/camel/component/mina/MinaEncodingTest.java
URL: 
http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-mina/src/test/java/org/apache/camel/component/mina/MinaEncodingTest.java?rev=688965&r1=688964&r2=688965&view=diff
==============================================================================
--- 
activemq/camel/trunk/components/camel-mina/src/test/java/org/apache/camel/component/mina/MinaEncodingTest.java
 (original)
+++ 
activemq/camel/trunk/components/camel-mina/src/test/java/org/apache/camel/component/mina/MinaEncodingTest.java
 Mon Aug 25 22:38:48 2008
@@ -33,7 +33,7 @@
 public class MinaEncodingTest extends ContextTestSupport {
 
     public void testTCPEncodeUTF8InputIsBytes() throws Exception {
-        final String uri = "mina:tcp://localhost:8080?encoding=UTF-8";
+        final String uri = 
"mina:tcp://localhost:8080?encoding=UTF-8&sync=false";
         this.context.addRoutes(new RouteBuilder() {
             public void configure() {
                 from(uri).to("mock:result");
@@ -53,7 +53,7 @@
     }
 
     public void testTCPEncodeUTF8InputIsString() throws Exception {
-        final String uri = "mina:tcp://localhost:8080?encoding=UTF-8";
+        final String uri = 
"mina:tcp://localhost:8080?encoding=UTF-8&sync=false";
         this.context.addRoutes(new RouteBuilder() {
             public void configure() {
                 from(uri).to("mock:result");
@@ -73,7 +73,7 @@
     }
 
     public void testTCPEncodeUTF8TextLineInputIsString() throws Exception {
-        final String uri = 
"mina:tcp://localhost:8080?textline=true&encoding=UTF-8";
+        final String uri = 
"mina:tcp://localhost:8080?textline=true&encoding=UTF-8&sync=false";
         this.context.addRoutes(new RouteBuilder() {
             public void configure() {
                 from(uri).to("mock:result");
@@ -96,7 +96,7 @@
     // See TextLineEncoder#encode where the message is converted to String 
using .toString()
 
     public void testUDPEncodeUTF8InputIsBytes() throws Exception {
-        final String uri = "mina:udp://localhost:8080?encoding=UTF-8";
+        final String uri = 
"mina:udp://localhost:8080?encoding=UTF-8&sync=false";
         this.context.addRoutes(new RouteBuilder() {
             public void configure() {
                 from(uri).to("mock:result");
@@ -116,7 +116,7 @@
     }
 
     public void testUDPEncodeUTF8InputIsString() throws Exception {
-        final String uri = "mina:udp://localhost:8080?encoding=UTF-8";
+        final String uri = 
"mina:udp://localhost:8080?encoding=UTF-8&sync=false";
         this.context.addRoutes(new RouteBuilder() {
             public void configure() {
                 from(uri).to("mock:result");
@@ -172,7 +172,7 @@
     }
 
     public void testInvalidEncoding() throws Exception {
-        final String uri = 
"mina:tcp://localhost:8080?textline=true&encoding=XXX";
+        final String uri = 
"mina:tcp://localhost:8080?textline=true&encoding=XXX&sync=false";
 
         try {
             this.context.addRoutes(new RouteBuilder() {

Added: 
activemq/camel/trunk/components/camel-mina/src/test/java/org/apache/camel/component/mina/MinaInOnlyRouteTest.java
URL: 
http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-mina/src/test/java/org/apache/camel/component/mina/MinaInOnlyRouteTest.java?rev=688965&view=auto
==============================================================================
--- 
activemq/camel/trunk/components/camel-mina/src/test/java/org/apache/camel/component/mina/MinaInOnlyRouteTest.java
 (added)
+++ 
activemq/camel/trunk/components/camel-mina/src/test/java/org/apache/camel/component/mina/MinaInOnlyRouteTest.java
 Mon Aug 25 22:38:48 2008
@@ -0,0 +1,56 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.mina;
+
+import org.apache.camel.ContextTestSupport;
+import org.apache.camel.Exchange;
+import org.apache.camel.Processor;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+
+/**
+ * Unit test to verify that MINA can be used with an InOnly MEP but still use 
sync to send and receive data
+ * from a remote server.
+ */
+public class MinaInOnlyRouteTest extends ContextTestSupport {
+
+    public void testInOnlyUsingMina() throws Exception {
+        MockEndpoint mock = getMockEndpoint("mock:result");
+        mock.expectedBodiesReceived("Bye Claus");
+        mock.setResultWaitTime(5000);
+
+        assertMockEndpointsSatisifed();
+    }
+
+    @Override
+    protected RouteBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            public void configure() throws Exception {
+                from("mina:tcp://localhost:8080?sync=true").process(new 
Processor() {
+                    public void process(Exchange exchange) throws Exception {
+                        String body = exchange.getIn().getBody(String.class);
+                        exchange.getOut().setBody("Bye " + body);
+                    }
+                });
+
+                from("timer://start?period=10000&delay=2000")
+                        .setBody(constant("Claus"))
+                        
.to("mina:tcp://localhost:8080?sync=true").to("mock:result");
+            }
+        };
+    }
+}

Propchange: 
activemq/camel/trunk/components/camel-mina/src/test/java/org/apache/camel/component/mina/MinaInOnlyRouteTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
activemq/camel/trunk/components/camel-mina/src/test/java/org/apache/camel/component/mina/MinaInOnlyRouteTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: 
activemq/camel/trunk/components/camel-mina/src/test/java/org/apache/camel/component/mina/MinaLoggerOptionTest.java
URL: 
http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-mina/src/test/java/org/apache/camel/component/mina/MinaLoggerOptionTest.java?rev=688965&r1=688964&r2=688965&view=diff
==============================================================================
--- 
activemq/camel/trunk/components/camel-mina/src/test/java/org/apache/camel/component/mina/MinaLoggerOptionTest.java
 (original)
+++ 
activemq/camel/trunk/components/camel-mina/src/test/java/org/apache/camel/component/mina/MinaLoggerOptionTest.java
 Mon Aug 25 22:38:48 2008
@@ -32,7 +32,7 @@
 public class MinaLoggerOptionTest extends ContextTestSupport {
 
     public void testLoggerOptionTrue() throws Exception {
-        final String uri = 
"mina:tcp://localhost:6321?textline=true&minaLogger=true";
+        final String uri = 
"mina:tcp://localhost:6321?textline=true&minaLogger=true&sync=false";
         context.addRoutes(new RouteBuilder() {
             public void configure() throws Exception {
                 from(uri).to("mock:result");
@@ -62,7 +62,7 @@
     }
 
     public void testLoggerOptionFalse() throws Exception {
-        final String uri = 
"mina:tcp://localhost:6321?textline=true&minaLogger=false";
+        final String uri = 
"mina:tcp://localhost:6321?textline=true&minaLogger=false&sync=false";
         context.addRoutes(new RouteBuilder() {
             public void configure() throws Exception {
                 from(uri).to("mock:result");
@@ -92,7 +92,7 @@
     }
 
     public void testNoLoggerOption() throws Exception {
-        final String uri = "mina:tcp://localhost:6321?textline=true";
+        final String uri = 
"mina:tcp://localhost:6321?textline=true&sync=false";
         context.addRoutes(new RouteBuilder() {
             public void configure() throws Exception {
                 from(uri).to("mock:result");

Modified: 
activemq/camel/trunk/components/camel-mina/src/test/java/org/apache/camel/component/mina/MinaMulticastTest.java
URL: 
http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-mina/src/test/java/org/apache/camel/component/mina/MinaMulticastTest.java?rev=688965&r1=688964&r2=688965&view=diff
==============================================================================
--- 
activemq/camel/trunk/components/camel-mina/src/test/java/org/apache/camel/component/mina/MinaMulticastTest.java
 (original)
+++ 
activemq/camel/trunk/components/camel-mina/src/test/java/org/apache/camel/component/mina/MinaMulticastTest.java
 Mon Aug 25 22:38:48 2008
@@ -22,7 +22,7 @@
 public class MinaMulticastTest extends MinaVmTest {
     @Override
     protected void setUp() throws Exception {
-        uri = "mina:multicast://127.0.0.1:6255";
+        uri = "mina:multicast://127.0.0.1:6255?sync=false";
         super.setUp();
     }
 }

Modified: 
activemq/camel/trunk/components/camel-mina/src/test/java/org/apache/camel/component/mina/MinaUdpTest.java
URL: 
http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-mina/src/test/java/org/apache/camel/component/mina/MinaUdpTest.java?rev=688965&r1=688964&r2=688965&view=diff
==============================================================================
--- 
activemq/camel/trunk/components/camel-mina/src/test/java/org/apache/camel/component/mina/MinaUdpTest.java
 (original)
+++ 
activemq/camel/trunk/components/camel-mina/src/test/java/org/apache/camel/component/mina/MinaUdpTest.java
 Mon Aug 25 22:38:48 2008
@@ -21,8 +21,6 @@
 import java.net.InetAddress;
 
 import org.apache.camel.ContextTestSupport;
-import org.apache.camel.Exchange;
-import org.apache.camel.Processor;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
 
@@ -60,8 +58,8 @@
     protected RouteBuilder createRouteBuilder() {
         return new RouteBuilder() {
             public void configure() {
-                from("mina:udp://127.0.0.1:" + 
port).to("mina:udp://127.0.0.1:9000");
-                from("mina:udp://127.0.0.1:9000").to("mock:result");
+                from("mina:udp://127.0.0.1:" + port + 
"?sync=false").to("mina:udp://127.0.0.1:9000?sync=false");
+                from("mina:udp://127.0.0.1:9000?sync=false").to("mock:result");
             }
         };
     }

Modified: 
activemq/camel/trunk/components/camel-mina/src/test/java/org/apache/camel/component/mina/MinaUdpUsingTemplateTest.java
URL: 
http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-mina/src/test/java/org/apache/camel/component/mina/MinaUdpUsingTemplateTest.java?rev=688965&r1=688964&r2=688965&view=diff
==============================================================================
--- 
activemq/camel/trunk/components/camel-mina/src/test/java/org/apache/camel/component/mina/MinaUdpUsingTemplateTest.java
 (original)
+++ 
activemq/camel/trunk/components/camel-mina/src/test/java/org/apache/camel/component/mina/MinaUdpUsingTemplateTest.java
 Mon Aug 25 22:38:48 2008
@@ -53,7 +53,7 @@
         endpoint.expectedMessageCount(1);
 
         byte[] in = "Hello from bytes".getBytes();
-        template.sendBody("mina:udp://127.0.0.1:4445", in);
+        template.sendBody("mina:udp://127.0.0.1:4445?sync=false", in);
 
         // sleeping for while to let the mock endpoint get all the message
         Thread.sleep(2000);
@@ -70,7 +70,7 @@
     protected RouteBuilder createRouteBuilder() {
         return new RouteBuilder() {
             public void configure() {
-                from("mina:udp://127.0.0.1:4445").to("mock:result");
+                from("mina:udp://127.0.0.1:4445?sync=false").to("mock:result");
             }
         };
     }

Modified: 
activemq/camel/trunk/components/camel-mina/src/test/java/org/apache/camel/component/mina/MinaVmTest.java
URL: 
http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-mina/src/test/java/org/apache/camel/component/mina/MinaVmTest.java?rev=688965&r1=688964&r2=688965&view=diff
==============================================================================
--- 
activemq/camel/trunk/components/camel-mina/src/test/java/org/apache/camel/component/mina/MinaVmTest.java
 (original)
+++ 
activemq/camel/trunk/components/camel-mina/src/test/java/org/apache/camel/component/mina/MinaVmTest.java
 Mon Aug 25 22:38:48 2008
@@ -24,7 +24,7 @@
  * @version $Revision$
  */
 public class MinaVmTest extends ContextTestSupport {
-    protected String uri = "mina:vm://localhost:8080";
+    protected String uri = "mina:vm://localhost:8080?sync=false";
 
     public void testMinaRoute() throws Exception {
         MockEndpoint endpoint = getMockEndpoint("mock:result");


Reply via email to