qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ritch...@apache.org
Subject svn commit: r547730 [9/9] - in /incubator/qpid/trunk/qpid: ./ java/ java/broker/ java/broker/src/main/java/org/apache/qpid/server/ java/broker/src/main/java/org/apache/qpid/server/output/amqp0_8/ java/broker/src/main/java/org/apache/qpid/server/queue/ ...
Date Fri, 15 Jun 2007 16:28:54 GMT
Modified: incubator/qpid/trunk/qpid/java/common/src/test/java/org/apache/qpid/framing/PropertyFieldTableTest.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/common/src/test/java/org/apache/qpid/framing/PropertyFieldTableTest.java?view=diff&rev=547730&r1=547729&r2=547730
==============================================================================
--- incubator/qpid/trunk/qpid/java/common/src/test/java/org/apache/qpid/framing/PropertyFieldTableTest.java (original)
+++ incubator/qpid/trunk/qpid/java/common/src/test/java/org/apache/qpid/framing/PropertyFieldTableTest.java Fri Jun 15 09:28:46 2007
@@ -14,27 +14,25 @@
  *  "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.    
+ *  under the License.
+ *
  *
- * 
  */
 package org.apache.qpid.framing;
 
 import junit.framework.Assert;
 import junit.framework.TestCase;
 
-import java.util.Enumeration;
-import java.util.Iterator;
-
 import org.apache.mina.common.ByteBuffer;
-import org.apache.log4j.Logger;
+
 import org.apache.qpid.AMQPInvalidClassException;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 public class PropertyFieldTableTest extends TestCase
 {
-
-    private static final Logger _logger = Logger.getLogger(PropertyFieldTableTest.class);
-
+    private static final Logger _logger = LoggerFactory.getLogger(PropertyFieldTableTest.class);
 
     /**
      * Test that setting a similar named value replaces any previous value set on that name
@@ -42,9 +40,9 @@
     public void testReplacement()
     {
         FieldTable table1 = new FieldTable();
-        //Set a boolean value
+        // Set a boolean value
         table1.setBoolean("value", true);
-        //Check length of table is correct (<Value length> + <type> + <Boolean length>)
+        // Check length of table is correct (<Value length> + <type> + <Boolean length>)
         int size = EncodingUtils.encodedShortStringLength("value") + 1 + EncodingUtils.encodedBooleanLength();
         Assert.assertEquals(size, table1.getEncodedSize());
 
@@ -55,13 +53,12 @@
         size = EncodingUtils.encodedShortStringLength("value") + 1 + EncodingUtils.encodedIntegerLength();
         Assert.assertEquals(size, table1.getEncodedSize());
 
-        //Check boolean value is null
+        // Check boolean value is null
         Assert.assertEquals(null, table1.getBoolean("value"));
         // ... and integer value is good
         Assert.assertEquals((Integer) Integer.MAX_VALUE, table1.getInteger("value"));
     }
 
-
     /**
      * Set a boolean and check that we can only get it back as a boolean and a string
      * Check that attempting to lookup a non existent value returns null
@@ -72,10 +69,10 @@
         table1.setBoolean("value", true);
         Assert.assertTrue(table1.propertyExists("value"));
 
-        //Test Getting right value back
+        // Test Getting right value back
         Assert.assertEquals((Boolean) true, table1.getBoolean("value"));
 
-        //Check we don't get anything back for other gets
+        // Check we don't get anything back for other gets
         Assert.assertEquals(null, table1.getByte("value"));
         Assert.assertEquals(null, table1.getByte("value"));
         Assert.assertEquals(null, table1.getShort("value"));
@@ -86,7 +83,7 @@
         Assert.assertEquals(null, table1.getLong("value"));
         Assert.assertEquals(null, table1.getBytes("value"));
 
-        //except value as a string
+        // except value as a string
         Assert.assertEquals("true", table1.getString("value"));
 
         table1.remove("value");
@@ -94,7 +91,7 @@
         // Table should now have zero length for encoding
         checkEmpty(table1);
 
-        //Looking up an invalid value returns null
+        // Looking up an invalid value returns null
         Assert.assertEquals(null, table1.getBoolean("Rubbish"));
     }
 
@@ -108,8 +105,8 @@
         table1.setByte("value", Byte.MAX_VALUE);
         Assert.assertTrue(table1.propertyExists("value"));
 
-        //Tets lookups we shouldn't get anything back for other gets
-        //we should get right value back for this type ....
+        // Tets lookups we shouldn't get anything back for other gets
+        // we should get right value back for this type ....
         Assert.assertEquals(null, table1.getBoolean("value"));
         Assert.assertEquals(Byte.MAX_VALUE, (byte) table1.getByte("value"));
         Assert.assertEquals(null, table1.getShort("value"));
@@ -120,14 +117,14 @@
         Assert.assertEquals(null, table1.getLong("value"));
         Assert.assertEquals(null, table1.getBytes("value"));
 
-        //... and a the string value of it.
+        // ... and a the string value of it.
         Assert.assertEquals("" + Byte.MAX_VALUE, table1.getString("value"));
 
         table1.remove("value");
         // Table should now have zero length for encoding
         checkEmpty(table1);
 
-        //Looking up an invalid value returns null
+        // Looking up an invalid value returns null
         Assert.assertEquals(null, table1.getByte("Rubbish"));
     }
 
@@ -141,8 +138,8 @@
         table1.setShort("value", Short.MAX_VALUE);
         Assert.assertTrue(table1.propertyExists("value"));
 
-        //Tets lookups we shouldn't get anything back for other gets
-        //we should get right value back for this type ....
+        // Tets lookups we shouldn't get anything back for other gets
+        // we should get right value back for this type ....
         Assert.assertEquals(null, table1.getBoolean("value"));
         Assert.assertEquals(null, table1.getByte("value"));
         Assert.assertEquals(Short.MAX_VALUE, (short) table1.getShort("value"));
@@ -153,18 +150,17 @@
         Assert.assertEquals(null, table1.getLong("value"));
         Assert.assertEquals(null, table1.getBytes("value"));
 
-        //... and a the string value of it.
+        // ... and a the string value of it.
         Assert.assertEquals("" + Short.MAX_VALUE, table1.getString("value"));
 
         table1.remove("value");
         // Table should now have zero length for encoding
         checkEmpty(table1);
 
-        //Looking up an invalid value returns null
+        // Looking up an invalid value returns null
         Assert.assertEquals(null, table1.getShort("Rubbish"));
     }
 
-
     /**
      * Set a char and check that we can only get it back as a char
      * Check that attempting to lookup a non existent value returns null
@@ -175,8 +171,8 @@
         table1.setChar("value", 'c');
         Assert.assertTrue(table1.propertyExists("value"));
 
-        //Tets lookups we shouldn't get anything back for other gets
-        //we should get right value back for this type ....
+        // Tets lookups we shouldn't get anything back for other gets
+        // we should get right value back for this type ....
         Assert.assertEquals(null, table1.getBoolean("value"));
         Assert.assertEquals(null, table1.getByte("value"));
         Assert.assertEquals(null, table1.getShort("value"));
@@ -187,7 +183,7 @@
         Assert.assertEquals(null, table1.getLong("value"));
         Assert.assertEquals(null, table1.getBytes("value"));
 
-        //... and a the string value of it.
+        // ... and a the string value of it.
         Assert.assertEquals("c", table1.getString("value"));
 
         table1.remove("value");
@@ -195,11 +191,10 @@
         // Table should now have zero length for encoding
         checkEmpty(table1);
 
-        //Looking up an invalid value returns null
+        // Looking up an invalid value returns null
         Assert.assertEquals(null, table1.getCharacter("Rubbish"));
     }
 
-
     /**
      * Set a double and check that we can only get it back as a double
      * Check that attempting to lookup a non existent value returns null
@@ -210,8 +205,8 @@
         table1.setDouble("value", Double.MAX_VALUE);
         Assert.assertTrue(table1.propertyExists("value"));
 
-        //Tets lookups we shouldn't get anything back for other gets
-        //we should get right value back for this type ....
+        // Tets lookups we shouldn't get anything back for other gets
+        // we should get right value back for this type ....
         Assert.assertEquals(null, table1.getBoolean("value"));
         Assert.assertEquals(null, table1.getByte("value"));
         Assert.assertEquals(null, table1.getShort("value"));
@@ -222,20 +217,19 @@
         Assert.assertEquals(null, table1.getLong("value"));
         Assert.assertEquals(null, table1.getBytes("value"));
 
-        //... and a the string value of it.
+        // ... and a the string value of it.
         Assert.assertEquals("" + Double.MAX_VALUE, table1.getString("value"));
         table1.remove("value");
-        //but after a removeKey it doesn't
+        // but after a removeKey it doesn't
         Assert.assertFalse(table1.containsKey("value"));
 
         // Table should now have zero length for encoding
         checkEmpty(table1);
 
-        //Looking up an invalid value returns null
+        // Looking up an invalid value returns null
         Assert.assertEquals(null, table1.getDouble("Rubbish"));
     }
 
-
     /**
      * Set a float and check that we can only get it back as a float
      * Check that attempting to lookup a non existent value returns null
@@ -246,8 +240,8 @@
         table1.setFloat("value", Float.MAX_VALUE);
         Assert.assertTrue(table1.propertyExists("value"));
 
-        //Tets lookups we shouldn't get anything back for other gets
-        //we should get right value back for this type ....
+        // Tets lookups we shouldn't get anything back for other gets
+        // we should get right value back for this type ....
         Assert.assertEquals(null, table1.getBoolean("value"));
         Assert.assertEquals(null, table1.getByte("value"));
         Assert.assertEquals(null, table1.getShort("value"));
@@ -258,22 +252,20 @@
         Assert.assertEquals(null, table1.getLong("value"));
         Assert.assertEquals(null, table1.getBytes("value"));
 
-        //... and a the string value of it.
+        // ... and a the string value of it.
         Assert.assertEquals("" + Float.MAX_VALUE, table1.getString("value"));
 
-
         table1.remove("value");
-        //but after a removeKey it doesn't
+        // but after a removeKey it doesn't
         Assert.assertFalse(table1.containsKey("value"));
 
         // Table should now have zero length for encoding
         checkEmpty(table1);
 
-        //Looking up an invalid value returns null
+        // Looking up an invalid value returns null
         Assert.assertEquals(null, table1.getFloat("Rubbish"));
     }
 
-
     /**
      * Set an int and check that we can only get it back as an int
      * Check that attempting to lookup a non existent value returns null
@@ -284,8 +276,8 @@
         table1.setInteger("value", Integer.MAX_VALUE);
         Assert.assertTrue(table1.propertyExists("value"));
 
-        //Tets lookups we shouldn't get anything back for other gets
-        //we should get right value back for this type ....
+        // Tets lookups we shouldn't get anything back for other gets
+        // we should get right value back for this type ....
         Assert.assertEquals(null, table1.getBoolean("value"));
         Assert.assertEquals(null, table1.getByte("value"));
         Assert.assertEquals(null, table1.getShort("value"));
@@ -296,22 +288,20 @@
         Assert.assertEquals(null, table1.getLong("value"));
         Assert.assertEquals(null, table1.getBytes("value"));
 
-        //... and a the string value of it.
+        // ... and a the string value of it.
         Assert.assertEquals("" + Integer.MAX_VALUE, table1.getString("value"));
 
-
         table1.remove("value");
-        //but after a removeKey it doesn't
+        // but after a removeKey it doesn't
         Assert.assertFalse(table1.containsKey("value"));
 
         // Table should now have zero length for encoding
         checkEmpty(table1);
 
-        //Looking up an invalid value returns null
+        // Looking up an invalid value returns null
         Assert.assertEquals(null, table1.getInteger("Rubbish"));
     }
 
-
     /**
      * Set a long and check that we can only get it back as a long
      * Check that attempting to lookup a non existent value returns null
@@ -322,8 +312,8 @@
         table1.setLong("value", Long.MAX_VALUE);
         Assert.assertTrue(table1.propertyExists("value"));
 
-        //Tets lookups we shouldn't get anything back for other gets
-        //we should get right value back for this type ....
+        // Tets lookups we shouldn't get anything back for other gets
+        // we should get right value back for this type ....
         Assert.assertEquals(null, table1.getBoolean("value"));
         Assert.assertEquals(null, table1.getByte("value"));
         Assert.assertEquals(null, table1.getShort("value"));
@@ -334,36 +324,34 @@
         Assert.assertEquals(Long.MAX_VALUE, (long) table1.getLong("value"));
         Assert.assertEquals(null, table1.getBytes("value"));
 
-        //... and a the string value of it.
+        // ... and a the string value of it.
         Assert.assertEquals("" + Long.MAX_VALUE, table1.getString("value"));
 
-
         table1.remove("value");
-        //but after a removeKey it doesn't
+        // but after a removeKey it doesn't
         Assert.assertFalse(table1.containsKey("value"));
 
         // Table should now have zero length for encoding
         checkEmpty(table1);
 
-        //Looking up an invalid value returns null
+        // Looking up an invalid value returns null
         Assert.assertEquals(null, table1.getLong("Rubbish"));
     }
 
-
     /**
      * Set a double and check that we can only get it back as a double
      * Check that attempting to lookup a non existent value returns null
      */
     public void testBytes()
     {
-        byte[] bytes = {99, 98, 97, 96, 95};
+        byte[] bytes = { 99, 98, 97, 96, 95 };
 
         FieldTable table1 = new FieldTable();
         table1.setBytes("value", bytes);
         Assert.assertTrue(table1.propertyExists("value"));
 
-        //Tets lookups we shouldn't get anything back for other gets
-        //we should get right value back for this type ....
+        // Tets lookups we shouldn't get anything back for other gets
+        // we should get right value back for this type ....
         Assert.assertEquals(null, table1.getBoolean("value"));
         Assert.assertEquals(null, table1.getByte("value"));
         Assert.assertEquals(null, table1.getShort("value"));
@@ -374,17 +362,17 @@
         Assert.assertEquals(null, table1.getLong("value"));
         assertBytesEqual(bytes, table1.getBytes("value"));
 
-        //... and a the string value of it is null
+        // ... and a the string value of it is null
         Assert.assertEquals(null, table1.getString("value"));
 
         table1.remove("value");
-        //but after a removeKey it doesn't
+        // but after a removeKey it doesn't
         Assert.assertFalse(table1.containsKey("value"));
 
         // Table should now have zero length for encoding
         checkEmpty(table1);
 
-        //Looking up an invalid value returns null
+        // Looking up an invalid value returns null
         Assert.assertEquals(null, table1.getBytes("Rubbish"));
     }
 
@@ -405,7 +393,6 @@
         Assert.assertEquals(0, table.keySet().size());
     }
 
