qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ritch...@apache.org
Subject svn commit: r571129 [7/15] - in /incubator/qpid/trunk/qpid/java: ./ broker/ broker/bin/ broker/distribution/src/main/assembly/ broker/etc/ broker/src/main/java/org/apache/log4j/ broker/src/main/java/org/apache/qpid/configuration/ broker/src/main/java/o...
Date Thu, 30 Aug 2007 12:19:42 GMT
Modified: incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/forwardall/CombinedTest.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/forwardall/CombinedTest.java?rev=571129&r1=571128&r2=571129&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/forwardall/CombinedTest.java (original)
+++ incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/forwardall/CombinedTest.java Thu Aug 30 05:19:31 2007
@@ -21,9 +21,7 @@
 package org.apache.qpid.test.unit.client.forwardall;
 
 import junit.framework.TestCase;
-
 import org.apache.qpid.testutil.VMBrokerSetup;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -34,6 +32,7 @@
 public class CombinedTest extends TestCase
 {
     private static final Logger _logger = LoggerFactory.getLogger(CombinedTest.class);
+    private int run = 0;
 
     protected void setUp() throws Exception
     {
@@ -48,14 +47,18 @@
 
     public void testForwardAll() throws Exception
     {
-        int services = 2;
-        ServiceCreator.start("vm://:1", services);
+        while (run < 10)
+        {
+            int services = 2;
+            ServiceCreator.start("vm://:1", services);
+
+            _logger.info("Starting " + ++run + " client...");
 
-        _logger.info("Starting client...");
+            new Client("vm://:1", services).shutdownWhenComplete();
 
-        new Client("vm://:1", services).shutdownWhenComplete();
 
-        _logger.info("Completed successfully!");
+            _logger.info("Completed " + run + " successfully!");
+        }
     }
 
     public static junit.framework.Test suite()

Modified: incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/transacted/CommitRollbackTest.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/transacted/CommitRollbackTest.java?rev=571129&r1=571128&r2=571129&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/transacted/CommitRollbackTest.java (original)
+++ incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/transacted/CommitRollbackTest.java Thu Aug 30 05:19:31 2007
@@ -21,12 +21,10 @@
 package org.apache.qpid.test.unit.transacted;
 
 import junit.framework.TestCase;
-
 import org.apache.qpid.AMQException;
 import org.apache.qpid.client.AMQConnection;
 import org.apache.qpid.client.transport.TransportConnection;
 import org.apache.qpid.url.URLSyntaxException;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -57,6 +55,9 @@
 
     private static final Logger _logger = LoggerFactory.getLogger(CommitRollbackTest.class);
     private static final String BROKER = "vm://:1";
+    private boolean _gotone = false;
+    private boolean _gottwo = false;
+    private boolean _gottwoRedelivered = false;
 
     protected void setUp() throws Exception
     {
@@ -340,57 +341,98 @@
      *
      * @throws Exception On error
      */
-    /*public void testSend2ThenRollback() throws Exception
+    public void testSend2ThenRollback() throws Exception
     {
-        assertTrue("session is not transacted", _session.getTransacted());
-        assertTrue("session is not transacted", _pubSession.getTransacted());
+        int run = 0;
+        while (run < 10)
+        {
+            run++;
+            _logger.info("Run:" + run);
+            assertTrue("session is not transacted", _session.getTransacted());
+            assertTrue("session is not transacted", _pubSession.getTransacted());
+
+            _logger.info("sending two test messages");
+            _publisher.send(_pubSession.createTextMessage("1"));
+            _publisher.send(_pubSession.createTextMessage("2"));
+            _pubSession.commit();
 
-        _logger.info("sending two test messages");
-        _publisher.send(_pubSession.createTextMessage("1"));
-        _publisher.send(_pubSession.createTextMessage("2"));
-        _pubSession.commit();
+            _logger.info("getting test message");
+            assertEquals("1", ((TextMessage) _consumer.receive(1000)).getText());
 
-        _logger.info("getting test message");
-        assertEquals("1", ((TextMessage) _consumer.receive(1000)).getText());
+            _logger.info("rolling back");
+            _session.rollback();
 
-        _logger.info("rolling back");
-        _session.rollback();
+            _logger.info("receiving result");
+            Message result = _consumer.receive(1000);
 
-        _logger.info("receiving result");
-        Message result = _consumer.receive(1000);
+            assertNotNull("test message was consumed and rolled back, but is gone", result);
 
-        assertNotNull("test message was consumed and rolled back, but is gone", result);
+            // Message Order is:
+
+            // Send 1 , 2
+            // Retrieve 1 and then rollback
+            // Receieve 1 (redelivered) , 2 (may or may not be redelivered??)
+
+            verifyMessages(result);
+
+            // Occassionally get message 2 first!
+//            assertEquals("Should get message one first", "1", ((TextMessage) result).getText());
+//            assertTrue("Message is not marked as redelivered", result.getJMSRedelivered());
+//
+//            result = _consumer.receive(1000);
+//            assertEquals("Second message should be message 2", "2", ((TextMessage) result).getText());
+//            assertTrue("Message is not marked as redelivered", result.getJMSRedelivered());
+//
+//            result = _consumer.receive(1000);
+//            assertNull("There should be no more messages", result);
+
+            _session.commit();
+        }
+    }
 
+    private void verifyMessages(Message result) throws JMSException
+    {
 
-        if (((TextMessage) result).getText().equals("2"))
+        if (result == null)
         {
-            assertTrue("Messasge is marked as redelivered", !result.getJMSRedelivered());
+            assertTrue("Didn't receive redelivered message one", _gotone);
+            assertTrue("Didn't receive message two at all", _gottwo | _gottwoRedelivered);
+            _gotone = false;
+            _gottwo = false;
+            _gottwoRedelivered = false;
+            return;
+        }
+
+        if (((TextMessage) result).getText().equals("1"))
+        {
+            _logger.info("Got 1 redelivered");
+            assertTrue("Message is not marked as redelivered", result.getJMSRedelivered());
+            assertFalse("Already received message one", _gotone);
+            _gotone = true;
 
-            result = _consumer.receive(1000);
-            assertEquals("1", ((TextMessage) result).getText());
-            assertTrue("Messasge is not marked as redelivered", result.getJMSRedelivered());
         }
         else
         {
-            assertEquals("1", ((TextMessage) result).getText());
-            assertTrue("Messasge is not marked as redelivered", result.getJMSRedelivered());
-            result = _consumer.receive(1000);
-            assertNotNull("test message was consumed and rolled back, but is gone", result);
             assertEquals("2", ((TextMessage) result).getText());
-            assertTrue("Messasge is not marked as redelivered", result.getJMSRedelivered());
-        }
 
-        result = _consumer.receive(1000);
+            if (result.getJMSRedelivered())
+            {
+                _logger.info("Got 2 redelivered, message was prefetched");
+                assertFalse("Already received message redelivered two", _gottwoRedelivered);
+
+                _gottwoRedelivered = true;
+            }
+            else
+            {
+                _logger.warn("Got 2, message prefetched wasn't cleared or messages was in transit when rollback occured");                
+                assertFalse("Already received message two", _gottwo);
 
-        if (result != null)
-        {
-            assertEquals("2", ((TextMessage) result).getText());
-            assertTrue("Messasge is not marked as redelivered", result.getJMSRedelivered());
-            result = _consumer.receive(1000);
+                _gottwo = true;
+            }
         }
 
-        assertNull("test message should be null", result);
-    }*/
+        verifyMessages(_consumer.receive(1000));
+    }
 
     public void testSend2ThenCloseAfter1andTryAgain() throws Exception
     {
@@ -417,12 +459,12 @@
 
         _logger.info("receiving result");
 
-        // NOTE: Both msg 1 & 2 will be marked as redelivered as they have both will have been rejected.
-        // Only the occasion where it is not rejected will it mean it hasn't arrived at the client yet.
+// NOTE: Both msg 1 & 2 will be marked as redelivered as they have both will have been rejected.
+// Only the occasion where it is not rejected will it mean it hasn't arrived at the client yet.
         result = _consumer.receive(1000);
         assertNotNull("test message was consumed and rolled back, but is gone", result);
 
-        // The first message back will be either 1 or 2 being redelivered
+// The first message back will be either 1 or 2 being redelivered
         if (result.getJMSRedelivered())
         {
             assertTrue("Messasge is not marked as redelivered" + result, result.getJMSRedelivered());

Modified: incubator/qpid/trunk/qpid/java/common/pom.xml
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/common/pom.xml?rev=571129&r1=571128&r2=571129&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/java/common/pom.xml (original)
+++ incubator/qpid/trunk/qpid/java/common/pom.xml Thu Aug 30 05:19:31 2007
@@ -152,15 +152,27 @@
     <dependencies>
 
         <dependency>  
+            <groupId>commons-configuration</groupId>
+            <artifactId>commons-configuration</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>commons-cli</groupId>
+            <artifactId>commons-cli</artifactId>
+        </dependency>
+
+
+
+        <dependency>
             <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-api</artifactId>  
+            <artifactId>slf4j-api</artifactId>
             <version>1.4.0</version> 
         </dependency>
 
-        <dependency>  
-            <groupId>org.slf4j</groupId> 
-            <artifactId>slf4j-log4j12</artifactId>  
-            <version>1.4.0</version>  
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+            <version>1.4.0</version>
             <scope>test</scope> 
         </dependency>
 

Modified: incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/AMQChannelException.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/AMQChannelException.java?rev=571129&r1=571128&r2=571129&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/AMQChannelException.java (original)
+++ incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/AMQChannelException.java Thu Aug 30 05:19:31 2007
@@ -7,9 +7,9 @@
  * 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
@@ -39,11 +39,8 @@
 {
     private final int _classId;
     private final int _methodId;
-
-    /** AMQP version for which exception ocurred, major code. */
+    /* AMQP version for which exception ocurred */
     private final byte major;
-
-    /** AMQP version for which exception ocurred, minor code. */
     private final byte minor;
 
     public AMQChannelException(AMQConstant errorCode, String msg, int classId, int methodId, byte major, byte minor,

Modified: incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQShortString.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQShortString.java?rev=571129&r1=571128&r2=571129&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQShortString.java (original)
+++ incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQShortString.java Thu Aug 30 05:19:31 2007
@@ -26,6 +26,10 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.util.Map;
+import java.util.WeakHashMap;
+import java.lang.ref.WeakReference;
+
 /**
  * A short string is a representation of an AMQ Short String
  * Short strings differ from the Java String class by being limited to on ASCII characters (0-127)
@@ -34,6 +38,19 @@
  */
 public final class AMQShortString implements CharSequence, Comparable<AMQShortString>
 {
+
+    private static final ThreadLocal<Map<AMQShortString, WeakReference<AMQShortString>>> _localInternMap =
+            new ThreadLocal<Map<AMQShortString, WeakReference<AMQShortString>>>()
+            {
+                protected Map<AMQShortString, WeakReference<AMQShortString>> initialValue()
+                {
+                    return new WeakHashMap<AMQShortString, WeakReference<AMQShortString>>();
+                };
+            };
+
+    private static final Map<AMQShortString, WeakReference<AMQShortString>> _globalInternMap =
+            new WeakHashMap<AMQShortString, WeakReference<AMQShortString>>();
+
     private static final Logger _logger = LoggerFactory.getLogger(AMQShortString.class);
 
     private final ByteBuffer _data;
@@ -375,5 +392,43 @@
 
             return (length() == name.length()) ? 0 : -1;
         }
+    }
+
+    public AMQShortString intern()
+    {
+
+        hashCode();
+
+        Map<AMQShortString, WeakReference<AMQShortString>> localMap =
+                _localInternMap.get();
+
+        WeakReference<AMQShortString> ref = localMap.get(this);
+        AMQShortString internString;
+
+        if(ref != null)
+        {
+            internString = ref.get();
+            if(internString != null)
+            {
+                return internString;
+            }
+        }
+
+
+        synchronized(_globalInternMap)
+        {
+
+            ref = _globalInternMap.get(this);
+            if((ref == null) || ((internString = ref.get()) == null))
+            {
+                internString = new AMQShortString(getBytes());
+                ref = new WeakReference(internString);
+                _globalInternMap.put(internString, ref);
+            }
+
+        }
+        localMap.put(internString, ref);
+        return internString;
+
     }
 }

Modified: incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/abstraction/MessagePublishInfoConverter.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/abstraction/MessagePublishInfoConverter.java?rev=571129&r1=571128&r2=571129&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/abstraction/MessagePublishInfoConverter.java (original)
+++ incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/abstraction/MessagePublishInfoConverter.java Thu Aug 30 05:19:31 2007
@@ -1,18 +1,21 @@
 /*
  *
- * Copyright (c) 2006 The Apache Software Foundation
+ * 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
  *
- * Licensed 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
  *
- *    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.
+ * 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.
  *
  */
 

Modified: incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/abstraction/ProtocolVersionMethodConverter.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/abstraction/ProtocolVersionMethodConverter.java?rev=571129&r1=571128&r2=571129&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/abstraction/ProtocolVersionMethodConverter.java (original)
+++ incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/abstraction/ProtocolVersionMethodConverter.java Thu Aug 30 05:19:31 2007
@@ -1,18 +1,21 @@
 /*
  *
- * Copyright (c) 2006 The Apache Software Foundation
+ * 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
  *
- * Licensed 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
  *
- *    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.
+ * 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.
  *
  */
 

Modified: incubator/qpid/trunk/qpid/java/distribution/pom.xml
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/distribution/pom.xml?rev=571129&r1=571128&r2=571129&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/java/distribution/pom.xml (original)
+++ incubator/qpid/trunk/qpid/java/distribution/pom.xml Thu Aug 30 05:19:31 2007
@@ -39,8 +39,11 @@
         <java.source.version>1.5</java.source.version>
         <qpid.version>${pom.version}</qpid.version>
         <qpid.targetDir>${project.build.directory}</qpid.targetDir>
+
+        <!-- This is an assembly/distribution pom so no test code exists -->
+        <maven.test.skip>true</maven.test.skip>
     </properties>
-   
+
     <repositories>
       <repository>
         <id>repo1.maven.org</id>
@@ -131,6 +134,8 @@
                 </executions>
             </plugin>
         </plugins>
+
+         <defaultGoal>assembly:assembly</defaultGoal>
     </build>
 
     <profiles>

Propchange: incubator/qpid/trunk/qpid/java/integrationtests/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Thu Aug 30 05:19:31 2007
@@ -1 +1,4 @@
 target
+qpid-integrationtests.iml
+qpid-integrationtests.ipr
+qpid-integrationtests.iws

Modified: incubator/qpid/trunk/qpid/java/integrationtests/pom.xml
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/integrationtests/pom.xml?rev=571129&r1=571128&r2=571129&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/java/integrationtests/pom.xml (original)
+++ incubator/qpid/trunk/qpid/java/integrationtests/pom.xml Thu Aug 30 05:19:31 2007
@@ -40,21 +40,26 @@
 
     <dependencies>
 
-        <!-- These tests depend on the client API only. -->
         <dependency>
             <groupId>org.apache.qpid</groupId>
             <artifactId>qpid-client</artifactId>
         </dependency>
 
         <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-log4j12</artifactId>
+            <groupId>org.apache.qpid</groupId>
+            <artifactId>qpid-systests</artifactId>
+        </dependency>
+
+        <dependency>  
+            <groupId>org.slf4j</groupId> 
+            <artifactId>slf4j-log4j12</artifactId>  
             <version>1.4.0</version>
         </dependency>
 
         <dependency>
             <groupId>uk.co.thebadgerset</groupId>
             <artifactId>junit-toolkit</artifactId>
+            <version>0.6-SNAPSHOT</version>
             <scope>compile</scope>
         </dependency>
 

Added: incubator/qpid/trunk/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/clienttestcases/TestCase1DummyRun.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/clienttestcases/TestCase1DummyRun.java?rev=571129&view=auto
==============================================================================
--- incubator/qpid/trunk/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/clienttestcases/TestCase1DummyRun.java (added)
+++ incubator/qpid/trunk/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/clienttestcases/TestCase1DummyRun.java Thu Aug 30 05:19:31 2007
@@ -0,0 +1,135 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.interop.clienttestcases;
+
+import org.apache.log4j.Logger;
+
+import org.apache.qpid.test.framework.distributedtesting.TestClientControlledTest;
+
+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
+ * is interacting with the coordinator correctly.
+ *
+ * <p><table id="crc"><caption>CRC Card</caption>
+ * <tr><th> Responsibilities <th> Collaborations
+ * <tr><td> Supply the name of the test case that this implements.
+ * <tr><td> Accept/Reject invites based on test parameters.
+ * <tr><td> Adapt to assigned roles.
+ * <tr><td> Perform test case actions.
+ * <tr><td> Generate test reports.
+ * </table>
+ */
+public class TestCase1DummyRun implements TestClientControlledTest
+{
+    /** Used for debugging. */
+    private static final Logger log = Logger.getLogger(TestCase1DummyRun.class);
+
+    /**
+     * Should provide the name of the test case that this class implements. The exact names are defined in the
+     * interop testing spec.
+     *
+     * @return The name of the test case that this implements.
+     */
+    public String getName()
+    {
+        log.debug("public String getName(): called");
+
+        return "TC1_DummyRun";
+    }
+
+    /**
+     * Determines whether the test invite that matched this test case is acceptable.
+     *
+     * @param inviteMessage The invitation to accept or reject.
+     *
+     * @return <tt>true</tt> to accept the invitation, <tt>false</tt> to reject it.
+     *
+     * @throws JMSException Any JMSException resulting from reading the message are allowed to fall through.
+     */
+    public boolean acceptInvite(Message inviteMessage) throws JMSException
+    {
+        log.debug("public boolean acceptInvite(Message inviteMessage): called");
+
+        // Test parameters don't matter, accept all invites.
+        return true;
+    }
+
+    /**
+     * Assigns the role to be played by this test case. The test parameters are fully specified in the
+     * assignment message. When this method return the test case will be ready to execute.
+     *
+     * @param role              The role to be played; sender or receivers.
+     * @param assignRoleMessage The role assingment message, contains the full test parameters.
+     *
+     * @throws JMSException Any JMSException resulting from reading the message are allowed to fall through.
+     */
+    public void assignRole(Roles role, Message assignRoleMessage) throws JMSException
+    {
+        log.debug("public void assignRole(Roles role, Message assignRoleMessage): called");
+
+        // Do nothing, both roles are the same.
+    }
+
+    /**
+     * Performs the test case actions. Returning from here, indicates that the sending role has completed its test.
+     * 
+     * @param numMessages The number of test messages to send.
+     */
+    public void start(int numMessages)
+    {
+        log.debug("public void start(): called");
+
+        // Do nothing.
+    }
+
+    /**
+     * Gets a report on the actions performed by the test case in its assigned role.
+     *
+     * @param session The controlSession to create the report message in.
+     *
+     * @return The report message.
+     *
+     * @throws JMSException Any JMSExceptions resulting from creating the report are allowed to fall through.
+     */
+    public Message getReport(Session session) throws JMSException
+    {
+        log.debug("public Message getReport(Session controlSession): called");
+
+        // Generate a dummy report, the coordinator expects a report but doesn't care what it is.
+        return session.createTextMessage("Dummy Run, Ok.");
+    }
+
+    /**
+     * Handles incoming test messages. Does nothing.
+     *
+     * @param message The incoming test message.
+     */
+    public void onMessage(Message message)
+    {
+        log.debug("public void onMessage(Message message = " + message + "): called");
+
+        // Ignore any messages.
+    }
+}

Propchange: incubator/qpid/trunk/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/clienttestcases/TestCase1DummyRun.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/qpid/trunk/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/clienttestcases/TestCase1DummyRun.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/qpid/trunk/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/clienttestcases/TestCase2BasicP2P.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/clienttestcases/TestCase2BasicP2P.java?rev=571129&view=auto
==============================================================================
--- incubator/qpid/trunk/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/clienttestcases/TestCase2BasicP2P.java (added)
+++ incubator/qpid/trunk/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/clienttestcases/TestCase2BasicP2P.java Thu Aug 30 05:19:31 2007
@@ -0,0 +1,209 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.interop.clienttestcases;
+
+import org.apache.log4j.Logger;
+
+import org.apache.qpid.test.framework.TestUtils;
+import org.apache.qpid.test.framework.distributedtesting.TestClient;
+import org.apache.qpid.test.framework.distributedtesting.TestClientControlledTest;
+
+import javax.jms.*;
+
+/**
+ * Implements test case 2, basic P2P. Sends/received a specified number of messages to a specified route on the
+ * default direct exchange. Produces reports on the actual number of messages sent/received.
+ *
+ * <p><table id="crc"><caption>CRC Card</caption>
+ * <tr><th> Responsibilities <th> Collaborations
+ * <tr><td> Supply the name of the test case that this implements.
+ * <tr><td> Accept/Reject invites based on test parameters.
+ * <tr><td> Adapt to assigned roles.
+ * <tr><td> Send required number of test messages.
+ * <tr><td> Generate test reports.
+ * </table>
+ */
+public class TestCase2BasicP2P implements TestClientControlledTest, MessageListener
+{
+    /** Used for debugging. */
+    private static final Logger log = Logger.getLogger(TestCase2BasicP2P.class);
+
+    /** Holds the count of test messages received. */
+    private int messageCount;
+
+    /** The role to be played by the test. */
+    private Roles role;
+
+    /** The number of test messages to send. */
+    private int numMessages;
+
+    /** The connection to send the test messages on. */
+    private Connection connection;
+
+    /** The controlSession to send the test messages on. */
+    private Session session;
+
+    /** The producer to send the test messages with. */
+    MessageProducer producer;
+
+    /**
+     * Should provide the name of the test case that this class implements. The exact names are defined in the
+     * interop testing spec.
+     *
+     * @return The name of the test case that this implements.
+     */
+    public String getName()
+    {
+        log.debug("public String getName(): called");
+
+        return "TC2_BasicP2P";
+    }
+
+    /**
+     * Determines whether the test invite that matched this test case is acceptable.
+     *
+     * @param inviteMessage The invitation to accept or reject.
+     *
+     * @return <tt>true</tt> to accept the invitation, <tt>false</tt> to reject it.
+     *
+     * @throws JMSException Any JMSException resulting from reading the message are allowed to fall through.
+     */
+    public boolean acceptInvite(Message inviteMessage) throws JMSException
+    {
+        log.debug("public boolean acceptInvite(Message inviteMessage = " + inviteMessage + "): called");
+
+        // All invites are acceptable.
+        return true;
+    }
+
+    /**
+     * Assigns the role to be played by this test case. The test parameters are fully specified in the
+     * assignment message. When this method return the test case will be ready to execute.
+     *
+     * @param role              The role to be played; sender or receivers.
+     *
+     * @param assignRoleMessage The role assingment message, contains the full test parameters.
+     *
+     * @throws JMSException Any JMSException resulting from reading the message are allowed to fall through.
+     */
+    public void assignRole(Roles role, Message assignRoleMessage) throws JMSException
+    {
+        log.debug("public void assignRole(Roles role = " + role + ", Message assignRoleMessage = " + assignRoleMessage
+            + "): called");
+
+        // Reset the message count for a new test.
+        messageCount = 0;
+
+        // Take note of the role to be played.
+        this.role = role;
+
+        // Create a new connection to pass the test messages on.
+        connection = TestUtils.createConnection(TestClient.testContextProperties);
+        session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+        // Extract and retain the test parameters.
+        numMessages = assignRoleMessage.getIntProperty("P2P_NUM_MESSAGES");
+        Destination sendDestination = session.createQueue(assignRoleMessage.getStringProperty("P2P_QUEUE_AND_KEY_NAME"));
+
+        log.debug("numMessages = " + numMessages);
+        log.debug("sendDestination = " + sendDestination);
+        log.debug("role = " + role);
+
+        switch (role)
+        {
+        // Check if the sender role is being assigned, and set up a message producer if so.
+        case SENDER:
+            producer = session.createProducer(sendDestination);
+            break;
+
+        // Otherwise the receivers role is being assigned, so set this up to listen for messages.
+        case RECEIVER:
+            MessageConsumer consumer = session.createConsumer(sendDestination);
+            consumer.setMessageListener(this);
+            break;
+        }
+
+        connection.start();
+    }
+
+    /**
+     * Performs the test case actions. Returning from here, indicates that the sending role has completed its test.
+     *
+     * @param numMessages The number of test messages to send.
+     *
+     * @throws JMSException Any JMSException resulting from reading the message are allowed to fall through.
+     */
+    public void start(int numMessages) throws JMSException
+    {
+        log.debug("public void start(): called");
+
+        // Check that the sender role is being performed.
+        if (role.equals(Roles.SENDER))
+        {
+            Message testMessage = session.createTextMessage("test");
+
+            for (int i = 0; i < this.numMessages; i++)
+            {
+                producer.send(testMessage);
+
+                // Increment the message count.
+                messageCount++;
+            }
+        }
+    }
+
+    /**
+     * Gets a report on the actions performed by the test case in its assigned role.
+     *
+     * @param session The controlSession to create the report message in.
+     *
+     * @return The report message.
+     *
+     * @throws JMSException Any JMSExceptions resulting from creating the report are allowed to fall through.
+     */
+    public Message getReport(Session session) throws JMSException
+    {
+        log.debug("public Message getReport(Session controlSession): called");
+
+        // Close the test connection.
+        connection.close();
+
+        // Generate a report message containing the count of the number of messages passed.
+        Message report = session.createMessage();
+        report.setStringProperty("CONTROL_TYPE", "REPORT");
+        report.setIntProperty("MESSAGE_COUNT", messageCount);
+
+        return report;
+    }
+
+    /**
+     * Counts incoming test messages.
+     *
+     * @param message The incoming test message.
+     */
+    public void onMessage(Message message)
+    {
+        log.debug("public void onMessage(Message message = " + message + "): called");
+
+        // Increment the message count.
+        messageCount++;
+    }
+}

Propchange: incubator/qpid/trunk/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/clienttestcases/TestCase2BasicP2P.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/qpid/trunk/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/clienttestcases/TestCase2BasicP2P.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/qpid/trunk/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/clienttestcases/TestCase3BasicPubSub.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/clienttestcases/TestCase3BasicPubSub.java?rev=571129&view=auto
==============================================================================
--- incubator/qpid/trunk/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/clienttestcases/TestCase3BasicPubSub.java (added)
+++ incubator/qpid/trunk/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/clienttestcases/TestCase3BasicPubSub.java Thu Aug 30 05:19:31 2007
@@ -0,0 +1,239 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.interop.clienttestcases;
+
+import org.apache.log4j.Logger;
+
+import org.apache.qpid.test.framework.TestUtils;
+import org.apache.qpid.test.framework.distributedtesting.TestClient;
+import org.apache.qpid.test.framework.distributedtesting.TestClientControlledTest;
+
+import javax.jms.*;
+
+/**
+ * Implements test case 3, basic pub/sub. Sends/received a specified number of messages to a specified route on the
+ * default topic exchange, using the specified number of receivers connections. Produces reports on the actual number of
+ * messages sent/received.
+ *
+ * <p><table id="crc"><caption>CRC Card</caption>
+ * <tr><th> Responsibilities <th> Collaborations
+ * <tr><td> Supply the name of the test case that this implements.
+ * <tr><td> Accept/Reject invites based on test parameters.
+ * <tr><td> Adapt to assigned roles.
+ * <tr><td> Send required number of test messages using pub/sub.
+ * <tr><td> Generate test reports.
+ * </table>
+ */
+public class TestCase3BasicPubSub implements TestClientControlledTest, MessageListener
+{
+    /** Used for debugging. */
+    private static final Logger log = Logger.getLogger(TestCase3BasicPubSub.class);
+
+    /** Holds the count of test messages received. */
+    private int messageCount;
+
+    /** The role to be played by the test. */
+    private Roles role;
+
+    /** The number of test messages to send. */
+    private int numMessages;
+
+    /** The connections to send/receive the test messages on. */
+    private Connection[] connection;
+
+    /** The sessions to send/receive the test messages on. */
+    private Session[] session;
+
+    /** The producer to send the test messages with. */
+    MessageProducer producer;
+
+    /**
+     * Should provide the name of the test case that this class implements. The exact names are defined in the
+     * interop testing spec.
+     *
+     * @return The name of the test case that this implements.
+     */
+    public String getName()
+    {
+        log.debug("public String getName(): called");
+
+        return "TC3_BasicPubSub";
+    }
+
+    /**
+     * Determines whether the test invite that matched this test case is acceptable.
+     *
+     * @param inviteMessage The invitation to accept or reject.
+     *
+     * @return <tt>true</tt> to accept the invitation, <tt>false</tt> to reject it.
+     *
+     * @throws javax.jms.JMSException Any JMSException resulting from reading the message are allowed to fall through.
+     */
+    public boolean acceptInvite(Message inviteMessage) throws JMSException
+    {
+        log.debug("public boolean acceptInvite(Message inviteMessage = " + inviteMessage + "): called");
+
+        // All invites are acceptable.
+        return true;
+    }
+
+    /**
+     * Assigns the role to be played by this test case. The test parameters are fully specified in the
+     * assignment message. When this method return the test case will be ready to execute.
+     *
+     * @param role              The role to be played; sender or receivers.
+     *
+     * @param assignRoleMessage The role assingment message, contains the full test parameters.
+     *
+     * @throws JMSException Any JMSException resulting from reading the message are allowed to fall through.
+     */
+    public void assignRole(Roles role, Message assignRoleMessage) throws JMSException
+    {
+        log.debug("public void assignRole(Roles role = " + role + ", Message assignRoleMessage = " + assignRoleMessage
+            + "): called");
+
+        // Reset the message count for a new test.
+        messageCount = 0;
+
+        // Take note of the role to be played.
+        this.role = role;
+
+        // Extract and retain the test parameters.
+        numMessages = assignRoleMessage.getIntProperty("PUBSUB_NUM_MESSAGES");
+        int numReceivers = assignRoleMessage.getIntProperty("PUBSUB_NUM_RECEIVERS");
+        String sendKey = assignRoleMessage.getStringProperty("PUBSUB_KEY");
+
+        log.debug("numMessages = " + numMessages);
+        log.debug("numReceivers = " + numReceivers);
+        log.debug("sendKey = " + sendKey);
+        log.debug("role = " + role);
+
+        switch (role)
+        {
+        // Check if the sender role is being assigned, and set up a single message producer if so.
+        case SENDER:
+            // Create a new connection to pass the test messages on.
+            connection = new Connection[1];
+            session = new Session[1];
+
+            connection[0] = TestUtils.createConnection(TestClient.testContextProperties);
+            session[0] = connection[0].createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+            // Extract and retain the test parameters.
+            Destination sendDestination = session[0].createTopic(sendKey);
+
+            producer = session[0].createProducer(sendDestination);
+            break;
+
+        // Otherwise the receivers role is being assigned, so set this up to listen for messages on the required number
+        // of receivers connections.
+        case RECEIVER:
+            // Create the required number of receivers connections.
+            connection = new Connection[numReceivers];
+            session = new Session[numReceivers];
+
+            for (int i = 0; i < numReceivers; i++)
+            {
+                connection[i] = TestUtils.createConnection(TestClient.testContextProperties);
+                session[i] = connection[i].createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+                sendDestination = session[i].createTopic(sendKey);
+
+                MessageConsumer consumer = session[i].createConsumer(sendDestination);
+                consumer.setMessageListener(this);
+            }
+
+            break;
+        }
+
+        // Start all the connection dispatcher threads running.
+        for (Connection conn : connection)
+        {
+            conn.start();
+        }
+    }
+
+    /**
+     * Performs the test case actions. Returning from here, indicates that the sending role has completed its test.
+     *
+     * @param numMessages The number of test messages to send.
+     *
+     * @throws JMSException Any JMSException resulting from reading the message are allowed to fall through.
+     */
+    public void start(int numMessages) throws JMSException
+    {
+        log.debug("public void start(): called");
+
+        // Check that the sender role is being performed.
+        if (role.equals(Roles.SENDER))
+        {
+            Message testMessage = session[0].createTextMessage("test");
+
+            for (int i = 0; i < this.numMessages; i++)
+            {
+                producer.send(testMessage);
+
+                // Increment the message count.
+                messageCount++;
+            }
+        }
+    }
+
+    /**
+     * Gets a report on the actions performed by the test case in its assigned role.
+     *
+     * @param session The controlSession to create the report message in.
+     *
+     * @return The report message.
+     *
+     * @throws JMSException Any JMSExceptions resulting from creating the report are allowed to fall through.
+     */
+    public Message getReport(Session session) throws JMSException
+    {
+        log.debug("public Message getReport(Session controlSession): called");
+
+        // Close the test connections.
+        for (Connection conn : connection)
+        {
+            conn.close();
+        }
+
+        // Generate a report message containing the count of the number of messages passed.
+        Message report = session.createMessage();
+        report.setStringProperty("CONTROL_TYPE", "REPORT");
+        report.setIntProperty("MESSAGE_COUNT", messageCount);
+
+        return report;
+    }
+
+    /**
+     * Counts incoming test messages.
+     *
+     * @param message The incoming test message.
+     */
+    public void onMessage(Message message)
+    {
+        log.debug("public void onMessage(Message message = " + message + "): called");
+
+        // Increment the message count.
+        messageCount++;
+    }
+}

Propchange: incubator/qpid/trunk/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/clienttestcases/TestCase3BasicPubSub.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/qpid/trunk/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/clienttestcases/TestCase3BasicPubSub.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/qpid/trunk/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/testcases/InteropTestCase1DummyRun.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/testcases/InteropTestCase1DummyRun.java?rev=571129&view=auto
==============================================================================
--- incubator/qpid/trunk/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/testcases/InteropTestCase1DummyRun.java (added)
+++ incubator/qpid/trunk/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/testcases/InteropTestCase1DummyRun.java Thu Aug 30 05:19:31 2007
@@ -0,0 +1,84 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.interop.testcases;
+
+import org.apache.log4j.Logger;
+
+import org.apache.qpid.test.framework.FrameworkBaseCase;
+
+import java.util.Properties;
+
+/**
+ * Coordinates test case 1, from the interop test specification. This test connects up the sender and receivers roles,
+ * and gets some dummy test reports from them, in order to check that the test framework itself is operational.
+ *
+ * <p><table id="crc"><caption>CRC Card</caption>
+ * <tr><th> Responsibilities <th> Collaborations
+ * <tr><td> Exercises the interop testing framework without actually sending any test messages.
+ *     <td> {@link FrameworkBaseCase}
+ * </table>
+ */
+public class InteropTestCase1DummyRun extends FrameworkBaseCase
+{
+    /** Used for debugging. */
+    private static final Logger log = Logger.getLogger(InteropTestCase1DummyRun.class);
+
+    /**
+     * Creates a new coordinating test case with the specified name.
+     *
+     * @param name The test case name.
+     */
+    public InteropTestCase1DummyRun(String name)
+    {
+        super(name);
+    }
+
+    /**
+     * Performs the basic P2P test case, "Test Case 2" in the specification.
+     *
+     * @throws Exception Any exceptions are allowed to fall through and fail the test.
+     */
+    public void testDummyRun() throws Exception
+    {
+        log.debug("public void testDummyRun(): called");
+
+        Properties testConfig = new Properties();
+        testConfig.put("TEST_NAME", "TC1_DummyRun");
+
+        /*Message[] reports =*/ getCircuitFactory().sequenceTest(null, null, testConfig);
+
+        // Compare sender and receivers reports.
+        // Assert.assertEquals("Expected to get 2 dummy reports.", 2, reports.length);
+    }
+
+    /**
+     * Should provide a translation from the junit method name of a test to its test case name as defined in the
+     * interop testing specification. For example the method "testP2P" might map onto the interop test case name
+     * "TC2_BasicP2P".
+     *
+     * @param methodName The name of the JUnit test method.
+     * @return The name of the corresponding interop test case.
+     */
+    public String getTestCaseNameForTestMethod(String methodName)
+    {
+        return "TC1_DummyRun";
+    }
+}

Propchange: incubator/qpid/trunk/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/testcases/InteropTestCase1DummyRun.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/qpid/trunk/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/testcases/InteropTestCase1DummyRun.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/qpid/trunk/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/testcases/InteropTestCase2BasicP2P.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/testcases/InteropTestCase2BasicP2P.java?rev=571129&view=auto
==============================================================================
--- incubator/qpid/trunk/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/testcases/InteropTestCase2BasicP2P.java (added)
+++ incubator/qpid/trunk/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/testcases/InteropTestCase2BasicP2P.java Thu Aug 30 05:19:31 2007
@@ -0,0 +1,90 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.interop.testcases;
+
+import org.apache.log4j.Logger;
+
+import org.apache.qpid.test.framework.FrameworkBaseCase;
+
+import java.util.Properties;
+
+/**
+ * Implements test case 2, from the interop test specification. This test sets up the TC2_BasicP2P test for 50
+ * messages. It checks that the sender and receivers reports both indicate that all the test messages were transmitted
+ * successfully.
+ *
+ * <p><table id="crc"><caption>CRC Card</caption>
+ * <tr><th> Responsibilities <th> Collaborations
+ * <tr><td> Setup p2p test parameters and compare with test output. <td> {@link FrameworkBaseCase}
+ * </table>
+ */
+public class InteropTestCase2BasicP2P extends FrameworkBaseCase
+{
+    /** Used for debugging. */
+    private static final Logger log = Logger.getLogger(InteropTestCase2BasicP2P.class);
+
+    /**
+     * Creates a new coordinating test case with the specified name.
+     *
+     * @param name The test case name.
+     */
+    public InteropTestCase2BasicP2P(String name)
+    {
+        super(name);
+    }
+
+    /**
+     * Performs the basic P2P test case, "Test Case 2" in the specification.
+     *
+     * @throws Exception Any exceptions are allowed to fall through and fail the test.
+     */
+    public void testBasicP2P() throws Exception
+    {
+        log.debug("public void testBasicP2P(): called");
+
+        Properties testConfig = new Properties();
+        testConfig.setProperty("TEST_NAME", "TC2_BasicP2P");
+        testConfig.setProperty("P2P_QUEUE_AND_KEY_NAME", "tc2queue");
+        testConfig.put("P2P_NUM_MESSAGES", 50);
+
+        /*Message[] reports =*/ getCircuitFactory().sequenceTest(null, null, testConfig);
+
+        // Compare sender and receivers reports.
+        /*int messagesSent = reports[0].getIntProperty("MESSAGE_COUNT");
+        int messagesReceived = reports[1].getIntProperty("MESSAGE_COUNT");
+
+        Assert.assertEquals("The requested number of messages were not sent.", 50, messagesSent);
+        Assert.assertEquals("Sender and receivers messages sent did not match up.", messagesSent, messagesReceived);*/
+    }
+
+    /**
+     * Should provide a translation from the junit method name of a test to its test case name as defined in the
+     * interop testing specification. For example the method "testP2P" might map onto the interop test case name
+     * "TC2_BasicP2P".
+     *
+     * @param methodName The name of the JUnit test method.
+     * @return The name of the corresponding interop test case.
+     */
+    public String getTestCaseNameForTestMethod(String methodName)
+    {
+        return "TC2_BasicP2P";
+    }
+}

Propchange: incubator/qpid/trunk/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/testcases/InteropTestCase2BasicP2P.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/qpid/trunk/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/testcases/InteropTestCase2BasicP2P.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/qpid/trunk/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/testcases/InteropTestCase3BasicPubSub.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/testcases/InteropTestCase3BasicPubSub.java?rev=571129&view=auto
==============================================================================
--- incubator/qpid/trunk/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/testcases/InteropTestCase3BasicPubSub.java (added)
+++ incubator/qpid/trunk/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/testcases/InteropTestCase3BasicPubSub.java Thu Aug 30 05:19:31 2007
@@ -0,0 +1,88 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.interop.testcases;
+
+import org.apache.log4j.Logger;
+
+import org.apache.qpid.test.framework.FrameworkBaseCase;
+
+import java.util.Properties;
+
+/**
+ * <p><table id="crc"><caption>CRC Card</caption>
+ * <tr><th> Responsibilities <th> Collaborations
+ * <tr><td> Setup pub/sub test parameters and compare with test output. <td> {@link FrameworkBaseCase}
+ * </table>
+ */
+public class InteropTestCase3BasicPubSub extends FrameworkBaseCase
+{
+    /** Used for debugging. */
+    private static final Logger log = Logger.getLogger(InteropTestCase3BasicPubSub.class);
+
+    /**
+     * Creates a new coordinating test case with the specified name.
+     *
+     * @param name The test case name.
+     */
+    public InteropTestCase3BasicPubSub(String name)
+    {
+        super(name);
+    }
+
+    /**
+     * Performs the basic P2P test case, "Test Case 2" in the specification.
+     *
+     * @throws Exception Any exceptions are allowed to fall through and fail the test.
+     */
+    public void testBasicPubSub() throws Exception
+    {
+        log.debug("public void testBasicPubSub(): called");
+
+        Properties testConfig = new Properties();
+        testConfig.put("TEST_NAME", "TC3_BasicPubSub");
+        testConfig.put("PUBSUB_KEY", "tc3route");
+        testConfig.put("PUBSUB_NUM_MESSAGES", 10);
+        testConfig.put("PUBSUB_NUM_RECEIVERS", 5);
+
+        /*Message[] reports =*/ getCircuitFactory().sequenceTest(null, null, testConfig);
+
+        // Compare sender and receivers reports.
+        /*int messagesSent = reports[0].getIntProperty("MESSAGE_COUNT");
+        int messagesReceived = reports[1].getIntProperty("MESSAGE_COUNT");
+
+        Assert.assertEquals("The requested number of messages were not sent.", 10, messagesSent);
+        Assert.assertEquals("Received messages did not match up to num sent * num receivers.", messagesSent * 5,
+            messagesReceived);*/
+    }
+
+    /**
+     * Should provide a translation from the junit method name of a test to its test case name as defined in the
+     * interop testing specification. For example the method "testP2P" might map onto the interop test case name
+     * "TC2_BasicP2P".
+     *
+     * @param methodName The name of the JUnit test method.
+     * @return The name of the corresponding interop test case.
+     */
+    public String getTestCaseNameForTestMethod(String methodName)
+    {
+        return "TC3_BasicPubSub";
+    }
+}

Propchange: incubator/qpid/trunk/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/testcases/InteropTestCase3BasicPubSub.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/qpid/trunk/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/testcases/InteropTestCase3BasicPubSub.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date



Mime
View raw message