svn commit: r595626 - /activemq/camel/trunk/components/camel-mina/src/test/java/org/apache/camel/component/mina/MinaUdpTest.java

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r595626 - /activemq/camel/trunk/components/camel-mina/src/test/java/org/apache/camel/component/mina/MinaUdpTest.java

jstrachan-2
Author: jstrachan
Date: Fri Nov 16 03:12:46 2007
New Revision: 595626

URL: http://svn.apache.org/viewvc?rev=595626&view=rev
Log:
removed some crud from a test case

Modified:
    activemq/camel/trunk/components/camel-mina/src/test/java/org/apache/camel/component/mina/MinaUdpTest.java

Modified: activemq/camel/trunk/components/camel-mina/src/test/java/org/apache/camel/component/mina/MinaUdpTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-mina/src/test/java/org/apache/camel/component/mina/MinaUdpTest.java?rev=595626&r1=595625&r2=595626&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-mina/src/test/java/org/apache/camel/component/mina/MinaUdpTest.java (original)
+++ activemq/camel/trunk/components/camel-mina/src/test/java/org/apache/camel/component/mina/MinaUdpTest.java Fri Nov 16 03:12:46 2007
@@ -36,9 +36,7 @@
 public class MinaUdpTest extends ContextTestSupport {
     private static final transient Log LOG = LogFactory.getLog(MinaUdpTest.class);
     protected int messageCount = 3;
-    protected Thread readerThread;
     protected int port = 4445;
-    protected boolean consume = false;
 
     public void testMinaRoute() throws Exception {
         MockEndpoint endpoint = getMockEndpoint("mock:result");
@@ -56,59 +54,10 @@
         LOG.debug("String value: " + exchange.getIn().getBody(String.class));
     }
 
-    @Override
-    protected void setUp() throws Exception {
-
-        super.setUp();
-
-        if (consume) {
-            final DatagramSocket socket = new DatagramSocket(port);
-
-            readerThread = new Thread() {
-                public void run() {
-                    try {
-                        byte[] buffer = new byte[1024];
-                        DatagramPacket incoming = new DatagramPacket(buffer, buffer.length);
-                        System.out.println("starting to receive udp packets");
-                        while (true) {
-                            //incoming.setLength(buffer.length);
-                            socket.receive(incoming);
-                            byte[] data = incoming.getData();
-                            System.out.println("Got data! " + data.length);
-
-                            ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(data));
-                            Object value = in.readObject();
-                            System.out.println("Value: " + value);
-                        }
-                    }
-                    catch (Throwable ex) {
-                        System.err.println(ex);
-                        ex.printStackTrace();
-                    }
-                }
-            };
-            readerThread.start();
-        }
-    }
-
-    @Override
-    protected void tearDown() throws Exception {
-        super.tearDown();
-    }
-
     protected void sendUdpMessages() throws Exception {
         DatagramSocket socket = new DatagramSocket();
         InetAddress address = InetAddress.getByName("127.0.0.1");
         for (int i = 0; i < messageCount; i++) {
-/*
-            ByteArrayOutputStream buffer = new ByteArrayOutputStream();
-            ObjectOutputStream out = new ObjectOutputStream(buffer);
-            out.writeObject("Hello Message: " + i);
-            out.close();
-
-            byte[] data = buffer.toByteArray();
-*/
-
             String text = "Hello Message: " + i;
             byte[] data = text.getBytes();