-
     /**
      * Set a String and check that we can only get it back as a String
      * Check that attempting to lookup a non existent value returns null
@@ -416,8 +403,8 @@
         table1.setString("value", "Hello");
         Assert.assertTrue(table1.propertyExists("value"));
 
-        //Tets lookups we shouldn't get anything back for other gets
-        //we should get right value back for this type ....
+        // Tets lookups we shouldn't get anything back for other gets
+        // we should get right value back for this type ....
         Assert.assertEquals(null, table1.getBoolean("value"));
         Assert.assertEquals(null, table1.getByte("value"));
         Assert.assertEquals(null, table1.getShort("value"));
@@ -429,40 +416,35 @@
         Assert.assertEquals(null, table1.getBytes("value"));
         Assert.assertEquals("Hello", table1.getString("value"));
 
-        //Try setting a null value and read it back
+        // Try setting a null value and read it back
         table1.setString("value", null);
 
         Assert.assertEquals(null, table1.getString("value"));
 
-        //but still contains the value
+        // but still contains the value
         Assert.assertTrue(table1.containsKey("value"));
 
         table1.remove("value");
-        //but after a removeKey it doesn't
+        // but after a removeKey it doesn't
         Assert.assertFalse(table1.containsKey("value"));
 
         checkEmpty(table1);
 
-        //Looking up an invalid value returns null
+        // Looking up an invalid value returns null
         Assert.assertEquals(null, table1.getString("Rubbish"));
 
-        //Additional Test that haven't been covered for string
+        // Additional Test that haven't been covered for string
         table1.setObject("value", "Hello");
-        //Check that it was set correctly
+        // Check that it was set correctly
         Assert.assertEquals("Hello", table1.getString("value"));
     }
 
-
-    
-
-    
-
     public void testValues()
     {
         FieldTable table = new FieldTable();
         table.setBoolean("bool", true);
         table.setByte("byte", Byte.MAX_VALUE);
-        byte[] bytes = {99, 98, 97, 96, 95};
+        byte[] bytes = { 99, 98, 97, 96, 95 };
         table.setBytes("bytes", bytes);
         table.setChar("char", 'c');
         table.setDouble("double", Double.MAX_VALUE);
@@ -484,7 +466,6 @@
         table.setObject("object-short", Short.MAX_VALUE);
         table.setObject("object-string", "Hello");
 
-
         Assert.assertEquals((Boolean) true, table.getBoolean("bool"));
         Assert.assertEquals((Byte) Byte.MAX_VALUE, table.getByte("byte"));
         assertBytesEqual(bytes, table.getBytes("bytes"));
@@ -509,10 +490,9 @@
         Assert.assertEquals("Hello", table.getObject("object-string"));
     }
 
-
     public void testwriteBuffer()
     {
-        byte[] bytes = {99, 98, 97, 96, 95};
+        byte[] bytes = { 99, 98, 97, 96, 95 };
 
         FieldTable table = new FieldTable();
         table.setBoolean("bool", true);
@@ -569,13 +549,11 @@
         size += 1 + EncodingUtils.encodedShortStringLength("boolean") + EncodingUtils.encodedBooleanLength();
         Assert.assertEquals(size, result.getEncodedSize());
 
-
         result.setByte("byte", (byte) Byte.MAX_VALUE);
         size += 1 + EncodingUtils.encodedShortStringLength("byte") + EncodingUtils.encodedByteLength();
         Assert.assertEquals(size, result.getEncodedSize());
 
-
-        byte[] _bytes = {99, 98, 97, 96, 95};
+        byte[] _bytes = { 99, 98, 97, 96, 95 };
 
         result.setBytes("bytes", _bytes);
         size += 1 + EncodingUtils.encodedShortStringLength("bytes") + 4 + _bytes.length;
@@ -597,7 +575,6 @@
         size += 1 + EncodingUtils.encodedShortStringLength("int") + EncodingUtils.encodedIntegerLength();
         Assert.assertEquals(size, result.getEncodedSize());
 
-
         result.setLong("long", (long) Long.MAX_VALUE);
         size += 1 + EncodingUtils.encodedShortStringLength("long") + EncodingUtils.encodedLongLength();
         Assert.assertEquals(size, result.getEncodedSize());
@@ -610,7 +587,6 @@
         size += 1 + EncodingUtils.encodedShortStringLength("result") + EncodingUtils.encodedLongStringLength("Hello");
         Assert.assertEquals(size, result.getEncodedSize());
 
-
         result.setObject("object-bool", true);
         size += 1 + EncodingUtils.encodedShortStringLength("object-bool") + EncodingUtils.encodedBooleanLength();
         Assert.assertEquals(size, result.getEncodedSize());
@@ -639,7 +615,6 @@
         size += 1 + EncodingUtils.encodedShortStringLength("object-int") + EncodingUtils.encodedIntegerLength();
         Assert.assertEquals(size, result.getEncodedSize());
 
-
         result.setObject("object-long", Long.MAX_VALUE);
         size += 1 + EncodingUtils.encodedShortStringLength("object-long") + EncodingUtils.encodedLongLength();
         Assert.assertEquals(size, result.getEncodedSize());
@@ -650,63 +625,62 @@
 
     }
 
-//    public void testEncodingSize1()
-//    {
-//                PropertyFieldTable table = new PropertyFieldTable();
-//        int length = 0;
-//        result.put("one", 1L);
-//        length = EncodingUtils.encodedShortStringLength("one");
-//        length += 1 + EncodingUtils.encodedLongLength();
-//        assertEquals(length, result.getEncodedSize());
-//
-//        result.put("two", 2L);
-//        length += EncodingUtils.encodedShortStringLength("two");
-//        length += 1 + EncodingUtils.encodedLongLength();
-//        assertEquals(length, result.getEncodedSize());
-//
-//        result.put("three", 3L);
-//        length += EncodingUtils.encodedShortStringLength("three");
-//        length += 1 + EncodingUtils.encodedLongLength();
-//        assertEquals(length, result.getEncodedSize());
-//
-//        result.put("four", 4L);
-//        length += EncodingUtils.encodedShortStringLength("four");
-//        length += 1 + EncodingUtils.encodedLongLength();
-//        assertEquals(length, result.getEncodedSize());
-//
-//        result.put("five", 5L);
-//        length += EncodingUtils.encodedShortStringLength("five");
-//        length += 1 + EncodingUtils.encodedLongLength();
-//        assertEquals(length, result.getEncodedSize());
-//
-//        //fixme should perhaps be expanded to incorporate all types.
-//
-//        final ByteBuffer buffer = ByteBuffer.allocate((int) result.getEncodedSize()); // FIXME XXX: Is cast a problem?
-//
-//        result.writeToBuffer(buffer);
-//
-//        buffer.flip();
-//
-//        long length = buffer.getUnsignedInt();
-//
-//        try
-//        {
-//            PropertyFieldTable table2 = new PropertyFieldTable(buffer, length);
-//
-//            Assert.assertEquals((Long) 1L, table2.getLong("one"));
-//            Assert.assertEquals((Long) 2L, table2.getLong("two"));
-//            Assert.assertEquals((Long) 3L, table2.getLong("three"));
-//            Assert.assertEquals((Long) 4L, table2.getLong("four"));
-//            Assert.assertEquals((Long) 5L, table2.getLong("five"));
-//        }
-//        catch (AMQFrameDecodingException e)
-//        {
-//            e.printStackTrace();
-//            fail("PFT should be instantiated from bytes." + e.getCause());
-//        }
-//
-//    }
-
+    // public void testEncodingSize1()
+    // {
+    // PropertyFieldTable table = new PropertyFieldTable();
+    // int length = 0;
+    // result.put("one", 1L);
+    // length = EncodingUtils.encodedShortStringLength("one");
+    // length += 1 + EncodingUtils.encodedLongLength();
+    // assertEquals(length, result.getEncodedSize());
+    //
+    // result.put("two", 2L);
+    // length += EncodingUtils.encodedShortStringLength("two");
+    // length += 1 + EncodingUtils.encodedLongLength();
+    // assertEquals(length, result.getEncodedSize());
+    //
+    // result.put("three", 3L);
+    // length += EncodingUtils.encodedShortStringLength("three");
+    // length += 1 + EncodingUtils.encodedLongLength();
+    // assertEquals(length, result.getEncodedSize());
+    //
+    // result.put("four", 4L);
+    // length += EncodingUtils.encodedShortStringLength("four");
+    // length += 1 + EncodingUtils.encodedLongLength();
+    // assertEquals(length, result.getEncodedSize());
+    //
+    // result.put("five", 5L);
+    // length += EncodingUtils.encodedShortStringLength("five");
+    // length += 1 + EncodingUtils.encodedLongLength();
+    // assertEquals(length, result.getEncodedSize());
+    //
+    // //fixme should perhaps be expanded to incorporate all types.
+    //
+    // final ByteBuffer buffer = ByteBuffer.allocate((int) result.getEncodedSize()); // FIXME XXX: Is cast a problem?
+    //
+    // result.writeToBuffer(buffer);
+    //
+    // buffer.flip();
+    //
+    // long length = buffer.getUnsignedInt();
+    //
+    // try
+    // {
+    // PropertyFieldTable table2 = new PropertyFieldTable(buffer, length);
+    //
+    // Assert.assertEquals((Long) 1L, table2.getLong("one"));
+    // Assert.assertEquals((Long) 2L, table2.getLong("two"));
+    // Assert.assertEquals((Long) 3L, table2.getLong("three"));
+    // Assert.assertEquals((Long) 4L, table2.getLong("four"));
+    // Assert.assertEquals((Long) 5L, table2.getLong("five"));
+    // }
+    // catch (AMQFrameDecodingException e)
+    // {
+    // e.printStackTrace();
+    // fail("PFT should be instantiated from bytes." + e.getCause());
+    // }
+    //
+    // }
 
     /**
      * Additional test for setObject
@@ -715,7 +689,7 @@
     {
         FieldTable table = new FieldTable();
 
-        //Try setting a non primative object
+        // Try setting a non primative object
 
         try
         {
@@ -724,7 +698,7 @@
         }
         catch (AMQPInvalidClassException iae)
         {
-            //normal path
+            // normal path
         }
         // so length should be zero
         Assert.assertEquals(0, table.getEncodedSize());
@@ -739,18 +713,17 @@
 
         try
         {
-            table.setObject((String)null, "String");
+            table.setObject((String) null, "String");
             fail("Null property name is not allowed");
         }
         catch (IllegalArgumentException iae)
         {
-            //normal path
+            // normal path
         }
         // so length should be zero
         Assert.assertEquals(0, table.getEncodedSize());
     }
 
-
     /**
      * Additional test checkPropertyName doesn't accept an empty String
      */
