camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r748183 - in /camel/trunk/components/camel-irc/src: main/java/org/apache/camel/component/irc/ test/java/org/apache/camel/component/irc/ test/resources/
Date Thu, 26 Feb 2009 15:42:03 GMT
Author: davsclaus
Date: Thu Feb 26 15:41:56 2009
New Revision: 748183

URL: http://svn.apache.org/viewvc?rev=748183&view=rev
Log:
CAMEL-1373: CamelCase keys and polished code.

Added:
    camel/trunk/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcConstants.java
  (with props)
    camel/trunk/components/camel-irc/src/test/java/org/apache/camel/component/irc/IrcRouteTest.java
  (contents, props changed)
      - copied, changed from r748160, camel/trunk/components/camel-irc/src/test/java/org/apache/camel/component/irc/IrcRouteIntegration.java
Removed:
    camel/trunk/components/camel-irc/src/test/java/org/apache/camel/component/irc/IrcRouteIntegration.java
Modified:
    camel/trunk/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcBinding.java
    camel/trunk/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcComponent.java
    camel/trunk/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcConfiguration.java
    camel/trunk/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcConsumer.java
    camel/trunk/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcExchange.java
    camel/trunk/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcMessage.java
    camel/trunk/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcProducer.java
    camel/trunk/components/camel-irc/src/test/java/org/apache/camel/component/irc/CodehausIrcChat.java
    camel/trunk/components/camel-irc/src/test/resources/log4j.properties

Modified: camel/trunk/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcBinding.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcBinding.java?rev=748183&r1=748182&r2=748183&view=diff
==============================================================================
--- camel/trunk/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcBinding.java
(original)
+++ camel/trunk/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcBinding.java
Thu Feb 26 15:41:56 2009
@@ -17,6 +17,7 @@
 package org.apache.camel.component.irc;
 
 public class IrcBinding {
+
     public Object extractBodyFromIrc(IrcExchange exchange, IrcMessage message) {
         String type = message.getMessageType();
         String text = message.getMessage();

Modified: camel/trunk/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcComponent.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcComponent.java?rev=748183&r1=748182&r2=748183&view=diff
==============================================================================
--- camel/trunk/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcComponent.java
(original)
+++ camel/trunk/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcComponent.java
Thu Feb 26 15:41:56 2009
@@ -50,30 +50,16 @@
         configuration = new IrcConfiguration();
     }
 
-    public static IrcComponent ircComponent() {
-        return new IrcComponent();
-    }
-
     protected IrcEndpoint createEndpoint(String uri, String remaining, Map parameters) throws
Exception {
+        // lets make sure we copy the configuration as each endpoint can customize its own
version
         IrcConfiguration config = getConfiguration().copy();
         config.configure(new URI(uri));
 
-        // lets make sure we copy the configuration as each endpoint can
-        // customize its own version
-        final IrcEndpoint endpoint = new IrcEndpoint(uri, this, config);
-
+        IrcEndpoint endpoint = new IrcEndpoint(uri, this, config);
         setProperties(endpoint.getConfiguration(), parameters);
         return endpoint;
     }
 
-    public IrcConfiguration getConfiguration() {
-        return configuration;
-    }
-
-    public void setConfiguration(IrcConfiguration configuration) {
-        this.configuration = configuration;
-    }
-
     public synchronized IRCConnection getIRCConnection(IrcConfiguration configuration) {
         final IRCConnection connection;
         if (connectionCache.containsKey(configuration.getCacheKey())) {
@@ -89,20 +75,20 @@
     }
 
     protected IRCConnection createConnection(IrcConfiguration configuration) {
-        LOG.debug("Creating Connection to " + configuration.getHostname() + " destination:
" + configuration.getTarget() + " nick: " + configuration.getNickname() + " user: "
-                  + configuration.getUsername());
+        if (LOG.isDebugEnabled()) {
+            LOG.debug("Creating Connection to " + configuration.getHostname() + " destination:
" + configuration.getTarget()
+                    + " nick: " + configuration.getNickname() + " user: " + configuration.getUsername());
+        }
 
-        final IRCConnection conn = new IRCConnection(configuration.getHostname(), configuration.getPorts(),
configuration.getPassword(), configuration.getNickname(), configuration.getUsername(),
-                                                     configuration.getRealname());
+        final IRCConnection conn = new IRCConnection(configuration.getHostname(), configuration.getPorts(),
configuration.getPassword(),
+                                                     configuration.getNickname(), configuration.getUsername(),
configuration.getRealname());
         conn.setEncoding("UTF-8");
-        // conn.setDaemon(true);
         conn.setColors(configuration.isColors());
         conn.setPong(true);
 
         try {
             conn.connect();
         } catch (Exception e) {
-            LOG.error("Failed to connect: " + e, e);
             throw new RuntimeCamelException(e);
         }
         return conn;
@@ -113,14 +99,13 @@
             connection.doQuit();
             connection.close();
         } catch (Exception e) {
-            LOG.warn("Error closing connection.", e);
+            LOG.warn("Error during closing connection.", e);
         }
     }
 
     @Override
     protected synchronized void doStop() throws Exception {
-        // lets use a copy so we can clear the connections eagerly in case of
-        // exceptions
+        // lets use a copy so we can clear the connections eagerly in case of exceptions
         Map<String, IRCConnection> map = new HashMap<String, IRCConnection>(connectionCache);
         connectionCache.clear();
         for (Map.Entry<String, IRCConnection> entry : map.entrySet()) {
@@ -128,4 +113,13 @@
         }
         super.doStop();
     }
+
+    public IrcConfiguration getConfiguration() {
+        return configuration;
+    }
+
+    public void setConfiguration(IrcConfiguration configuration) {
+        this.configuration = configuration;
+    }
+
 }

