camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r766290 - in /camel/branches/camel-1.x: ./ components/camel-irc/src/main/java/org/apache/camel/component/irc/ components/camel-irc/src/test/java/org/apache/camel/component/irc/ components/camel-irc/src/test/resources/
Date Sat, 18 Apr 2009 10:28:54 GMT
Author: davsclaus
Date: Sat Apr 18 10:28:53 2009
New Revision: 766290

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

........
  r766289 | davsclaus | 2009-04-18 12:24:14 +0200 (Sat, 18 Apr 2009) | 1 line
  
  CAMEL-1524: camel-irc can now handle IRC channel to be set using #. Thanks to patch from
Darren Davison.
........

Added:
    camel/branches/camel-1.x/components/camel-irc/src/test/java/org/apache/camel/component/irc/IrcRouteTest.java
  (contents, props changed)
      - copied, changed from r766289, camel/branches/camel-1.x/components/camel-irc/src/test/java/org/apache/camel/component/irc/IrcRouteIntegration.java
Removed:
    camel/branches/camel-1.x/components/camel-irc/src/test/java/org/apache/camel/component/irc/IrcRouteIntegration.java
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/resources/log4j.properties

Propchange: camel/branches/camel-1.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Apr 18 10:28:53 2009
@@ -1 +1 @@
-/camel/trunk:736980,739733,739904,740251,740295,740306,740596,740663,741848,742231,742705,742739,742854,742856,742898,742906,743613,743762,743773,743920,743959-743960,744123,745105,745367,745541,745751,745826,745978,746269,746872,746895,746962,747258,747678-747704,748392,748436,748821,749563-749564,749574,749628-749629,749936,749956,750017,750334,750396,750761,750796,752068,752117,752418,752751-752755,752764-752773,752956,753087,753101,753175,755136,755487,756313,756348,756870,756939,757636,757693,757743,757865,758539,758563,758600,758617,758692,758990,759362,759453,759887,759931,760003,760890,760909,760937,761194,761536,761583,761607,762047,762633,762650,762935,763095,763484,763551,765154,765686,765729,765743,765824,766016
+/camel/trunk:736980,739733,739904,740251,740295,740306,740596,740663,741848,742231,742705,742739,742854,742856,742898,742906,743613,743762,743773,743920,743959-743960,744123,745105,745367,745541,745751,745826,745978,746269,746872,746895,746962,747258,747678-747704,748392,748436,748821,749563-749564,749574,749628-749629,749936,749956,750017,750334,750396,750761,750796,752068,752117,752418,752751-752755,752764-752773,752956,753087,753101,753175,755136,755487,756313,756348,756870,756939,757636,757693,757743,757865,758539,758563,758600,758617,758692,758990,759362,759453,759887,759931,760003,760890,760909,760937,761194,761536,761583,761607,762047,762633,762650,762935,763095,763484,763551,765154,765686,765729,765743,765824,766016,766289

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=766290&r1=766289&r2=766290&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
Sat Apr 18 10:28:53 2009
@@ -61,7 +61,7 @@
 
     public IrcConfiguration copy() {
         try {
-            return (IrcConfiguration)clone();
+            return (IrcConfiguration) clone();
         } catch (CloneNotSupportedException e) {
             throw new RuntimeCamelException(e);
         }
@@ -72,11 +72,24 @@
     }
 
     public void configure(URI uri) {
+        // fix provided URI and handle that we can use # to indicate the IRC room
+
+        String fixedUri = uri.toString();
+        if (!fixedUri.startsWith("irc://")) {
+            fixedUri = fixedUri.replace("irc:", "irc://");
+            uri = uri.resolve(fixedUri);
+        }
+
         setNickname(uri.getUserInfo());
         setUsername(uri.getUserInfo());
         setRealname(uri.getUserInfo());
         setHostname(uri.getHost());
-        setTarget(uri.getPath().substring(1));
+
+        if (uri.getFragment() == null || uri.getFragment().length() == 0) {
+            throw new RuntimeCamelException("The IRC channel name is required but not configured");
+        }
+
+        setTarget("#" + uri.getFragment());
     }
 
     public String getHostname() {

Copied: camel/branches/camel-1.x/components/camel-irc/src/test/java/org/apache/camel/component/irc/IrcRouteTest.java
(from r766289, camel/branches/camel-1.x/components/camel-irc/src/test/java/org/apache/camel/component/irc/IrcRouteIntegration.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?p2=camel/branches/camel-1.x/components/camel-irc/src/test/java/org/apache/camel/component/irc/IrcRouteTest.java&p1=camel/branches/camel-1.x/components/camel-irc/src/test/java/org/apache/camel/component/irc/IrcRouteIntegration.java&r1=766289&r2=766290&rev=766290&view=diff
==============================================================================
--- camel/branches/camel-1.x/components/camel-irc/src/test/java/org/apache/camel/component/irc/IrcRouteIntegration.java
(original)
+++ camel/branches/camel-1.x/components/camel-irc/src/test/java/org/apache/camel/component/irc/IrcRouteTest.java
Sat Apr 18 10:28:53 2009
@@ -27,7 +27,7 @@
 /**
  * @version $Revision$
  */
-public class IrcRouteIntegration extends ContextTestSupport {
+public class IrcRouteTest extends ContextTestSupport {
     protected MockEndpoint resultEndpoint;
     protected String body1 = "Message One";
     protected String body2 = "Message Two";
@@ -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/%23camel-test").
+                from("irc://camel-con@irc.codehaus.org:6667/#camel-test").
                         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/%23camel-test";
+            String sendUri = "irc://camel-prd@irc.codehaus.org:6667/#camel-test";
 
             template.sendBody(sendUri, body1);
             template.sendBody(sendUri, body2);

Propchange: camel/branches/camel-1.x/components/camel-irc/src/test/java/org/apache/camel/component/irc/IrcRouteTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: camel/branches/camel-1.x/components/camel-irc/src/test/java/org/apache/camel/component/irc/IrcRouteTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: camel/branches/camel-1.x/components/camel-irc/src/test/resources/log4j.properties
URL: http://svn.apache.org/viewvc/camel/branches/camel-1.x/components/camel-irc/src/test/resources/log4j.properties?rev=766290&r1=766289&r2=766290&view=diff
==============================================================================
--- camel/branches/camel-1.x/components/camel-irc/src/test/resources/log4j.properties (original)
+++ camel/branches/camel-1.x/components/camel-irc/src/test/resources/log4j.properties Sat
Apr 18 10:28:53 2009
@@ -18,7 +18,7 @@
 #
 # The logging properties used for eclipse testing, We want to see debug output on the console.
 #
-log4j.rootLogger=INFO, out
+log4j.rootLogger=INFO, file
 
 #log4j.logger.org.apache.camel=DEBUG
 
@@ -27,3 +27,11 @@
 log4j.appender.out.layout=org.apache.log4j.PatternLayout
 log4j.appender.out.layout.ConversionPattern=[%30.30t] %-30.30c{1} %-5p %m%n
 #log4j.appender.out.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n
+
+# File appender
+log4j.appender.file=org.apache.log4j.FileAppender
+log4j.appender.file.layout=org.apache.log4j.PatternLayout
+log4j.appender.file.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n
+log4j.appender.file.file=target/camel-irc-test.log
+log4j.appender.file.append=true
+



Mime
View raw message