@@ -765,18 +738,19 @@
         }
         catch (IllegalArgumentException iae)
         {
-            //normal path
+            // normal path
         }
         // so length should be zero
         Assert.assertEquals(0, table.getEncodedSize());
     }
 
-
     /**
      * Additional test checkPropertyName doesn't accept an empty String
      */
     public void testCheckPropertyNamehasMaxLength()
     {
+        String oldVal = System.getProperty("STRICT_AMQP");
+        System.setProperty("STRICT_AMQP", "true");
         FieldTable table = new FieldTable();
 
         StringBuffer longPropertyName = new StringBuffer(129);
@@ -793,21 +767,30 @@
         }
         catch (IllegalArgumentException iae)
         {
-            //normal path
+            // normal path
         }
         // so length should be zero
         Assert.assertEquals(0, table.getEncodedSize());
+        if (oldVal != null)
+        {
+            System.setProperty("STRICT_AMQP", oldVal);
+        }
+        else
+        {
+            System.clearProperty("STRICT_AMQP");
+        }
     }
 
-
     /**
      * Additional test checkPropertyName starts with a letter
      */
     public void testCheckPropertyNameStartCharacterIsLetter()
     {
+        String oldVal = System.getProperty("STRICT_AMQP");
+        System.setProperty("STRICT_AMQP", "true");
         FieldTable table = new FieldTable();
 
-        //Try a name that starts with a number
+        // Try a name that starts with a number
         try
         {
             table.setObject("1", "String");
@@ -815,21 +798,30 @@
         }
         catch (IllegalArgumentException iae)
         {
-            //normal path
+            // normal path
         }
         // so length should be zero
         Assert.assertEquals(0, table.getEncodedSize());
+        if (oldVal != null)
+        {
+            System.setProperty("STRICT_AMQP", oldVal);
+        }
+        else
+        {
+            System.clearProperty("STRICT_AMQP");
+        }
     }
 