Modified: camel/trunk/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcConfiguration.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcConfiguration.java?rev=748183&r1=748182&r2=748183&view=diff
==============================================================================
--- camel/trunk/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcConfiguration.java
(original)
+++ camel/trunk/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcConfiguration.java
Thu Feb 26 15:41:56 2009
@@ -17,6 +17,7 @@
 package org.apache.camel.component.irc;
 
 import java.net.URI;
+import java.util.Arrays;
 
 import org.apache.camel.RuntimeCamelException;
 
@@ -216,8 +217,6 @@
     }
 
     public String toString() {
-        return "IrcConfiguration{" + "target='" + target + '\'' + ", hostname='" + hostname
+ '\'' + ", password='" + password + '\'' + ", nickname='" + nickname + '\'' + ", realname='"
+ realname
-               + '\'' + ", username='" + username + '\'' + ", persistent=" + persistent +
", colors=" + colors + ", onNick=" + onNick + ", onQuit=" + onQuit + ", onJoin=" + onJoin
+ ", onKick="
-               + onKick + ", onMode=" + onMode + ", onPart=" + onPart + ", onTopic=" + onTopic
+ ", onPrivmsg=" + onPrivmsg + ", ports=" + ports + '}';
+        return "IrcConfiguration[hostname: " + hostname + ", ports=" + Arrays.toString(ports)
+ ", target: " + target + ", username=" + username + "]";
     }
 }

Added: camel/trunk/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcConstants.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcConstants.java?rev=748183&view=auto
==============================================================================
--- camel/trunk/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcConstants.java
(added)
+++ camel/trunk/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcConstants.java
Thu Feb 26 15:41:56 2009
@@ -0,0 +1,34 @@
+/**
+ * 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.irc;
+
+/**
+ * IRC Constants
+ */
+public final class IrcConstants {
+    public static final String IRC_MESSAGE_TYPE = "irc.messageType";
+    public static final String IRC_TARGET = "irc.target";
+    public static final String IRC_USER_KICKED = "irc.user.kicked";
+    public static final String IRC_USER_HOST = "irc.user.host";
+    public static final String IRC_USER_NICK = "irc.user.nick";
+    public static final String IRC_USER_SERVERNAME = "irc.user.servername";
+    public static final String IRC_USER_USERNAME = "irc.user.username";
+
+    private IrcConstants() {
+        // Utility class
+    }
+}

Propchange: camel/trunk/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcConstants.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: camel/trunk/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcConstants.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: camel/trunk/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcConsumer.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcConsumer.java?rev=748183&r1=748182&r2=748183&view=diff
==============================================================================
--- camel/trunk/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcConsumer.java
(original)
+++ camel/trunk/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcConsumer.java
Thu Feb 26 15:41:56 2009
@@ -37,15 +37,16 @@
         super(endpoint, processor);
         this.endpoint = endpoint;
         this.connection = connection;
