camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jans...@apache.org
Subject svn commit: r790702 - in /camel/branches/camel-1.x: ./ components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcConfiguration.java components/camel-irc/src/test/java/org/apache/camel/component/irc/IrcRouteTest.java
Date Thu, 02 Jul 2009 18:38:06 GMT
Author: janstey
Date: Thu Jul  2 18:38:05 2009
New Revision: 790702

URL: http://svn.apache.org/viewvc?rev=790702&view=rev
Log:
Merged revisions 790701 via svnmerge from 
https://svn.apache.org/repos/asf/camel/trunk

........
  r790701 | janstey | 2009-07-02 14:22:04 -0400 (Thu, 02 Jul 2009) | 1 line
  
  CAMEL-1786 - fix parsing of channel name with parameters. Thanks to Stan Lewis for the patch
........

Modified:
    camel/branches/camel-1.x/   (props changed)
    camel/branches/camel-1.x/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcConfiguration.java
    camel/branches/camel-1.x/components/camel-irc/src/test/java/org/apache/camel/component/irc/IrcRouteTest.java

Propchange: camel/branches/camel-1.x/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: camel/branches/camel-1.x/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcConfiguration.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-1.x/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcConfiguration.java?rev=790702&r1=790701&r2=790702&view=diff
==============================================================================
--- camel/branches/camel-1.x/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcConfiguration.java
(original)
+++ camel/branches/camel-1.x/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcConfiguration.java
Thu Jul  2 18:38:05 2009
@@ -19,6 +19,7 @@
 import java.net.URI;
 
 import org.apache.camel.RuntimeCamelException;
+import org.apache.camel.util.ObjectHelper;
 
 public class IrcConfiguration implements Cloneable {
     private String target;
@@ -89,8 +90,15 @@
             throw new RuntimeCamelException("The IRC channel name is required but not configured");
         }
 
-        setTarget("#" + uri.getFragment());
-    }
+        String channel = uri.getFragment();
+
+        if ( channel.contains("?")) {
+            //Need to strip off the query string from this fragment
+            channel = ObjectHelper.before(uri.getFragment(), "?");
+        }
+
+        setTarget("#" + channel);
+}
 
     public String getHostname() {
         return hostname;

Modified: camel/branches/camel-1.x/components/camel-irc/src/test/java/org/apache/camel/component/irc/IrcRouteTest.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-1.x/components/camel-irc/src/test/java/org/apache/camel/component/irc/IrcRouteTest.java?rev=790702&r1=790701&r2=790702&view=diff
==============================================================================
--- camel/branches/camel-1.x/components/camel-irc/src/test/java/org/apache/camel/component/irc/IrcRouteTest.java
(original)
+++ camel/branches/camel-1.x/components/camel-irc/src/test/java/org/apache/camel/component/irc/IrcRouteTest.java
Thu Jul  2 18:38:05 2009
@@ -49,7 +49,7 @@
     protected RouteBuilder createRouteBuilder() throws Exception {
         return new RouteBuilder() {
             public void configure() throws Exception {
-                from("irc://camel-con@irc.codehaus.org:6667/#camel-test").
+                from("irc://camel-con@irc.codehaus.org:6667/#camel-test?nickname=camel-con").
                         choice().
                         when(header("irc.messageType").isEqualTo("PRIVMSG")).to("mock:result").
                         when(header("irc.messageType").isEqualTo("JOIN")).to("seda:consumerJoined");
@@ -74,7 +74,7 @@
             sentMessages = true;
 
             // now the consumer has joined, lets send some messages
-            String sendUri = "irc://camel-prd@irc.codehaus.org:6667/#camel-test";
+            String sendUri = "irc://camel-prd@irc.codehaus.org:6667/#camel-test?nickname=camel-prd";
 
             template.sendBody(sendUri, body1);
             template.sendBody(sendUri, body2);



Mime
View raw message