-
     /**
      * Additional test checkPropertyName starts with a hash or a dollar
      */
     public void testCheckPropertyNameStartCharacterIsHashorDollar()
     {
+        String oldVal = System.getProperty("STRICT_AMQP");
+        System.setProperty("STRICT_AMQP", "true");
         FieldTable table = new FieldTable();
 
-        //Try a name that starts with a number
+        // Try a name that starts with a number
         try
         {
             table.setObject("#", "String");
@@ -839,8 +831,16 @@
         {
             fail("property name are allowed to start with # and $s");
         }
-    }
 
+        if (oldVal != null)
+        {
+            System.setProperty("STRICT_AMQP", oldVal);
+        }
+        else
+        {
+            System.clearProperty("STRICT_AMQP");
+        }
+    }
 
     /**
      * Additional test to test the contents of the table
@@ -853,7 +853,7 @@
 
         Assert.assertEquals("String", table.getString("StringProperty"));
 
-        //Test Clear
+        // Test Clear
 
         table.clear();
 
@@ -872,17 +872,11 @@
         table.setObject("n2", "2");
         table.setObject("n3", "3");
 
-
         Assert.assertEquals("1", table.getObject("n1"));
         Assert.assertEquals("2", table.getObject("n2"));
         Assert.assertEquals("3", table.getObject("n3"));
 
-
-
-
     }
-
-
 
     private void assertBytesEqual(byte[] expected, byte[] actual)
     {

Modified: incubator/qpid/trunk/qpid/java/common/src/test/java/org/apache/qpid/util/CommandLineParserTest.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/common/src/test/java/org/apache/qpid/util/CommandLineParserTest.java?view=diff&rev=547730&r1=547729&r2=547730
==============================================================================
--- incubator/qpid/trunk/qpid/java/common/src/test/java/org/apache/qpid/util/CommandLineParserTest.java (original)
+++ incubator/qpid/trunk/qpid/java/common/src/test/java/org/apache/qpid/util/CommandLineParserTest.java Fri Jun 15 09:28:46 2007
@@ -1,10 +1,11 @@
 package org.apache.qpid.util;
 
-import java.util.Properties;
-
 import junit.framework.*;
 
-import org.apache.log4j.*;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.Properties;
 
 /**
  * Unit tests the {@link CommandLineParser} class.
@@ -37,7 +38,7 @@
  */
 public class CommandLineParserTest extends TestCase
 {
-    private static final Logger log = Logger.getLogger(CommandLineParserTest.class);
+    private static final Logger log = LoggerFactory.getLogger(CommandLineParserTest.class);
 
     public CommandLineParserTest(String name)
     {
@@ -58,11 +59,6 @@
         return suite;
     }
 
-    public void setUp()
-    {
-        NDC.push(getName());
-    }
-
     /** Check that get errors returns an empty string on no errors. */
     public void testGetErrorsReturnsEmptyStringOnNoErrors() throws Exception
     {
@@ -533,10 +529,5 @@
 
         assertTrue("IllegalArgumentException not thrown for an unknown option when errors on unknowns mode is on.",
             testPassed);
-    }
-
-    protected void tearDown() throws Exception
-    {
-        NDC.pop();
     }
 }

Modified: incubator/qpid/trunk/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/coordinator/CoordinatingTestCase.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/coordinator/CoordinatingTestCase.java?view=diff&rev=547730&r1=547729&r2=547730
==============================================================================
--- incubator/qpid/trunk/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/coordinator/CoordinatingTestCase.java (original)
+++ incubator/qpid/trunk/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/coordinator/CoordinatingTestCase.java Fri Jun 15 09:28:46 2007
@@ -21,10 +21,7 @@
  */
 package org.apache.qpid.interop.coordinator;
 
-import java.util.Collection;
 import java.util.Map;
-import java.util.Properties;
-import java.util.concurrent.LinkedBlockingQueue;
 
 import javax.jms.*;
 
@@ -74,13 +71,13 @@
     private static final Logger log = Logger.getLogger(CoordinatingTestCase.class);
 
     /** Holds the contact details for the sending test client. */
-    TestClientDetails sender;
+    protected TestClientDetails sender;
 
     /** Holds the contact details for the receving test client. */
-    TestClientDetails receiver;
+    protected TestClientDetails receiver;
 
     /** Holds the conversation factory over which to coordinate the test. */
-    ConversationFactory conversationFactory;
+    protected ConversationFactory conversationFactory;
 
     /**
      * Creates a new coordinating test case with the specified name.

Modified: incubator/qpid/trunk/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/coordinator/Coordinator.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/coordinator/Coordinator.java?view=diff&rev=547730&r1=547729&r2=547730
==============================================================================
--- incubator/qpid/trunk/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/coordinator/Coordinator.java (original)
+++ incubator/qpid/trunk/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/coordinator/Coordinator.java Fri Jun 15 09:28:46 2007
@@ -60,28 +60,28 @@
     public static final String DEFAULT_CONNECTION_PROPS_RESOURCE = "org/apache/qpid/interop/connection.properties";
 
     /** Holds the URL of the broker to coordinate the tests on. */
-    String brokerUrl;
+    protected String brokerUrl;
 
     /** Holds the virtual host to coordinate the tests on. If <tt>null</tt>, then the default virtual host is used. */
-    String virtualHost;
+    protected String virtualHost;
 
     /** Holds the list of all clients that enlisted, when the compulsory invite was issued. */
-    Set<TestClientDetails> enlistedClients = new HashSet<TestClientDetails>();
+    protected Set<TestClientDetails> enlistedClients = new HashSet<TestClientDetails>();
 
     /** Holds the conversation helper for the control conversation. */
-    private ConversationFactory conversationFactory;
+    protected ConversationFactory conversationFactory;
 
     /** Holds the connection that the coordinating messages are sent over. */
-    private Connection connection;
+    protected Connection connection;
 
     /**
      * Holds the name of the class of the test currently being run. Ideally passed into the {@link #createTestResult}
      * method, but as the signature is already fixed for this, the current value gets pushed here as a member variable.
      */
-    private String currentTestClassName;
+    protected String currentTestClassName;
 
     /** Holds the path of the directory to output test results too, if one is defined. */
-    private static String reportDir;
+    protected static String _reportDir;
 
     /**
      * Creates an interop test coordinator on the specified broker and virtual host.
@@ -89,7 +89,7 @@
      * @param brokerUrl   The URL of the broker to connect to.
      * @param virtualHost The virtual host to run all tests on. Optional, may be <tt>null</tt>.
      */