-        configuration = endpoint.getConfiguration();
+        this.configuration = endpoint.getConfiguration();
     }
 
     @Override
     protected void doStop() throws Exception {
-        String target = endpoint.getConfiguration().getTarget();
-        connection.doPart(target);
-        connection.removeIRCEventListener(listener);
-
+        if (connection != null) {
+            String target = endpoint.getConfiguration().getTarget();
+            connection.doPart(target);
+            connection.removeIRCEventListener(listener);
+        }
         super.doStop();
     }
 
@@ -54,9 +55,12 @@
         super.doStart();
 
         String target = endpoint.getConfiguration().getTarget();
-        connection.addIRCEventListener(new FilteredIRCEventAdapter(target));
+        listener = new FilteredIRCEventAdapter(target);
+        connection.addIRCEventListener(listener);
 
-        LOG.debug("joining: " + target);
+        if (LOG.isDebugEnabled()) {
+            LOG.debug("Joining: " + target);
+        }
         connection.doJoin(target);
     }
 
@@ -78,9 +82,7 @@
                 try {
                     getProcessor().process(exchange);
                 } catch (Exception e) {
-                    // TODO: what should we do when a processing failure
-                    // occurs??
-                    e.printStackTrace();
+                    handleException(e);
                 }
             }
         }
@@ -92,9 +94,7 @@
                 try {
                     getProcessor().process(exchange);
                 } catch (Exception e) {
-                    // TODO: what should we do when a processing failure
-                    // occurs??
-                    e.printStackTrace();
+                    handleException(e);
                 }
             }
         }
@@ -107,9 +107,7 @@
                     try {
                         getProcessor().process(exchange);
                     } catch (Exception e) {
-                        // TODO: what should we do when a processing failure
-                        // occurs??
-                        e.printStackTrace();
+                        handleException(e);
                     }
                 }
             }
@@ -123,9 +121,7 @@
                     try {
                         getProcessor().process(exchange);
                     } catch (Exception e) {
-                        // TODO: what should we do when a processing failure
-                        // occurs??
-                        e.printStackTrace();
+                        handleException(e);
                     }
                 }
             }
@@ -139,9 +135,7 @@
                     try {
                         getProcessor().process(exchange);
                     } catch (Exception e) {
-                        // TODO: what should we do when a processing failure
-                        // occurs??
-                        e.printStackTrace();
+                        handleException(e);
                     }
                 }
             }
@@ -155,9 +149,7 @@
                     try {
                         getProcessor().process(exchange);
                     } catch (Exception e) {
-                        // TODO: what should we do when a processing failure
-                        // occurs??
-                        e.printStackTrace();
+                        handleException(e);
                     }
                 }
             }
@@ -171,9 +163,7 @@
                     try {
                         getProcessor().process(exchange);
                     } catch (Exception e) {
-                        // TODO: what should we do when a processing failure
-                        // occurs??
-                        e.printStackTrace();
+                        handleException(e);
                     }
                 }
             }
@@ -187,9 +177,7 @@
                     try {
                         getProcessor().process(exchange);
                     } catch (Exception e) {
-                        // TODO: what should we do when a processing failure
-                        // occurs??
-                        e.printStackTrace();
+                        handleException(e);
                     }
                 }
             }

Modified: camel/trunk/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcExchange.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcExchange.java?rev=748183&r1=748182&r2=748183&view=diff
==============================================================================
--- camel/trunk/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcExchange.java
(original)
+++ camel/trunk/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcExchange.java
Thu Feb 26 15:41:56 2009
@@ -47,26 +47,6 @@
     }
 
     @Override
-    public IrcMessage getIn() {
-        return (IrcMessage) super.getIn();
-    }
-
-    @Override
-    public IrcMessage getOut() {
-        return (IrcMessage) super.getOut();
-    }
-
-    @Override
-    public IrcMessage getOut(boolean lazyCreate) {
-        return (IrcMessage) super.getOut(lazyCreate);
-    }
-
-    @Override
-    public IrcMessage getFault() {
-        return (IrcMessage) super.getFault();
-    }
-
-    @Override
     public IrcExchange newInstance() {
         return new IrcExchange(this, getBinding());
     }

