camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jans...@apache.org
Subject svn commit: r790956 - in /camel/trunk/components/camel-irc: pom.xml src/test/java/org/apache/camel/component/irc/IrcRouteTest.java src/test/java/org/apache/camel/component/irc/IrcsRouteTest.java
Date Fri, 03 Jul 2009 15:59:22 GMT
Author: janstey
Date: Fri Jul  3 15:59:21 2009
New Revision: 790956

URL: http://svn.apache.org/viewvc?rev=790956&view=rev
Log:
Add support for SSL testing for when we can get a public server to test against

Added:
    camel/trunk/components/camel-irc/src/test/java/org/apache/camel/component/irc/IrcsRouteTest.java
  (with props)
Modified:
    camel/trunk/components/camel-irc/pom.xml
    camel/trunk/components/camel-irc/src/test/java/org/apache/camel/component/irc/IrcRouteTest.java

Modified: camel/trunk/components/camel-irc/pom.xml
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-irc/pom.xml?rev=790956&r1=790955&r2=790956&view=diff
==============================================================================
--- camel/trunk/components/camel-irc/pom.xml (original)
+++ camel/trunk/components/camel-irc/pom.xml Fri Jul  3 15:59:21 2009
@@ -49,7 +49,7 @@
     <!-- testing -->
     <dependency>
       <groupId>org.apache.camel</groupId>
-      <artifactId>camel-test</artifactId>      
+      <artifactId>camel-test</artifactId>
       <scope>test</scope>
     </dependency>
     <dependency>
@@ -69,4 +69,17 @@
     </dependency>
   </dependencies>
 
-</project>
\ No newline at end of file
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <configuration>
+          <excludes>
+            <exclude>**/IrcsRouteTest.*</exclude>
+          </excludes>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+
+</project>

Modified: camel/trunk/components/camel-irc/src/test/java/org/apache/camel/component/irc/IrcRouteTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-irc/src/test/java/org/apache/camel/component/irc/IrcRouteTest.java?rev=790956&r1=790955&r2=790956&view=diff
==============================================================================
--- camel/trunk/components/camel-irc/src/test/java/org/apache/camel/component/irc/IrcRouteTest.java
(original)
+++ camel/trunk/components/camel-irc/src/test/java/org/apache/camel/component/irc/IrcRouteTest.java
Fri Jul  3 15:59:21 2009
@@ -32,7 +32,7 @@
     protected MockEndpoint resultEndpoint;
     protected String body1 = "Message One";
     protected String body2 = "Message Two";
-    private boolean sentMessages;
+    private boolean sentMessages;    
 
     @Test
     public void testIrcMessages() throws Exception {
@@ -45,12 +45,12 @@
         for (Exchange exchange : list) {
             log.info("Received exchange: " + exchange + " headers: " + exchange.getIn().getHeaders());
         }
-    }
-
+    }   
+    
     protected RouteBuilder createRouteBuilder() throws Exception {
         return new RouteBuilder() {
             public void configure() throws Exception {
-                from("irc://camel-con@irc.codehaus.org:6667/#camel-test?nickname=camel-con").
+                from(fromUri()).
                         choice().
                         when(header(IrcConstants.IRC_MESSAGE_TYPE).isEqualTo("PRIVMSG")).to("mock:result").
                         when(header(IrcConstants.IRC_MESSAGE_TYPE).isEqualTo("JOIN")).to("seda:consumerJoined");
@@ -64,6 +64,14 @@
         };
     }
 
+    protected String sendUri() {
+        return "irc://camel-prd@irc.codehaus.org:6667/#camel-test?nickname=camel-prd";
+    }
+
+    protected String fromUri() {
+        return "irc://camel-con@irc.codehaus.org:6667/#camel-test?nickname=camel-con";
+    }    
+    
     /**
      * Lets send messages once the consumer has joined
      */
@@ -72,10 +80,9 @@
             sentMessages = true;
 
             // now the consumer has joined, lets send some messages
-            String sendUri = "irc://camel-prd@irc.codehaus.org:6667/#camel-test?nickname=camel-prd";
 
-            template.sendBody(sendUri, body1);
-            template.sendBody(sendUri, body2);
+            template.sendBody(sendUri(), body1);
+            template.sendBody(sendUri(), body2);
         }
     }
 }
\ No newline at end of file

Added: camel/trunk/components/camel-irc/src/test/java/org/apache/camel/component/irc/IrcsRouteTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-irc/src/test/java/org/apache/camel/component/irc/IrcsRouteTest.java?rev=790956&view=auto
==============================================================================
--- camel/trunk/components/camel-irc/src/test/java/org/apache/camel/component/irc/IrcsRouteTest.java
(added)
+++ camel/trunk/components/camel-irc/src/test/java/org/apache/camel/component/irc/IrcsRouteTest.java
Fri Jul  3 15:59:21 2009
@@ -0,0 +1,35 @@
+/**
+ * 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;
+
+public class IrcsRouteTest extends IrcRouteTest {
+
+    // TODO This test is disabled until we can find a public SSL enabled IRC 
+    // server to test against. To use this you'll need to change the server 
+    // information below and the username/password. 
+
+    @Override
+    protected String sendUri() {
+        return "ircs://camel-prd@irc.codehaus.org:6667/#camel-test?nickname=camel-prd&password=blah";
+    }
+
+    @Override    
+    protected String fromUri() {
+        return "ircs://camel-con@irc.codehaus.org:6667/#camel-test?nickname=camel-con&password=blah";
+    }    
+
+}
\ No newline at end of file

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



Mime
View raw message