-    Coordinator(String brokerUrl, String virtualHost)
+    public Coordinator(String brokerUrl, String virtualHost)
     {
         log.debug("Coordinator(String brokerUrl = " + brokerUrl + ", String virtualHost = " + virtualHost + "): called");
 
@@ -116,38 +116,36 @@
             // Use the command line parser to evaluate the command line with standard handling behaviour (print errors
             // and usage then exit if there are errors).
             Properties options =
-                CommandLineParser.processCommandLine(args,
-                    new CommandLineParser(
-                        new String[][]
-                        {
-                            { "b", "The broker URL.", "broker", "false" },
-                            { "h", "The virtual host to use.", "virtual host", "false" },
-                            { "o", "The name of the directory to output test timings to.", "dir", "false" }
-                        }));
+                    CommandLineParser.processCommandLine(args,
+                                                         new CommandLineParser(
+                                                                 new String[][]
+                                                                         {
+                                                                                 {"b", "The broker URL.", "broker", "false"},
+                                                                                 {"h", "The virtual host to use.", "virtual host", "false"},
+                                                                                 {"o", "The name of the directory to output test timings to.", "dir", "false"}
+                                                                         }));
 
             // Extract the command line options.
             String brokerUrl = options.getProperty("b");
             String virtualHost = options.getProperty("h");
-            reportDir = options.getProperty("o");
-            reportDir = (reportDir == null) ? "." : reportDir;
+            _reportDir = options.getProperty("o");
+            _reportDir = (_reportDir == null) ? "." : _reportDir;
 
             // Scan for available test cases using a classpath scanner.
             Collection<Class<? extends CoordinatingTestCase>> testCaseClasses =
-                new ArrayList<Class<? extends CoordinatingTestCase>>();
+                    new ArrayList<Class<? extends CoordinatingTestCase>>();
             // ClasspathScanner.getMatches(CoordinatingTestCase.class, "^Test.*", true);
             // Hard code the test classes till the classpath scanner is fixed.
             Collections.addAll(testCaseClasses,
-                new Class[]
-                {
-                    CoordinatingTestCase1DummyRun.class, CoordinatingTestCase2BasicP2P.class,
-                    CoordinatingTestCase3BasicPubSub.class
-                });
+                               CoordinatingTestCase1DummyRun.class,
+                               CoordinatingTestCase2BasicP2P.class,
+                               CoordinatingTestCase3BasicPubSub.class);
 
             // Check that some test classes were actually found.
-            if ((testCaseClasses == null) || testCaseClasses.isEmpty())
+            if (testCaseClasses.isEmpty())
             {
                 throw new RuntimeException(
-                    "No test classes implementing CoordinatingTestCase were found on the class path.");
+                        "No test classes implementing CoordinatingTestCase were found on the class path.");
             }
 
             int i = 0;
@@ -194,7 +192,7 @@
     public TestResult start(String[] testClassNames) throws Exception
     {
         log.debug("public TestResult start(String[] testClassNames = " + PrettyPrintingUtils.printArray(testClassNames)
-            + ": called");
+                  + ": called");
 
         // Connect to the broker.
         connection = TestClient.createConnection(DEFAULT_CONNECTION_PROPS_RESOURCE, brokerUrl, virtualHost);
@@ -228,7 +226,7 @@
             // Record the current test class, so that the test results can be output to a file incorporating this name.
             this.currentTestClassName = testClassName;
 
-            result = super.start(new String[] { testClassName });
+            result = super.start(new String[]{testClassName});
         }
 
         // At this point in time, all tests have completed. Broadcast the shutdown message.
@@ -252,7 +250,7 @@
     public static Set<TestClientDetails> extractEnlists(Collection<Message> enlists) throws JMSException
     {
         log.debug("public static Set<TestClientDetails> extractEnlists(Collection<Message> enlists = " + enlists
-            + "): called");
+                  + "): called");
 
         Set<TestClientDetails> enlistedClients = new HashSet<TestClientDetails>();
 
@@ -310,9 +308,9 @@
             targetTest = new WrappedSuiteTestDecorator(suite);
             log.debug("Wrapped with a WrappedSuiteTestDecorator.");
         }
-
         // Wrap the tests in an inviting test decorator, to perform the invite/test cycle.
-        targetTest = new InvitingTestDecorator(targetTest, enlistedClients, conversationFactory, connection);
+
+        targetTest = newTestDecorator(targetTest, enlistedClients, conversationFactory, connection);
 
         TestSuite suite = new TestSuite();
         suite.addTest(targetTest);
@@ -323,6 +321,11 @@
         return super.doRun(suite, wait);
     }
 
+    protected WrappedSuiteTestDecorator newTestDecorator(WrappedSuiteTestDecorator targetTest, Set<TestClientDetails> enlistedClients, ConversationFactory conversationFactory, Connection connection)
+    {
+        return new InvitingTestDecorator(targetTest, enlistedClients, conversationFactory, connection);
+    }
+
     /**
      * Creates the TestResult object to be used for test runs.
      *
@@ -335,10 +338,10 @@
         TKTestResult result = new TKTestResult(fPrinter.getWriter(), delay, verbose, testCaseName);
 
         // Check if a directory to output reports to has been specified and attach test listeners if so.
-        if (reportDir != null)
+        if (_reportDir != null)
         {
             // Create the report directory if it does not already exist.
-            File reportDirFile = new File(reportDir);
+            File reportDirFile = new File(_reportDir);
 
             if (!reportDirFile.exists())
             {
@@ -376,5 +379,10 @@
         }
 
         return result;
+    }
+
+    public void setReportDir(String reportDir)
+    {
+        _reportDir = reportDir;
     }
 }

Modified: incubator/qpid/trunk/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/coordinator/InvitingTestDecorator.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/coordinator/InvitingTestDecorator.java?view=diff&rev=547730&r1=547729&r2=547730
==============================================================================
--- incubator/qpid/trunk/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/coordinator/InvitingTestDecorator.java (original)
+++ incubator/qpid/trunk/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/coordinator/InvitingTestDecorator.java Fri Jun 15 09:28:46 2007
@@ -21,7 +21,6 @@
 package org.apache.qpid.interop.coordinator;
 
 import java.util.*;
-import java.util.concurrent.LinkedBlockingQueue;
 
 import javax.jms.Connection;
 import javax.jms.Destination;
@@ -30,7 +29,6 @@
 
 import junit.framework.Test;
 import junit.framework.TestResult;
-import junit.framework.TestSuite;
 
 import org.apache.log4j.Logger;
 
@@ -107,7 +105,7 @@
             CoordinatingTestCase coordTest = (CoordinatingTestCase) test;
 
             // Broadcast the invitation to find out what clients are available to test.
-            Set<TestClientDetails> enlists = null;
+            Set<TestClientDetails> enlists;
             try
             {
                 Message invite = conversationFactory.getSession().createMessage();

Modified: incubator/qpid/trunk/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/testclient/TestClient.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/testclient/TestClient.java?view=diff&rev=547730&r1=547729&r2=547730
==============================================================================
--- incubator/qpid/trunk/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/testclient/TestClient.java (original)
+++ incubator/qpid/trunk/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/testclient/TestClient.java Fri Jun 15 09:28:46 2007
@@ -75,16 +75,17 @@
     /** Holds all the test cases loaded from the classpath. */
     Map<String, InteropClientTestCase> testCases = new HashMap<String, InteropClientTestCase>();
 
-    InteropClientTestCase currentTestCase;
+    protected InteropClientTestCase currentTestCase;
 
-    private MessageProducer producer;
-    private Session session;
+    protected Connection _connection;
+    protected MessageProducer producer;
+    protected Session session;
 