Modified: camel/trunk/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcMessage.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcMessage.java?rev=748183&r1=748182&r2=748183&view=diff
==============================================================================
--- camel/trunk/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcMessage.java
(original)
+++ camel/trunk/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcMessage.java
Thu Feb 26 15:41:56 2009
@@ -118,18 +118,18 @@
 
     @Override
     protected void populateInitialHeaders(Map<String, Object> map) {
-        map.put("irc.messageType", messageType);
+        map.put(IrcConstants.IRC_MESSAGE_TYPE, messageType);
         if (target != null) {
-            map.put("irc.target", target);
+            map.put(IrcConstants.IRC_TARGET, target);
         }
         if (whoWasKickedNick != null) {
-            map.put("irc.user.kicked", whoWasKickedNick);
+            map.put(IrcConstants.IRC_USER_KICKED, whoWasKickedNick);
         }
         if (user != null) {
-            map.put("irc.user.host", user.getHost());
-            map.put("irc.user.nick", user.getNick());
-            map.put("irc.user.servername", user.getServername());
-            map.put("irc.user.username", user.getUsername());
+            map.put(IrcConstants.IRC_USER_HOST, user.getHost());
+            map.put(IrcConstants.IRC_USER_NICK, user.getNick());
+            map.put(IrcConstants.IRC_USER_SERVERNAME, user.getServername());
+            map.put(IrcConstants.IRC_USER_USERNAME, user.getUsername());
         }
     }
 

Modified: camel/trunk/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcProducer.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcProducer.java?rev=748183&r1=748182&r2=748183&view=diff
==============================================================================
--- camel/trunk/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcProducer.java
(original)
+++ camel/trunk/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcProducer.java
Thu Feb 26 15:41:56 2009
@@ -17,7 +17,6 @@
 package org.apache.camel.component.irc;
 
 import org.apache.camel.Exchange;
