qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arnaudsi...@apache.org
Subject svn commit: r581230 - in /incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/basic: LargeMessageTest.java MapMessageTest.java MultipleConnectionTest.java
Date Tue, 02 Oct 2007 13:26:32 GMT
Author: arnaudsimon
Date: Tue Oct  2 06:26:31 2007
New Revision: 581230

URL: http://svn.apache.org/viewvc?rev=581230&view=rev
Log:
Changed to use QpidTestCase

Modified:
    incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/basic/LargeMessageTest.java
    incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/basic/MapMessageTest.java
    incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/basic/MultipleConnectionTest.java

Modified: incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/basic/LargeMessageTest.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/basic/LargeMessageTest.java?rev=581230&r1=581229&r2=581230&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/basic/LargeMessageTest.java
(original)
+++ incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/basic/LargeMessageTest.java
Tue Oct  2 06:26:31 2007
@@ -20,13 +20,11 @@
  */
 package org.apache.qpid.test.unit.basic;
 
-import junit.framework.TestCase;
 
 import org.apache.qpid.client.AMQConnection;
 import org.apache.qpid.client.AMQQueue;
 import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.client.message.JMSTextMessage;
-import org.apache.qpid.client.transport.TransportConnection;
+import org.apache.qpid.testutil.QpidTestCase;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -38,26 +36,20 @@
 import javax.jms.Session;
 import javax.jms.TextMessage;
 
-import java.util.ArrayList;
-import java.util.List;
-
-public class LargeMessageTest extends TestCase
+public class LargeMessageTest extends QpidTestCase
 {
     private static final Logger _logger = LoggerFactory.getLogger(LargeMessageTest.class);
 
-    private AMQConnection _connection;
     private Destination _destination;
     private AMQSession _session;
-    private final List<JMSTextMessage> received = new ArrayList<JMSTextMessage>();
     public String _broker = "vm://:1";
 
     protected void setUp() throws Exception
     {
         super.setUp();
-        TransportConnection.createVMBroker(1);
         try
         {
-            init(new AMQConnection(_broker, "guest", "guest", "LargeMessageTest", "test"));
+            init((AMQConnection) getConnection("guest", "guest"));
         }
         catch (Exception e)
         {
@@ -78,8 +70,7 @@
 
     private void init(AMQConnection connection, Destination destination) throws Exception
     {
-        _connection = connection;
-        _destination = destination;
+         _destination = destination;
         _session = (AMQSession) connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
 
         connection.start();

Modified: incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/basic/MapMessageTest.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/basic/MapMessageTest.java?rev=581230&r1=581229&r2=581230&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/basic/MapMessageTest.java
(original)
+++ incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/basic/MapMessageTest.java
Tue Oct  2 06:26:31 2007
@@ -21,13 +21,12 @@
 package org.apache.qpid.test.unit.basic;
 
 import junit.framework.Assert;
-import junit.framework.TestCase;
 
 import org.apache.qpid.client.AMQConnection;
 import org.apache.qpid.client.AMQQueue;
 import org.apache.qpid.client.AMQSession;
 import org.apache.qpid.client.message.JMSMapMessage;
-import org.apache.qpid.client.transport.TransportConnection;
+import org.apache.qpid.testutil.QpidTestCase;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -46,7 +45,7 @@
 import java.util.Iterator;
 import java.util.List;
 
-public class MapMessageTest extends TestCase implements MessageListener
+public class MapMessageTest extends QpidTestCase implements MessageListener
 {
     private static final Logger _logger = LoggerFactory.getLogger(MapMessageTest.class);
 
@@ -66,8 +65,7 @@
         super.setUp();
         try
         {
-            TransportConnection.createVMBroker(1);
-            init(new AMQConnection(_connectionString, "guest", "guest", randomize("Client"),
"test"));
+            init((AMQConnection) getConnection("guest", "guest"));
         }
         catch (Exception e)
         {
@@ -79,7 +77,6 @@
     {
         _logger.info("Tearing Down unit.basic.MapMessageTest");
         super.tearDown();
-        TransportConnection.killAllVMBrokers();
     }
 
     private void init(AMQConnection connection) throws Exception
@@ -125,16 +122,16 @@
     private void setMapValues(MapMessage message, int i) throws JMSException
     {
         message.setBoolean("odd", (i / 2) == 0);
-        message.setByte("byte", (byte) Byte.MAX_VALUE);
+        message.setByte("byte",Byte.MAX_VALUE);
         message.setBytes("bytes", _bytes);
-        message.setChar("char", (char) 'c');
-        message.setDouble("double", (double) Double.MAX_VALUE);
-        message.setFloat("float", (float) Float.MAX_VALUE);
+        message.setChar("char",'c');
+        message.setDouble("double", Double.MAX_VALUE);
+        message.setFloat("float", Float.MAX_VALUE);
         message.setFloat("smallfloat", 100);
         message.setInt("messageNumber", i);
-        message.setInt("int", (int) Integer.MAX_VALUE);
-        message.setLong("long", (long) Long.MAX_VALUE);
-        message.setShort("short", (short) Short.MAX_VALUE);
+        message.setInt("int",  Integer.MAX_VALUE);
+        message.setLong("long",  Long.MAX_VALUE);
+        message.setShort("short", Short.MAX_VALUE);
         message.setString("message", MESSAGE + i);
 
         // Test Setting Object Values
@@ -184,13 +181,10 @@
 
     void check() throws JMSException
     {
-        List<String> actual = new ArrayList<String>();
-        int count = 0;
+         int count = 0;
         for (JMSMapMessage m : received)
         {
-            actual.add(m.getString("message"));
-
-            testMapValues(m, count);
+             testMapValues(m, count);
 
             testCorrectExceptions(m);
 
@@ -1246,7 +1240,7 @@
     {
         synchronized (received)
         {
-            _logger.info("****************** Recevied Messgage:" + (JMSMapMessage) message);
+            _logger.info("****************** Recevied Messgage:" + message);
             received.add((JMSMapMessage) message);
             received.notify();
         }

Modified: incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/basic/MultipleConnectionTest.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/basic/MultipleConnectionTest.java?rev=581230&r1=581229&r2=581230&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/basic/MultipleConnectionTest.java
(original)
+++ incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/basic/MultipleConnectionTest.java
Tue Oct  2 06:26:31 2007
@@ -19,8 +19,6 @@
  */
 package org.apache.qpid.test.unit.basic;
 
-import junit.framework.TestCase;
-
 import org.apache.qpid.client.AMQConnection;
 import org.apache.qpid.client.AMQDestination;
 import org.apache.qpid.client.AMQSession;



Mime
View raw message