-    private String clientName = CLIENT_NAME;
+    protected String clientName = CLIENT_NAME;
 
     /**
-     * Creates a new interop test client, listenting to the specified broker and virtual host, with the specified
-     * client identifying name.
+     * Creates a new interop test client, listenting to the specified broker and virtual host, with the specified client
+     * identifying name.
      *
      * @param brokerUrl   The url of the broker to connect to.
      * @param virtualHost The virtual host to conect to.
@@ -93,7 +94,7 @@
     public TestClient(String brokerUrl, String virtualHost, String clientName)
     {
         log.debug("public TestClient(String brokerUrl = " + brokerUrl + ", String virtualHost = " + virtualHost
-            + ", String clientName = " + clientName + "): called");
+                  + ", String clientName = " + clientName + "): called");
 
         // Retain the connection parameters.
         this.brokerUrl = brokerUrl;
@@ -117,13 +118,13 @@
     {
         // Use the command line parser to evaluate the command line.
         CommandLineParser commandLine =
-            new CommandLineParser(
-                new String[][]
-                {
-                    { "b", "The broker URL.", "broker", "false" },
-                    { "h", "The virtual host to use.", "virtual host", "false" },
-                    { "n", "The test client name.", "name", "false" }
-                });
+                new CommandLineParser(
+                        new String[][]
+                                {
+                                        {"b", "The broker URL.", "broker", "false"},
+                                        {"h", "The virtual host to use.", "virtual host", "false"},
+                                        {"n", "The test client name.", "name", "false"}
+                                });
 
         // Capture the command line arguments or display errors and correct usage and then exit.
         Properties options = null;
@@ -151,9 +152,17 @@
         // Create a test client and start it running.
         TestClient client = new TestClient(brokerUrl, virtualHost, (clientName == null) ? CLIENT_NAME : clientName);
 
+        // Use a class path scanner to find all the interop test case implementations.
+        Collection<Class<? extends InteropClientTestCase>> testCaseClasses =
+                new ArrayList<Class<? extends InteropClientTestCase>>();
+        // ClasspathScanner.getMatches(InteropClientTestCase.class, "^TestCase.*", true);
+        // Hard code the test classes till the classpath scanner is fixed.
+        Collections.addAll(testCaseClasses,
+                           new Class[]{TestCase1DummyRun.class, TestCase2BasicP2P.class, TestClient.class});
+
         try
         {
-            client.start();
+            client.start(testCaseClasses);
         }
         catch (Exception e)
         {
@@ -165,20 +174,12 @@
     /**
      * Starts the interop test client running. This causes it to start listening for incoming test invites.
      *
-     * @throws JMSException Any underlying JMSExceptions are allowed to fall through.
+     * @throws JMSException Any underlying JMSExceptions are allowed to fall through. @param testCaseClasses
      */
-    private void start() throws JMSException
+    protected void start(Collection<Class<? extends InteropClientTestCase>> testCaseClasses) throws JMSException
     {
         log.debug("private void start(): called");
 
-        // Use a class path scanner to find all the interop test case implementations.
-        Collection<Class<? extends InteropClientTestCase>> testCaseClasses =
-            new ArrayList<Class<? extends InteropClientTestCase>>();
-        // ClasspathScanner.getMatches(InteropClientTestCase.class, "^TestCase.*", true);
-        // Hard code the test classes till the classpath scanner is fixed.
-        Collections.addAll(testCaseClasses,
-            new Class[] { TestCase1DummyRun.class, TestCase2BasicP2P.class, TestCase3BasicPubSub.class });
-
         // Create all the test case implementations and index them by the test names.
         for (Class<? extends InteropClientTestCase> nextClass : testCaseClasses)
         {
@@ -200,9 +201,9 @@
         }
 
         // Open a connection to communicate with the coordinator on.
-        Connection connection = createConnection(DEFAULT_CONNECTION_PROPS_RESOURCE, brokerUrl, virtualHost);
+        _connection = createConnection(DEFAULT_CONNECTION_PROPS_RESOURCE, brokerUrl, virtualHost);
 
-        session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+        session = _connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
 
         // Set this up to listen for control messages.
         MessageConsumer consumer = session.createConsumer(session.createTopic("iop.control." + clientName));
@@ -215,7 +216,7 @@
         producer = session.createProducer(null);
 
         // Start listening for incoming control messages.
-        connection.start();
+        _connection.start();
     }
 
     /**
@@ -232,22 +233,25 @@
      * @param virtualHost             The virtual host to connectio to, <tt>null</tt> to use the default.
      *
      * @return A JMS conneciton.
+     *
+     * @todo Make username/password configurable. Allow multiple urls for fail over. Once it feels right, move it to a
+     * Utils library class.
      */
     public static Connection createConnection(String connectionPropsResource, String brokerUrl, String virtualHost)
     {
         log.debug("public static Connection createConnection(String connectionPropsResource = " + connectionPropsResource
-            + ", String brokerUrl = " + brokerUrl + ", String virtualHost = " + virtualHost + "): called");
+                  + ", String brokerUrl = " + brokerUrl + ", String virtualHost = " + virtualHost + "): called");
 
         try
         {
             Properties connectionProps =
-                PropertiesUtils.getProperties(TestClient.class.getClassLoader().getResourceAsStream(
-                        connectionPropsResource));
+                    PropertiesUtils.getProperties(TestClient.class.getClassLoader().getResourceAsStream(
+                            connectionPropsResource));
 
             if (brokerUrl != null)
             {
                 String connectionString =
-                    "amqp://guest:guest/" + ((virtualHost != null) ? virtualHost : "") + "?brokerlist='" + brokerUrl + "'";
+                        "amqp://guest:guest/" + ((virtualHost != null) ? virtualHost : "") + "?brokerlist='" + brokerUrl + "'";
                 connectionProps.setProperty(CONNECTION_PROPERTY, connectionString);
             }
 
@@ -286,21 +290,21 @@
             String controlType = message.getStringProperty("CONTROL_TYPE");
             String testName = message.getStringProperty("TEST_NAME");
 
+            log.info("onMessage(Message message = " + message + "): for '" + controlType + "' to '" + testName + "'");
+
             // Check if the message is a test invite.
             if ("INVITE".equals(controlType))
             {
-                String testCaseName = message.getStringProperty("TEST_NAME");
-
                 // Flag used to indicate that an enlist should be sent. Only enlist to compulsory invites or invites
                 // for which test cases exist.
                 boolean enlist = false;
 
-                if (testCaseName != null)
+                if (testName != null)
                 {
-                    log.debug("Got an invite to test: " + testCaseName);
+                    log.debug("Got an invite to test: " + testName);
 
                     // Check if the requested test case is available.
-                    InteropClientTestCase testCase = testCases.get(testCaseName);
+                    InteropClientTestCase testCase = testCases.get(testName);
 
                     if (testCase != null)
                     {
@@ -308,6 +312,10 @@
                         currentTestCase = testCase;
                         enlist = true;
                     }
+                    else
+                    {
+                        log.warn("'" + testName + "' not part of this clients tests.");
+                    }
                 }
                 else
                 {
@@ -325,6 +333,8 @@
                     enlistMessage.setStringProperty("CLIENT_PRIVATE_CONTROL_KEY", "iop.control." + clientName);
                     enlistMessage.setJMSCorrelationID(message.getJMSCorrelationID());
 
+                    log.info("Sending Message '" + enlistMessage + "'. to " + message.getJMSReplyTo());
+
                     producer.send(message.getJMSReplyTo(), enlistMessage);
                 }
             }
@@ -369,9 +379,10 @@
             }
             else if ("TERMINATE".equals(controlType))
             {
-                System.out.println("Received termination instruction from coordinator.");
+                log.info("Received termination instruction from coordinator.");
 
                 // Is a cleaner shutdown needed?
+                _connection.close();
                 System.exit(0);
             }
             else

Modified: incubator/qpid/trunk/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/testclient/testcases/TestCase1DummyRun.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/testclient/testcases/TestCase1DummyRun.java?view=diff&rev=547730&r1=547729&r2=547730
==============================================================================
--- incubator/qpid/trunk/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/testclient/testcases/TestCase1DummyRun.java (original)
+++ incubator/qpid/trunk/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/testclient/testcases/TestCase1DummyRun.java Fri Jun 15 09:28:46 2007
@@ -20,13 +20,13 @@
  */
 package org.apache.qpid.interop.testclient.testcases;
 
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.Session;
-
 import org.apache.log4j.Logger;
 
 import org.apache.qpid.interop.testclient.InteropClientTestCase;
