Author: davsclaus
Date: Sun Feb 12 14:09:40 2012
New Revision: 1243256

URL: http://svn.apache.org/viewvc?rev=1243256&view=rev
Log:
Polished

Removed:
    camel/trunk/components/camel-websocket/src/main/resources/index.html
    camel/trunk/components/camel-websocket/src/main/resources/log4j.properties
Modified:
    
camel/trunk/components/camel-websocket/src/test/java/org/apache/camel/component/websocket/WebsocketClientCamelRoute2Test.java
    
camel/trunk/components/camel-websocket/src/test/java/org/apache/camel/component/websocket/WebsocketClientCamelRouteTest.java
    camel/trunk/components/camel-websocket/src/test/resources/log4j.properties

Modified: 
camel/trunk/components/camel-websocket/src/test/java/org/apache/camel/component/websocket/WebsocketClientCamelRoute2Test.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-websocket/src/test/java/org/apache/camel/component/websocket/WebsocketClientCamelRoute2Test.java?rev=1243256&r1=1243255&r2=1243256&view=diff
==============================================================================
--- 
camel/trunk/components/camel-websocket/src/test/java/org/apache/camel/component/websocket/WebsocketClientCamelRoute2Test.java
 (original)
+++ 
camel/trunk/components/camel-websocket/src/test/java/org/apache/camel/component/websocket/WebsocketClientCamelRoute2Test.java
 Sun Feb 12 14:09:40 2012
@@ -17,11 +17,9 @@
 package org.apache.camel.component.websocket;
 
 import java.net.URI;
-import java.net.URISyntaxException;
 
 import de.roderick.weberknecht.WebSocketConnection;
 import de.roderick.weberknecht.WebSocketEventHandler;
-import de.roderick.weberknecht.WebSocketException;
 import de.roderick.weberknecht.WebSocketMessage;
 import org.apache.camel.Exchange;
 import org.apache.camel.ExchangePattern;
@@ -36,42 +34,31 @@ public class WebsocketClientCamelRoute2T
     private static WebSocketConnection webSocketConnection;
 
     @Test
-    public void testWSHttpCall() throws WebSocketException {
+    public void testWSHttpCall() throws Exception {
+        uriWS = new URI("ws://127.0.0.1:9292/test");
+        WebSocketConnection webSocketConnection = new 
WebSocketConnection(uriWS);
+
+        // Register Event Handlers
+        webSocketConnection.setEventHandler(new WebSocketEventHandler() {
+            public void onOpen() {
+                log.info("--open");
+            }
 
-        try {
-            uriWS = new URI("ws://127.0.0.1:9292/test");
-            WebSocketConnection webSocketConnection = new 
WebSocketConnection(uriWS);
-
-            // Register Event Handlers
-            webSocketConnection.setEventHandler(new WebSocketEventHandler() {
-                public void onOpen() {
-                    System.out.println("--open");
-                }
-
-                public void onMessage(WebSocketMessage message) {
-                    System.out.println("--received message: " + 
message.getText());
-                }
-
-                public void onClose() {
-                    System.out.println("--close");
-                }
-            });
-
-            // Establish WebSocket Connection
-            webSocketConnection.connect();
-            System.out.println(">>> Connection established.");
-
-                        // Send Data
-            webSocketConnection.send("Hello from WS Client");
-
-
-        } catch (WebSocketException ex) {
-            ex.printStackTrace();
-        } catch (URISyntaxException e) {
-            e.printStackTrace();
-        }
+            public void onMessage(WebSocketMessage message) {
+                log.info("--received message: " + message.getText());
+            }
 
+            public void onClose() {
+                log.info("--close");
+            }
+        });
 
+        // Establish WebSocket Connection
+        webSocketConnection.connect();
+        log.info(">>> Connection established.");
+
+        // Send Data
+        webSocketConnection.send("Hello from WS Client");
     }
 
     @Override
@@ -89,7 +76,6 @@ public class WebsocketClientCamelRoute2T
                             exchange.getIn().setBody(response);
                         }
                     });
-
             }
         };
     }