-import org.apache.camel.RuntimeCamelException;
 import org.apache.camel.impl.DefaultProducer;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -26,8 +25,9 @@
 
 public class IrcProducer extends DefaultProducer {
 
-    public static final String[] COMMANDS = new String[] {"AWAY", "INVITE", "ISON", "JOIN",
"KICK", "LIST", "NAMES", "PRIVMSG", "MODE", "NICK", "NOTICE", "PART", "PONG", "QUIT", "TOPIC",
"WHO",
-                                                          "WHOIS", "WHOWAS", "USERHOST"};
+    public static final String[] COMMANDS = new String[]{"AWAY", "INVITE", "ISON", "JOIN",
"KICK", "LIST", "NAMES",
+        "PRIVMSG", "MODE", "NICK", "NOTICE", "PART", "PONG", "QUIT", "TOPIC", "WHO", "WHOIS",
"WHOWAS", "USERHOST"};
+
     private static final transient Log LOG = LogFactory.getLog(IrcProducer.class);
 
     private IRCConnection connection;
@@ -41,21 +41,16 @@
     }
 
     public void process(Exchange exchange) throws Exception {
-        try {
-            final String msg = exchange.getIn().getBody(String.class);
-            if (isMessageACommand(msg)) {
-                connection.send(msg);
-            } else {
-                final String target = endpoint.getConfiguration().getTarget();
-
-                if (LOG.isDebugEnabled()) {
-                    LOG.debug("sending to: " + target + " message: " + msg);
-                }
+        final String msg = exchange.getIn().getBody(String.class);
+        if (isMessageACommand(msg)) {
+            connection.send(msg);
+        } else {
+            String target = endpoint.getConfiguration().getTarget();
 
-                connection.doPrivmsg(target, msg);
+            if (LOG.isDebugEnabled()) {
+                LOG.debug("Sending to: " + target + " message: " + msg);
             }
-        } catch (Exception e) {
-            throw new RuntimeCamelException(e);
+            connection.doPrivmsg(target, msg);
         }
     }
 
@@ -66,18 +61,19 @@
         ircErrorLogger = createIrcErrorLogger();
         connection.addIRCEventListener(ircErrorLogger);
 
-        final String target = endpoint.getConfiguration().getTarget();
-
-        LOG.debug("joining: " + target);
+        String target = endpoint.getConfiguration().getTarget();
+        if (LOG.isDebugEnabled()) {
+            LOG.debug("Joining: " + target);
+        }
         connection.doJoin(target);
     }
 
     @Override
     protected void doStop() throws Exception {
-        super.doStop();
         if (connection != null) {
             connection.removeIRCEventListener(ircErrorLogger);
         }
+        super.doStop();
     }
 
     protected boolean isMessageACommand(String msg) {

Modified: camel/trunk/components/camel-irc/src/test/java/org/apache/camel/component/irc/CodehausIrcChat.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-irc/src/test/java/org/apache/camel/component/irc/CodehausIrcChat.java?rev=748183&r1=748182&r2=748183&view=diff
==============================================================================
--- camel/trunk/components/camel-irc/src/test/java/org/apache/camel/component/irc/CodehausIrcChat.java
(original)
+++ camel/trunk/components/camel-irc/src/test/java/org/apache/camel/component/irc/CodehausIrcChat.java
Thu Feb 26 15:41:56 2009
@@ -89,7 +89,8 @@
     }
 
     public static void main(String[] args) throws InterruptedException {
-        final IrcConfiguration config = new IrcConfiguration("irc.codehaus.org", "camel-irc",
"Camel IRC Component", "#camel-test");
+        //final IrcConfiguration config = new IrcConfiguration("irc.codehaus.org", "camel-irc",
"Camel IRC Component", "#camel-test");
+        final IrcConfiguration config = new IrcConfiguration("irc.codehaus.org", "camel-rc",
"Camel IRC Component", "#camel-test");
 
         final IRCConnection conn = new IRCConnection(config.getHostname(), config.getPorts(),
config.getPassword(), config.getNickname(), config.getUsername(), config.getRealname());
 

Copied: camel/trunk/components/camel-irc/src/test/java/org/apache/camel/component/irc/IrcRouteTest.java
(from r748160, camel/trunk/components/camel-irc/src/test/java/org/apache/camel/component/irc/IrcRouteIntegration.java)
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-irc/src/test/java/org/apache/camel/component/irc/IrcRouteTest.java?p2=camel/trunk/components/camel-irc/src/test/java/org/apache/camel/component/irc/IrcRouteTest.java&p1=camel/trunk/components/camel-irc/src/test/java/org/apache/camel/component/irc/IrcRouteIntegration.java&r1=748160&r2=748183&rev=748183&view=diff
==============================================================================
--- camel/trunk/components/camel-irc/src/test/java/org/apache/camel/component/irc/IrcRouteIntegration.java
(original)
+++ camel/trunk/components/camel-irc/src/test/java/org/apache/camel/component/irc/IrcRouteTest.java
Thu Feb 26 15:41:56 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";
@@ -38,7 +38,6 @@
         resultEndpoint.expectedBodiesReceived(body1, body2);
 
         resultEndpoint.assertIsSatisfied();
-        //Thread.sleep(10000);
 
         List<Exchange> list = resultEndpoint.getReceivedExchanges();
         for (Exchange exchange : list) {
@@ -51,11 +50,8 @@
             public void configure() throws Exception {
                 from("irc://camel-con@irc.codehaus.org:6667/%23camel-test").
                         choice().
-                        when(header("irc.messageType").isEqualTo("PRIVMSG")).to("mock:result").
-                        when(header("irc.messageType").isEqualTo("JOIN")).to("seda:consumerJoined");
-
-                // TODO this causes errors on shutdown...
-                //otherwise().to("mock:otherIrcCommands");
+                        when(header(IrcConstants.IRC_MESSAGE_TYPE).isEqualTo("PRIVMSG")).to("mock:result").
+                        when(header(IrcConstants.IRC_MESSAGE_TYPE).isEqualTo("JOIN")).to("seda:consumerJoined");
 
                 from("seda:consumerJoined").process(new Processor() {
                     public void process(Exchange exchange) throws Exception {

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

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

Modified: camel/trunk/components/camel-irc/src/test/resources/log4j.properties
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-irc/src/test/resources/log4j.properties?rev=748183&r1=748182&r2=748183&view=diff
==============================================================================
--- camel/trunk/components/camel-irc/src/test/resources/log4j.properties (original)
+++ camel/trunk/components/camel-irc/src/test/resources/log4j.properties Thu Feb 26 15:41:56
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