+
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.Session;
 
 /**
  * Implements tet case 1, dummy run. This test case sends no test messages, it exists to confirm that the test harness

Modified: incubator/qpid/trunk/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/testclient/testcases/TestCase3BasicPubSub.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/testclient/testcases/TestCase3BasicPubSub.java?view=diff&rev=547730&r1=547729&r2=547730
==============================================================================
--- incubator/qpid/trunk/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/testclient/testcases/TestCase3BasicPubSub.java (original)
+++ incubator/qpid/trunk/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/testclient/testcases/TestCase3BasicPubSub.java Fri Jun 15 09:28:46 2007
@@ -5,7 +5,6 @@
 import org.apache.log4j.Logger;
 
 import org.apache.qpid.interop.testclient.InteropClientTestCase;
-import org.apache.qpid.interop.testclient.TestClient;
 
 /**
  * Implements test case 3, basic pub/sub. Sends/received a specified number of messages to a specified route on the
@@ -120,8 +119,8 @@
             session = new Session[1];
 
             connection[0] =
-                TestClient.createConnection(TestClient.DEFAULT_CONNECTION_PROPS_RESOURCE, TestClient.brokerUrl,
-                    TestClient.virtualHost);
+                org.apache.qpid.interop.testclient.TestClient.createConnection(org.apache.qpid.interop.testclient.TestClient.DEFAULT_CONNECTION_PROPS_RESOURCE, org.apache.qpid.interop.testclient.TestClient.brokerUrl,
+                    org.apache.qpid.interop.testclient.TestClient.virtualHost);
             session[0] = connection[0].createSession(false, Session.AUTO_ACKNOWLEDGE);
 
             // Extract and retain the test parameters.
@@ -140,8 +139,8 @@
             for (int i = 0; i < numReceivers; i++)
             {
                 connection[i] =
-                    TestClient.createConnection(TestClient.DEFAULT_CONNECTION_PROPS_RESOURCE, TestClient.brokerUrl,
-                        TestClient.virtualHost);
+                    org.apache.qpid.interop.testclient.TestClient.createConnection(org.apache.qpid.interop.testclient.TestClient.DEFAULT_CONNECTION_PROPS_RESOURCE, org.apache.qpid.interop.testclient.TestClient.brokerUrl,
+                        org.apache.qpid.interop.testclient.TestClient.virtualHost);
                 session[i] = connection[i].createSession(false, Session.AUTO_ACKNOWLEDGE);
 
                 sendDestination = session[i].createTopic(sendKey);

Modified: incubator/qpid/trunk/qpid/java/management/eclipse-plugin/pom.xml
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/management/eclipse-plugin/pom.xml?view=diff&rev=547730&r1=547729&r2=547730
==============================================================================
--- incubator/qpid/trunk/qpid/java/management/eclipse-plugin/pom.xml (original)
+++ incubator/qpid/trunk/qpid/java/management/eclipse-plugin/pom.xml Fri Jun 15 09:28:46 2007
@@ -167,16 +167,27 @@
             <version>3.2.0</version>
             <scope>compile</scope>
         </dependency>
+
+        <!-- Test Dependencies -->
+        <dependency>  
+            <groupId>org.slf4j</groupId> 
+            <artifactId>slf4j-log4j12</artifactId>  
+            <version>1.4.0</version>  
+            <scope>test</scope> 
+        </dependency>
+
         <dependency>
             <groupId>org.apache.qpid</groupId>
             <artifactId>qpid-broker</artifactId>
             <scope>test</scope>
         </dependency>
+
         <dependency>
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
             <scope>test</scope>
         </dependency>
+
     </dependencies>
 
     <build>        

Modified: incubator/qpid/trunk/qpid/java/perftests/RunningPerformanceTests.txt
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/perftests/RunningPerformanceTests.txt?view=diff&rev=547730&r1=547729&r2=547730
==============================================================================
--- incubator/qpid/trunk/qpid/java/perftests/RunningPerformanceTests.txt (original)
+++ incubator/qpid/trunk/qpid/java/perftests/RunningPerformanceTests.txt Fri Jun 15 09:28:46 2007
@@ -116,7 +116,7 @@
 
 The most common test case to run is implemented in the class PingAsyncTestPerf, which sends and recieves messages simultaneously. This class uses a PingPongProdicer to do its sending and receiving, and wraps it in a suitable way to make it callable through the extended JUnit test runner. This class also accpets another parameter "batchSize" with a default of "1000". This tells the test how many messages to send before stopping sending and waiting for them all to come back. The actual value entered does not matter too much, but typically values larger than 1000 are used to ensure that there is a reasonable opportunity for simultaneous sending and receiving, and less than 10000 to ensure that each test method invocation does not go on for too long.
 
-The test script parameters can all be seen in the pom.xml file. A three letter code is used on the test scripts, first letter P or T for persistent or transient, second letter Q or T for queue (p2p) or topic (pub/sub), third letter R for reliability tests, C for client scaling tests, M for message size tests.Typically tests run and sample their results for 10 minutes, to get a reasonable measurement of a broker running under a steady load. The tests as configured do not measure peak performance.
+The test script parameters can all be seen in the pom.xml file. A three letter code is used on the test scripts, first letter P or T for persistent or transient, second letter Q or T for queue (p2p) or topic (pub/sub), third letter R for reliability tests, C for client scaling tests, M for message size tests.Typically tests run and sample their results for 10 minutes, to get a reasonable measurement of a broker running under a steady load. The tests as configured do not measure 'burst' performance.
 
 The reliability/burn in tests, test the broker running at slightly below its maximum throughput for a period of 24 hours. Their purpose is to check that the broker remains stable under load for a reasonable duration, in order to provide some confidence in the long-term stability of its process. These tests are intended to be run as a two step process. The first two tests run for 10 minutes and are used to asses the broker throughput for the test. The output from these tests are to be fed into the rate limiter for the second set of tests, so that the broker may be set up to run at slightly below its maximum throughput for the 24 hour duration. It is suggested that 90% of the rate achieved by the first two tests should be used for this.
 

Modified: incubator/qpid/trunk/qpid/java/perftests/pom.xml
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/perftests/pom.xml?view=diff&rev=547730&r1=547729&r2=547730
==============================================================================
--- incubator/qpid/trunk/qpid/java/perftests/pom.xml (original)
+++ incubator/qpid/trunk/qpid/java/perftests/pom.xml Fri Jun 15 09:28:46 2007
@@ -305,16 +305,16 @@
                         <PTM-Qpid-2-1M>-n PTM-Qpid-2-1M     -d10M -s[1000]   -c[1]               -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true  pubsub=true  transacted=false commitBatchSize=10  batchSize=1000   messageSize=1048476 destinationsCount=1  rate=0     maxPending=20000000</PTM-Qpid-2-1M>
 
                         <!-- Failover Tests. -->
-                        <FT-Qpid-1>-n FT-Qpid-1 -s [250000] -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf messageSize=256 batchSize=10000 transacted=true broker="tcp://10.0.0.1:5001;tcp://10.0.0.2:5002" failBeforeSend=true -o $QPID_WORK/results</FT-Qpid-1>
-                        <FT-Qpid-2>-n FT-Qpid-2 -s [250000] -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf messageSize=256 batchSize=10000 transacted=true broker="tcp://10.0.0.1:5001;tcp://10.0.0.2:5002" failAfterSend=true -o $QPID_WORK/results</FT-Qpid-2>
-                        <FT-Qpid-3>-n FT-Qpid-3 -s [250000] -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf messageSize=256 batchSize=10000 transacted=true broker="tcp://10.0.0.1:5001;tcp://10.0.0.2:5002" failAfterCommit=true -o $QPID_WORK/results</FT-Qpid-3>
-                        <FT-Qpid-4>-n FT-Qpid-4 -s [250000] -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf messageSize=256 batchSize=10000 broker="tcp://10.0.0.1:5001;tcp://10.0.0.2:5002" transacted=false failBeforeSend=true -o $QPID_WORK/results</FT-Qpid-4>
-                        <FT-Qpid-5>-n FT-Qpid-5 -s [250000] -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf messageSize=256 batchSize=10000 broker="tcp://10.0.0.1:5001;tcp://10.0.0.2:5002" transacted=false failAfterSend=true -o $QPID_WORK/results</FT-Qpid-5>
-                        <FT-Qpid-1-P>-n FT-Qpid-1-P -s [25000] -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true messageSize=256 batchSize=10000 transacted=true broker="tcp://10.0.0.1:5001;tcp://10.0.0.2:5002" failBeforeSend=true -o $QPID_WORK/results</FT-Qpid-1-P>
-                        <FT-Qpid-2-P>-n FT-Qpid-2-P -s [25000] -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true messageSize=256 batchSize=10000 transacted=true broker="tcp://10.0.0.1:5001;tcp://10.0.0.2:5002" failAfterSend=true -o $QPID_WORK/results</FT-Qpid-2-P>
-                        <FT-Qpid-3-P>-n FT-Qpid-3-P -s [25000] -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true messageSize=256 batchSize=10000 transacted=true broker="tcp://10.0.0.1:5001;tcp://10.0.0.2:5002" failAfterCommit=true -o $QPID_WORK/results</FT-Qpid-3-P>
-                        <FT-Qpid-4-P>-n FT-Qpid-4-P -s [250] -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true messageSize=256 broker="tcp://10.0.0.1:5001;tcp://10.0.0.2:5002" transacted=false failBeforeSend=true -o $QPID_WORK/results</FT-Qpid-4-P>
-                        <FT-Qpid-5-P>-n FT-Qpid-5-P -s [250] -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true messageSize=256 broker="tcp://10.0.0.1:5001;tcp://10.0.0.2:5002" transacted=false failAfterSend=true -o $QPID_WORK/results</FT-Qpid-5-P>
+                        <FT-Qpid-1>-n FT-Qpid-1 -s [250000] -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf messageSize=256 batchSize=10000 transacted=true broker="tcp://127.0.0.1:5001;tcp://127.0.0.1:5002" failBeforeSend=true -o $QPID_WORK/results</FT-Qpid-1>
+                        <FT-Qpid-2>-n FT-Qpid-2 -s [250000] -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf messageSize=256 batchSize=10000 transacted=true broker="tcp://127.0.0.1:5001;tcp://127.0.0.1:5002" failAfterSend=true -o $QPID_WORK/results</FT-Qpid-2>
+                        <FT-Qpid-3>-n FT-Qpid-3 -s [250000] -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf messageSize=256 batchSize=10000 transacted=true broker="tcp://127.0.0.1:5001;tcp://127.0.0.1:5002" failAfterCommit=true -o $QPID_WORK/results</FT-Qpid-3>
+                        <FT-Qpid-4>-n FT-Qpid-4 -s [250000] -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf messageSize=256 batchSize=10000 broker="tcp://127.0.0.1:5001;tcp://127.0.0.1:5002" transacted=false failBeforeSend=true -o $QPID_WORK/results</FT-Qpid-4>
+                        <FT-Qpid-5>-n FT-Qpid-5 -s [250000] -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf messageSize=256 batchSize=10000 broker="tcp://127.0.0.1:5001;tcp://127.0.0.1:5002" transacted=false failAfterSend=true -o $QPID_WORK/results</FT-Qpid-5>
+                        <FT-Qpid-1-P>-n FT-Qpid-1-P -s [25000] -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true messageSize=256 batchSize=10000 transacted=true broker="tcp://127.0.0.1:5001;tcp://127.0.0.1:5002" failBeforeSend=true -o $QPID_WORK/results</FT-Qpid-1-P>
+                        <FT-Qpid-2-P>-n FT-Qpid-2-P -s [25000] -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true messageSize=256 batchSize=10000 transacted=true broker="tcp://127.0.0.1:5001;tcp://127.0.0.1:5002" failAfterSend=true -o $QPID_WORK/results</FT-Qpid-2-P>
+                        <FT-Qpid-3-P>-n FT-Qpid-3-P -s [25000] -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true messageSize=256 batchSize=10000 transacted=true broker="tcp://127.0.0.1:5001;tcp://127.0.0.1:5002" failAfterCommit=true -o $QPID_WORK/results</FT-Qpid-3-P>
+                        <FT-Qpid-4-P>-n FT-Qpid-4-P -s [250] -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true messageSize=256 broker="tcp://127.0.0.1:5001;tcp://127.0.0.1:5002" transacted=false failBeforeSend=true -o $QPID_WORK/results</FT-Qpid-4-P>
+                        <FT-Qpid-5-P>-n FT-Qpid-5-P -s [250] -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true messageSize=256 broker="tcp://127.0.0.1:5001;tcp://127.0.0.1:5002" transacted=false failAfterSend=true -o $QPID_WORK/results</FT-Qpid-5-P>
 
                     </commands>
                 </configuration>

Modified: incubator/qpid/trunk/qpid/java/pom.xml
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/pom.xml?view=diff&rev=547730&r1=547729&r2=547730
==============================================================================
--- incubator/qpid/trunk/qpid/java/pom.xml (original)
+++ incubator/qpid/trunk/qpid/java/pom.xml Fri Jun 15 09:28:46 2007
@@ -41,12 +41,23 @@
     </prerequisites>
 
     <distributionManagement>
+
         <snapshotRepository>
             <id>apache.snapshots</id>
             <name>Apache SNAPSHOT Repository</name>
             <url>scp://people.apache.org/www/people.apache.org/repo/m2-snapshot-repository</url>
         </snapshotRepository>
 
+        <!--
+        <snapshotRepository>
+            <uniqueVersion>true</uniqueVersion>
+            <id>snapshot-repo</id>
+            <name>Local Snapshot Repository</name>
+            <url>file://${basedir}/${topDirectoryLocation}/snapshots</url>
+            <layout>default</layout>
+        </snapshotRepository>
+        -->
+
         <!-- Qpid has a Wiki site, maven generated site not used. This is just so that it can be created locally for viewing the reports. -->
         <site>
             <id>Qpid_Site</id>
@@ -414,7 +425,7 @@
             <dependency>
                 <groupId>commons-collections</groupId>
                 <artifactId>commons-collections</artifactId>
-                <version>3.1</version>
+                <version>3.2</version>
             </dependency>
             <dependency>
                 <groupId>commons-configuration</groupId>
@@ -591,7 +602,17 @@
                <enabled>true</enabled>
            </snapshots>
        </repository>
-    </repositories>
+    <repository>
+      <id>Codehaus Snapshots</id>
+      <url>http://snapshots.repository.codehaus.org/</url>
+      <snapshots>
+        <enabled>true</enabled>
+      </snapshots>
+      <releases>
+        <enabled>false</enabled>
+      </releases>
+    </repository>
+</repositories>
 
     <pluginRepositories>
         <pluginRepository>
@@ -619,8 +640,10 @@
             <id>fastinstall</id>
             <properties>
                 <maven.test.skip>true</maven.test.skip>
+                <skip.python.tests>true</skip.python.tests>
             </properties>
         </profile>
+
         <profile>
             <id>nochecks</id>
         </profile>

Modified: incubator/qpid/trunk/qpid/java/systests/pom.xml
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/systests/pom.xml?view=diff&rev=547730&r1=547729&r2=547730
==============================================================================
--- incubator/qpid/trunk/qpid/java/systests/pom.xml (original)
+++ incubator/qpid/trunk/qpid/java/systests/pom.xml Fri Jun 15 09:28:46 2007
@@ -54,6 +54,15 @@
             <artifactId>junit</artifactId>
             <scope>compile</scope>
         </dependency>
+
+        <!-- Test Dependencies -->
+        <dependency>  
+            <groupId>org.slf4j</groupId> 
+            <artifactId>slf4j-log4j12</artifactId>  
+            <version>1.4.0</version>  
+            <scope>test</scope> 
+        </dependency>
+
     </dependencies>
 
     <build>

Modified: incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/failure/HeapExhaustion.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/failure/HeapExhaustion.java?view=diff&rev=547730&r1=547729&r2=547730
==============================================================================
--- incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/failure/HeapExhaustion.java (original)
+++ incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/failure/HeapExhaustion.java Fri Jun 15 09:28:46 2007
@@ -1,13 +1,14 @@
 package org.apache.qpid.server.failure;
 
 import junit.framework.TestCase;
-import org.apache.qpid.testutil.QpidClientConnection;
+import org.apache.qpid.testutil.QpidClientConnectionHelper;
 import org.apache.qpid.client.failover.FailoverException;
 import org.apache.qpid.AMQException;
 import org.apache.qpid.protocol.AMQConstant;
 import org.apache.log4j.Logger;
 
 import javax.jms.JMSException;
+import javax.jms.DeliveryMode;
 import java.io.IOException;
 
 
@@ -16,7 +17,7 @@
 {
     private static final Logger _logger = Logger.getLogger(HeapExhaustion.class);
 
-    protected QpidClientConnection conn;                         
+    protected QpidClientConnectionHelper conn;
     protected final String BROKER = "localhost";
     protected final String vhost = "/test";
     protected final String queue = "direct://amq.direct//queue";
@@ -31,7 +32,7 @@
 
     protected void setUp() throws Exception
     {
-        conn = new QpidClientConnection(BROKER);
+        conn = new QpidClientConnectionHelper(BROKER);
         conn.setVirtualHost(vhost);
 
         try
@@ -68,7 +69,7 @@
         int size = payload.getBytes().length;
         while (true)
         {
-            conn.put(queue, payload, 1);
+            conn.put(queue, payload, 1, DeliveryMode.NON_PERSISTENT);
             copies++;
             total += size;
             System.out.println("put copy " + copies + " OK for total bytes: " + total);
@@ -88,7 +89,7 @@
         int size = payload.getBytes().length;
         while (true)
         {
-            conn.put(queue, payload, 1);
+            conn.put(queue, payload, 1, DeliveryMode.NON_PERSISTENT);
             copies++;
             total += size;
             System.out.println("put copy " + copies + " OK for total bytes: " + total);



Mime
View raw message