Modified: 
camel/trunk/components/camel-websocket/src/test/java/org/apache/camel/component/websocket/WebsocketClientCamelRouteTest.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-websocket/src/test/java/org/apache/camel/component/websocket/WebsocketClientCamelRouteTest.java?rev=1243256&r1=1243255&r2=1243256&view=diff
==============================================================================
--- 
camel/trunk/components/camel-websocket/src/test/java/org/apache/camel/component/websocket/WebsocketClientCamelRouteTest.java
 (original)
+++ 
camel/trunk/components/camel-websocket/src/test/java/org/apache/camel/component/websocket/WebsocketClientCamelRouteTest.java
 Sun Feb 12 14:09:40 2012
@@ -17,11 +17,9 @@
 package org.apache.camel.component.websocket;
 
 import java.net.URI;
-import java.net.URISyntaxException;
 
 import de.roderick.weberknecht.WebSocketConnection;
 import de.roderick.weberknecht.WebSocketEventHandler;
-import de.roderick.weberknecht.WebSocketException;
 import de.roderick.weberknecht.WebSocketMessage;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.test.CamelTestSupport;
@@ -33,42 +31,32 @@ public class WebsocketClientCamelRouteTe
     private static WebSocketConnection webSocketConnection;
 
     @Test
-    public void testWSHttpCall() throws WebSocketException {
+    public void testWSHttpCall() throws Exception {
 
-        try {
-            uriWS = new URI("ws://127.0.0.1:9292/test");
-            WebSocketConnection webSocketConnection = new 
WebSocketConnection(uriWS);
-
-            // Register Event Handlers
-            webSocketConnection.setEventHandler(new WebSocketEventHandler() {
-                public void onOpen() {
-                    System.out.println("--open");
-                }
-
-                public void onMessage(WebSocketMessage message) {
-                    System.out.println("--received message: " + 
message.getText());
-                }
-
-                public void onClose() {
-                    System.out.println("--close");
-                }
-            });
-
-            // Establish WebSocket Connection
-            webSocketConnection.connect();
-            System.out.println(">>> Connection established.");
-
-            // Send Data
-            webSocketConnection.send("Hello from WS Client");
-
-
-        } catch (WebSocketException ex) {
-            ex.printStackTrace();
-        } catch (URISyntaxException e) {
-            e.printStackTrace();
-        }
+        uriWS = new URI("ws://127.0.0.1:9292/test");
+        WebSocketConnection webSocketConnection = new 
WebSocketConnection(uriWS);
 
+        // Register Event Handlers
+        webSocketConnection.setEventHandler(new WebSocketEventHandler() {
+            public void onOpen() {
+                log.info("--open");
+            }
+
+            public void onMessage(WebSocketMessage message) {
+                log.info("--received message: " + message.getText());
+            }
+
+            public void onClose() {
+                log.info("--close");
+            }
+        });
+
+        // Establish WebSocket Connection
+        webSocketConnection.connect();
+        log.info(">>> Connection established.");
 
+        // Send Data
+        webSocketConnection.send("Hello from WS Client");
     }
 
     @Override
@@ -80,10 +68,8 @@ public class WebsocketClientCamelRouteTe
                     .loop(10)
                         .setBody().constant(">> Welcome on board !")
                         .to("websocket://test");
-
             }
         };
     }
 
-
 }

Modified: 
camel/trunk/components/camel-websocket/src/test/resources/log4j.properties
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-websocket/src/test/resources/log4j.properties?rev=1243256&r1=1243255&r2=1243256&view=diff
==============================================================================
--- camel/trunk/components/camel-websocket/src/test/resources/log4j.properties 
(original)
+++ camel/trunk/components/camel-websocket/src/test/resources/log4j.properties 
Sun Feb 12 14:09:40 2012
@@ -1,28 +1,28 @@
-/**
- * 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.
- */
+## ------------------------------------------------------------------------
+## 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.
+## ------------------------------------------------------------------------
+
 #
-# The logging properties used for eclipse testing, We want to see debug output 
on the console.
+# The logging properties used for testing
 #
-log4j.rootLogger=INFO, out
+log4j.rootLogger=INFO, file
 
 # uncomment the following line to turn on Camel debugging
-#log4j.logger.org.apache.camel=DEBUG
-
-log4j.logger.de.roderick.weberknecht=DEBUG
+#log4j.logger.org.apache.camel.component.websocket=DEBUG
+#log4j.logger.org.eclipse.jetty.websocket=DEBUG
 
 
 # CONSOLE appender not used by default


Reply via email to