You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ru...@apache.org on 2007/08/01 18:19:37 UTC
svn commit: r561855 [1/3] - in /incubator/qpid/branches/M2/java:
integrationtests/src/main/java/org/apache/qpid/interop/clienttestcases/
integrationtests/src/main/java/org/apache/qpid/interop/testcases/
integrationtests/src/main/java/org/apache/qpid/pe...
Author: rupertlssmith
Date: Wed Aug 1 09:19:31 2007
New Revision: 561855
URL: http://svn.apache.org/viewvc?view=rev&rev=561855
Log:
Extensive refactoring of the distributed test framework.
Added:
incubator/qpid/branches/M2/java/integrationtests/src/main/java/org/apache/qpid/perftests/
incubator/qpid/branches/M2/java/perftests/src/main/java/org/apache/qpid/perftests/
incubator/qpid/branches/M2/java/perftests/src/test/java/org/apache/qpid/perftests/
incubator/qpid/branches/M2/java/perftests/src/test/java/org/apache/qpid/perftests/QpidTestThroughputPerf.java
incubator/qpid/branches/M2/java/systests/etc/
incubator/qpid/branches/M2/java/systests/etc/bin/
incubator/qpid/branches/M2/java/systests/etc/bin/testclients.sh
incubator/qpid/branches/M2/java/systests/src/main/java/org/apache/qpid/test/framework/FrameworkClientBaseCase.java
incubator/qpid/branches/M2/java/systests/src/main/java/org/apache/qpid/test/framework/distributedcircuit/DistributedPublisherImpl.java
incubator/qpid/branches/M2/java/systests/src/main/java/org/apache/qpid/test/framework/distributedcircuit/DistributedReceiverImpl.java
incubator/qpid/branches/M2/java/systests/src/main/java/org/apache/qpid/test/framework/distributedcircuit/TestClientCircuitEnd.java
incubator/qpid/branches/M2/java/systests/src/main/java/org/apache/qpid/test/framework/distributedtesting/TestClientControlledTest.java
incubator/qpid/branches/M2/java/systests/src/main/java/org/apache/qpid/test/framework/localcircuit/LocalCircuitImpl.java
- copied, changed from r559458, incubator/qpid/branches/M2/java/systests/src/main/java/org/apache/qpid/test/framework/localcircuit/CircuitImpl.java
incubator/qpid/branches/M2/java/systests/src/main/java/org/apache/qpid/test/framework/localcircuit/LocalPublisherImpl.java
- copied, changed from r559458, incubator/qpid/branches/M2/java/systests/src/main/java/org/apache/qpid/test/framework/localcircuit/PublisherImpl.java
incubator/qpid/branches/M2/java/systests/src/main/java/org/apache/qpid/test/framework/localcircuit/LocalReceiverImpl.java
- copied, changed from r559458, incubator/qpid/branches/M2/java/systests/src/main/java/org/apache/qpid/test/framework/localcircuit/ReceiverImpl.java
incubator/qpid/branches/M2/java/systests/src/main/java/org/apache/qpid/test/framework/sequencers/BaseCircuitFactory.java
- copied, changed from r559458, incubator/qpid/branches/M2/java/systests/src/main/java/org/apache/qpid/test/framework/sequencers/BaseDistributedTestSequencer.java
incubator/qpid/branches/M2/java/systests/src/main/java/org/apache/qpid/test/framework/sequencers/CircuitFactory.java
- copied, changed from r559458, incubator/qpid/branches/M2/java/systests/src/main/java/org/apache/qpid/test/framework/sequencers/TestCaseSequencer.java
incubator/qpid/branches/M2/java/systests/src/main/java/org/apache/qpid/test/framework/sequencers/FanOutCircuitFactory.java
- copied, changed from r559458, incubator/qpid/branches/M2/java/systests/src/main/java/org/apache/qpid/test/framework/sequencers/FanOutTestSequencer.java
incubator/qpid/branches/M2/java/systests/src/main/java/org/apache/qpid/test/framework/sequencers/InteropCircuitFactory.java
- copied, changed from r559458, incubator/qpid/branches/M2/java/systests/src/main/java/org/apache/qpid/test/framework/sequencers/InteropTestSequencer.java
Removed:
incubator/qpid/branches/M2/java/integrationtests/src/main/java/org/apache/qpid/interop/testcases/CircuitTestCase.java
incubator/qpid/branches/M2/java/integrationtests/src/main/java/org/apache/qpid/test/framework/distributedtesting/InteropClientTestCase.java
incubator/qpid/branches/M2/java/systests/src/main/java/org/apache/qpid/test/framework/distributedtesting/DistributedTestCase.java
incubator/qpid/branches/M2/java/systests/src/main/java/org/apache/qpid/test/framework/localcircuit/CircuitImpl.java
incubator/qpid/branches/M2/java/systests/src/main/java/org/apache/qpid/test/framework/localcircuit/PublisherImpl.java
incubator/qpid/branches/M2/java/systests/src/main/java/org/apache/qpid/test/framework/localcircuit/ReceiverImpl.java
incubator/qpid/branches/M2/java/systests/src/main/java/org/apache/qpid/test/framework/sequencers/BaseDistributedTestSequencer.java
incubator/qpid/branches/M2/java/systests/src/main/java/org/apache/qpid/test/framework/sequencers/DistributedTestSequencer.java
incubator/qpid/branches/M2/java/systests/src/main/java/org/apache/qpid/test/framework/sequencers/FanOutTestSequencer.java
incubator/qpid/branches/M2/java/systests/src/main/java/org/apache/qpid/test/framework/sequencers/InteropTestSequencer.java
incubator/qpid/branches/M2/java/systests/src/main/java/org/apache/qpid/test/framework/sequencers/TestCaseSequencer.java
Modified:
incubator/qpid/branches/M2/java/integrationtests/src/main/java/org/apache/qpid/interop/clienttestcases/TestCase1DummyRun.java
incubator/qpid/branches/M2/java/integrationtests/src/main/java/org/apache/qpid/interop/clienttestcases/TestCase2BasicP2P.java
incubator/qpid/branches/M2/java/integrationtests/src/main/java/org/apache/qpid/interop/clienttestcases/TestCase3BasicPubSub.java
incubator/qpid/branches/M2/java/integrationtests/src/main/java/org/apache/qpid/interop/testcases/InteropTestCase1DummyRun.java
incubator/qpid/branches/M2/java/integrationtests/src/main/java/org/apache/qpid/interop/testcases/InteropTestCase2BasicP2P.java
incubator/qpid/branches/M2/java/integrationtests/src/main/java/org/apache/qpid/interop/testcases/InteropTestCase3BasicPubSub.java
incubator/qpid/branches/M2/java/integrationtests/src/main/java/org/apache/qpid/sustained/SustainedClientTestCase.java
incubator/qpid/branches/M2/java/integrationtests/src/main/java/org/apache/qpid/sustained/SustainedTestCase.java
incubator/qpid/branches/M2/java/integrationtests/src/main/java/org/apache/qpid/test/framework/distributedtesting/TestClient.java
incubator/qpid/branches/M2/java/perftests/jar-with-dependencies.xml
incubator/qpid/branches/M2/java/perftests/pom.xml
incubator/qpid/branches/M2/java/perftests/src/main/java/org/apache/qpid/requestreply/PingPongBouncer.java
incubator/qpid/branches/M2/java/perftests/src/main/java/org/apache/qpid/requestreply/PingPongProducer.java
incubator/qpid/branches/M2/java/systests/src/main/java/org/apache/qpid/server/exchange/ImmediateMessageTest.java
incubator/qpid/branches/M2/java/systests/src/main/java/org/apache/qpid/server/exchange/MandatoryMessageTest.java
incubator/qpid/branches/M2/java/systests/src/main/java/org/apache/qpid/test/framework/CircuitEnd.java
incubator/qpid/branches/M2/java/systests/src/main/java/org/apache/qpid/test/framework/CircuitEndBase.java
incubator/qpid/branches/M2/java/systests/src/main/java/org/apache/qpid/test/framework/ExceptionMonitor.java
incubator/qpid/branches/M2/java/systests/src/main/java/org/apache/qpid/test/framework/FrameworkBaseCase.java
incubator/qpid/branches/M2/java/systests/src/main/java/org/apache/qpid/test/framework/MessageMonitor.java
incubator/qpid/branches/M2/java/systests/src/main/java/org/apache/qpid/test/framework/MessagingTestConfigProperties.java
incubator/qpid/branches/M2/java/systests/src/main/java/org/apache/qpid/test/framework/Publisher.java
incubator/qpid/branches/M2/java/systests/src/main/java/org/apache/qpid/test/framework/Receiver.java
incubator/qpid/branches/M2/java/systests/src/main/java/org/apache/qpid/test/framework/distributedcircuit/DistributedCircuitImpl.java
incubator/qpid/branches/M2/java/systests/src/main/java/org/apache/qpid/test/framework/distributedtesting/Coordinator.java
incubator/qpid/branches/M2/java/systests/src/main/java/org/apache/qpid/test/framework/distributedtesting/DistributedTestDecorator.java
incubator/qpid/branches/M2/java/systests/src/main/java/org/apache/qpid/test/framework/distributedtesting/FanOutTestDecorator.java
incubator/qpid/branches/M2/java/systests/src/main/java/org/apache/qpid/test/framework/distributedtesting/InteropTestDecorator.java
incubator/qpid/branches/M2/java/systests/src/main/java/org/apache/qpid/test/framework/distributedtesting/OptOutTestCase.java
incubator/qpid/branches/M2/java/systests/src/main/java/org/apache/qpid/test/framework/listeners/XMLTestListener.java
incubator/qpid/branches/M2/java/systests/src/main/java/org/apache/qpid/util/ConversationFactory.java
Modified: incubator/qpid/branches/M2/java/integrationtests/src/main/java/org/apache/qpid/interop/clienttestcases/TestCase1DummyRun.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2/java/integrationtests/src/main/java/org/apache/qpid/interop/clienttestcases/TestCase1DummyRun.java?view=diff&rev=561855&r1=561854&r2=561855
==============================================================================
--- incubator/qpid/branches/M2/java/integrationtests/src/main/java/org/apache/qpid/interop/clienttestcases/TestCase1DummyRun.java (original)
+++ incubator/qpid/branches/M2/java/integrationtests/src/main/java/org/apache/qpid/interop/clienttestcases/TestCase1DummyRun.java Wed Aug 1 09:19:31 2007
@@ -22,7 +22,7 @@
import org.apache.log4j.Logger;
-import org.apache.qpid.test.framework.distributedtesting.InteropClientTestCase;
+import org.apache.qpid.test.framework.distributedtesting.TestClientControlledTest;
import javax.jms.JMSException;
import javax.jms.Message;
@@ -41,7 +41,7 @@
* <tr><td> Generate test reports.
* </table>
*/
-public class TestCase1DummyRun implements InteropClientTestCase
+public class TestCase1DummyRun implements TestClientControlledTest
{
/** Used for debugging. */
private static final Logger log = Logger.getLogger(TestCase1DummyRun.class);
@@ -94,8 +94,10 @@
/**
* 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()
+ public void start(int numMessages)
{
log.debug("public void start(): called");
@@ -105,7 +107,7 @@
/**
* Gets a report on the actions performed by the test case in its assigned role.
*
- * @param session The session to create the report message in.
+ * @param session The controlSession to create the report message in.
*
* @return The report message.
*
@@ -113,7 +115,7 @@
*/
public Message getReport(Session session) throws JMSException
{
- log.debug("public Message getReport(Session session): called");
+ 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.");
Modified: incubator/qpid/branches/M2/java/integrationtests/src/main/java/org/apache/qpid/interop/clienttestcases/TestCase2BasicP2P.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2/java/integrationtests/src/main/java/org/apache/qpid/interop/clienttestcases/TestCase2BasicP2P.java?view=diff&rev=561855&r1=561854&r2=561855
==============================================================================
--- incubator/qpid/branches/M2/java/integrationtests/src/main/java/org/apache/qpid/interop/clienttestcases/TestCase2BasicP2P.java (original)
+++ incubator/qpid/branches/M2/java/integrationtests/src/main/java/org/apache/qpid/interop/clienttestcases/TestCase2BasicP2P.java Wed Aug 1 09:19:31 2007
@@ -22,9 +22,9 @@
import org.apache.log4j.Logger;
-import org.apache.qpid.test.framework.distributedtesting.InteropClientTestCase;
-import org.apache.qpid.test.framework.distributedtesting.TestClient;
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.*;
@@ -41,7 +41,7 @@
* <tr><td> Generate test reports.
* </table>
*/
-public class TestCase2BasicP2P implements InteropClientTestCase
+public class TestCase2BasicP2P implements TestClientControlledTest, MessageListener
{
/** Used for debugging. */
private static final Logger log = Logger.getLogger(TestCase2BasicP2P.class);
@@ -58,7 +58,7 @@
/** The connection to send the test messages on. */
private Connection connection;
- /** The session to send the test messages on. */
+ /** The controlSession to send the test messages on. */
private Session session;
/** The producer to send the test messages with. */
@@ -147,9 +147,11 @@
/**
* 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() throws JMSException
+ public void start(int numMessages) throws JMSException
{
log.debug("public void start(): called");
@@ -158,7 +160,7 @@
{
Message testMessage = session.createTextMessage("test");
- for (int i = 0; i < numMessages; i++)
+ for (int i = 0; i < this.numMessages; i++)
{
producer.send(testMessage);
@@ -171,7 +173,7 @@
/**
* Gets a report on the actions performed by the test case in its assigned role.
*
- * @param session The session to create the report message in.
+ * @param session The controlSession to create the report message in.
*
* @return The report message.
*
@@ -179,7 +181,7 @@
*/
public Message getReport(Session session) throws JMSException
{
- log.debug("public Message getReport(Session session): called");
+ log.debug("public Message getReport(Session controlSession): called");
// Close the test connection.
connection.close();
Modified: incubator/qpid/branches/M2/java/integrationtests/src/main/java/org/apache/qpid/interop/clienttestcases/TestCase3BasicPubSub.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2/java/integrationtests/src/main/java/org/apache/qpid/interop/clienttestcases/TestCase3BasicPubSub.java?view=diff&rev=561855&r1=561854&r2=561855
==============================================================================
--- incubator/qpid/branches/M2/java/integrationtests/src/main/java/org/apache/qpid/interop/clienttestcases/TestCase3BasicPubSub.java (original)
+++ incubator/qpid/branches/M2/java/integrationtests/src/main/java/org/apache/qpid/interop/clienttestcases/TestCase3BasicPubSub.java Wed Aug 1 09:19:31 2007
@@ -22,9 +22,9 @@
import org.apache.log4j.Logger;
-import org.apache.qpid.test.framework.distributedtesting.InteropClientTestCase;
-import org.apache.qpid.test.framework.distributedtesting.TestClient;
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.*;
@@ -42,7 +42,7 @@
* <tr><td> Generate test reports.
* </table>
*/
-public class TestCase3BasicPubSub implements InteropClientTestCase
+public class TestCase3BasicPubSub implements TestClientControlledTest, MessageListener
{
/** Used for debugging. */
private static final Logger log = Logger.getLogger(TestCase3BasicPubSub.class);
@@ -174,9 +174,11 @@
/**
* 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() throws JMSException
+ public void start(int numMessages) throws JMSException
{
log.debug("public void start(): called");
@@ -185,7 +187,7 @@
{
Message testMessage = session[0].createTextMessage("test");
- for (int i = 0; i < numMessages; i++)
+ for (int i = 0; i < this.numMessages; i++)
{
producer.send(testMessage);
@@ -198,7 +200,7 @@
/**
* Gets a report on the actions performed by the test case in its assigned role.
*
- * @param session The session to create the report message in.
+ * @param session The controlSession to create the report message in.
*
* @return The report message.
*
@@ -206,7 +208,7 @@
*/
public Message getReport(Session session) throws JMSException
{
- log.debug("public Message getReport(Session session): called");
+ log.debug("public Message getReport(Session controlSession): called");
// Close the test connections.
for (Connection conn : connection)
Modified: incubator/qpid/branches/M2/java/integrationtests/src/main/java/org/apache/qpid/interop/testcases/InteropTestCase1DummyRun.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2/java/integrationtests/src/main/java/org/apache/qpid/interop/testcases/InteropTestCase1DummyRun.java?view=diff&rev=561855&r1=561854&r2=561855
==============================================================================
--- incubator/qpid/branches/M2/java/integrationtests/src/main/java/org/apache/qpid/interop/testcases/InteropTestCase1DummyRun.java (original)
+++ incubator/qpid/branches/M2/java/integrationtests/src/main/java/org/apache/qpid/interop/testcases/InteropTestCase1DummyRun.java Wed Aug 1 09:19:31 2007
@@ -22,7 +22,7 @@
import org.apache.log4j.Logger;
-import org.apache.qpid.test.framework.distributedtesting.DistributedTestCase;
+import org.apache.qpid.test.framework.FrameworkBaseCase;
import java.util.Properties;
@@ -33,10 +33,10 @@
* <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 org.apache.qpid.test.framework.distributedtesting.DistributedTestCase}
+ * <td> {@link FrameworkBaseCase}
* </table>
*/
-public class InteropTestCase1DummyRun extends DistributedTestCase
+public class InteropTestCase1DummyRun extends FrameworkBaseCase
{
/** Used for debugging. */
private static final Logger log = Logger.getLogger(InteropTestCase1DummyRun.class);
@@ -63,7 +63,7 @@
Properties testConfig = new Properties();
testConfig.put("TEST_NAME", "TC1_DummyRun");
- /*Message[] reports =*/ getTestSequencer().sequenceTest(null, null, testConfig);
+ /*Message[] reports =*/ getCircuitFactory().sequenceTest(null, null, testConfig);
// Compare sender and receivers reports.
// Assert.assertEquals("Expected to get 2 dummy reports.", 2, reports.length);
Modified: incubator/qpid/branches/M2/java/integrationtests/src/main/java/org/apache/qpid/interop/testcases/InteropTestCase2BasicP2P.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2/java/integrationtests/src/main/java/org/apache/qpid/interop/testcases/InteropTestCase2BasicP2P.java?view=diff&rev=561855&r1=561854&r2=561855
==============================================================================
--- incubator/qpid/branches/M2/java/integrationtests/src/main/java/org/apache/qpid/interop/testcases/InteropTestCase2BasicP2P.java (original)
+++ incubator/qpid/branches/M2/java/integrationtests/src/main/java/org/apache/qpid/interop/testcases/InteropTestCase2BasicP2P.java Wed Aug 1 09:19:31 2007
@@ -22,7 +22,7 @@
import org.apache.log4j.Logger;
-import org.apache.qpid.test.framework.distributedtesting.DistributedTestCase;
+import org.apache.qpid.test.framework.FrameworkBaseCase;
import java.util.Properties;
@@ -33,10 +33,10 @@
*
* <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 DistributedTestCase}
+ * <tr><td> Setup p2p test parameters and compare with test output. <td> {@link FrameworkBaseCase}
* </table>
*/
-public class InteropTestCase2BasicP2P extends DistributedTestCase
+public class InteropTestCase2BasicP2P extends FrameworkBaseCase
{
/** Used for debugging. */
private static final Logger log = Logger.getLogger(InteropTestCase2BasicP2P.class);
@@ -65,7 +65,7 @@
testConfig.setProperty("P2P_QUEUE_AND_KEY_NAME", "tc2queue");
testConfig.put("P2P_NUM_MESSAGES", 50);
- /*Message[] reports =*/ getTestSequencer().sequenceTest(null, null, testConfig);
+ /*Message[] reports =*/ getCircuitFactory().sequenceTest(null, null, testConfig);
// Compare sender and receivers reports.
/*int messagesSent = reports[0].getIntProperty("MESSAGE_COUNT");
Modified: incubator/qpid/branches/M2/java/integrationtests/src/main/java/org/apache/qpid/interop/testcases/InteropTestCase3BasicPubSub.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2/java/integrationtests/src/main/java/org/apache/qpid/interop/testcases/InteropTestCase3BasicPubSub.java?view=diff&rev=561855&r1=561854&r2=561855
==============================================================================
--- incubator/qpid/branches/M2/java/integrationtests/src/main/java/org/apache/qpid/interop/testcases/InteropTestCase3BasicPubSub.java (original)
+++ incubator/qpid/branches/M2/java/integrationtests/src/main/java/org/apache/qpid/interop/testcases/InteropTestCase3BasicPubSub.java Wed Aug 1 09:19:31 2007
@@ -22,17 +22,17 @@
import org.apache.log4j.Logger;
-import org.apache.qpid.test.framework.distributedtesting.DistributedTestCase;
+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 DistributedTestCase}
+ * <tr><td> Setup pub/sub test parameters and compare with test output. <td> {@link FrameworkBaseCase}
* </table>
*/
-public class InteropTestCase3BasicPubSub extends DistributedTestCase
+public class InteropTestCase3BasicPubSub extends FrameworkBaseCase
{
/** Used for debugging. */
private static final Logger log = Logger.getLogger(InteropTestCase3BasicPubSub.class);
@@ -62,7 +62,7 @@
testConfig.put("PUBSUB_NUM_MESSAGES", 10);
testConfig.put("PUBSUB_NUM_RECEIVERS", 5);
- /*Message[] reports =*/ getTestSequencer().sequenceTest(null, null, testConfig);
+ /*Message[] reports =*/ getCircuitFactory().sequenceTest(null, null, testConfig);
// Compare sender and receivers reports.
/*int messagesSent = reports[0].getIntProperty("MESSAGE_COUNT");
Modified: incubator/qpid/branches/M2/java/integrationtests/src/main/java/org/apache/qpid/sustained/SustainedClientTestCase.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2/java/integrationtests/src/main/java/org/apache/qpid/sustained/SustainedClientTestCase.java?view=diff&rev=561855&r1=561854&r2=561855
==============================================================================
--- incubator/qpid/branches/M2/java/integrationtests/src/main/java/org/apache/qpid/sustained/SustainedClientTestCase.java (original)
+++ incubator/qpid/branches/M2/java/integrationtests/src/main/java/org/apache/qpid/sustained/SustainedClientTestCase.java Wed Aug 1 09:19:31 2007
@@ -57,7 +57,7 @@
* <tr><td> Send required number of test messages using pub/sub. <tr><td> Generate test reports.
* </table>
*/
-public class SustainedClientTestCase extends TestCase3BasicPubSub implements ExceptionListener
+public class SustainedClientTestCase extends TestCase3BasicPubSub implements ExceptionListener, MessageListener
{
/** Used for debugging. */
private static final Logger log = Logger.getLogger(SustainedClientTestCase.class);
@@ -205,8 +205,9 @@
}
}
- /** Performs the test case actions. */
- public void start() throws JMSException
+ /** Performs the test case actions.
+ * @param numMessages*/
+ public void start(int numMessages) throws JMSException
{
log.debug("public void start(): called");
@@ -235,7 +236,7 @@
/**
* Gets a report on the actions performed by the test case in its assigned role.
*
- * @param session The session to create the report message in.
+ * @param session The controlSession to create the report message in.
*
* @return The report message.
*
@@ -243,7 +244,7 @@
*/
public Message getReport(Session session) throws JMSException
{
- log.debug("public Message getReport(Session session): called");
+ log.debug("public Message getReport(Session controlSession): called");
// Close the test connections.
for (int i = 0; i < connection.length; i++)
@@ -318,7 +319,7 @@
* @param clientname The _client id used to identify this connection.
* @param batchSize The number of messages that are to be sent per batch. Note: This is not used to
* control the interval between sending reports.
- * @param session The session used for communication.
+ * @param session The controlSession used for communication.
* @param sendDestination The destination that update reports should be sent to.
*
* @throws JMSException My occur if creatingthe Producer fails
Modified: incubator/qpid/branches/M2/java/integrationtests/src/main/java/org/apache/qpid/sustained/SustainedTestCase.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2/java/integrationtests/src/main/java/org/apache/qpid/sustained/SustainedTestCase.java?view=diff&rev=561855&r1=561854&r2=561855
==============================================================================
--- incubator/qpid/branches/M2/java/integrationtests/src/main/java/org/apache/qpid/sustained/SustainedTestCase.java (original)
+++ incubator/qpid/branches/M2/java/integrationtests/src/main/java/org/apache/qpid/sustained/SustainedTestCase.java Wed Aug 1 09:19:31 2007
@@ -23,8 +23,8 @@
import org.apache.log4j.Logger;
import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.test.framework.distributedtesting.DistributedTestCase;
import org.apache.qpid.test.framework.DropInTest;
+import org.apache.qpid.test.framework.FrameworkBaseCase;
import javax.jms.JMSException;
import javax.jms.Message;
@@ -32,7 +32,7 @@
import java.util.Properties;
/**
- * SustainedTestCase is a {@link org.apache.qpid.test.framework.distributedtesting.DistributedTestCase} that runs the "Perf_SustainedPubSub" test case. This consists of one
+ * SustainedTestCase is a {@link FrameworkBaseCase} that runs the "Perf_SustainedPubSub" test case. This consists of one
* test client sending, and several receiving, and attempts to find the highest rate at which messages can be broadcast
* to the receivers. It is also a {@link DropInTest} to which more test clients may be added during a test run.
*
@@ -41,7 +41,7 @@
* <tr><td>
* </table>
*/
-public class SustainedTestCase extends DistributedTestCase implements DropInTest
+public class SustainedTestCase extends FrameworkBaseCase implements DropInTest
{
/** Used for debugging. */
Logger log = Logger.getLogger(SustainedTestCase.class);
@@ -78,7 +78,7 @@
log.info("Created Config: " + testConfig.entrySet().toArray());
- getTestSequencer().sequenceTest(null, null, testConfig);
+ getCircuitFactory().sequenceTest(null, null, testConfig);
}
/**
Modified: incubator/qpid/branches/M2/java/integrationtests/src/main/java/org/apache/qpid/test/framework/distributedtesting/TestClient.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2/java/integrationtests/src/main/java/org/apache/qpid/test/framework/distributedtesting/TestClient.java?view=diff&rev=561855&r1=561854&r2=561855
==============================================================================
--- incubator/qpid/branches/M2/java/integrationtests/src/main/java/org/apache/qpid/test/framework/distributedtesting/TestClient.java (original)
+++ incubator/qpid/branches/M2/java/integrationtests/src/main/java/org/apache/qpid/test/framework/distributedtesting/TestClient.java Wed Aug 1 09:19:31 2007
@@ -21,6 +21,7 @@
package org.apache.qpid.test.framework.distributedtesting;
import org.apache.log4j.Logger;
+import org.apache.log4j.NDC;
import org.apache.qpid.interop.clienttestcases.TestCase1DummyRun;
import org.apache.qpid.interop.clienttestcases.TestCase2BasicP2P;
@@ -28,17 +29,14 @@
import org.apache.qpid.sustained.SustainedClientTestCase;
import org.apache.qpid.test.framework.MessagingTestConfigProperties;
import org.apache.qpid.test.framework.TestUtils;
+import org.apache.qpid.test.framework.distributedcircuit.TestClientCircuitEnd;
import uk.co.thebadgerset.junit.extensions.util.ParsedProperties;
import uk.co.thebadgerset.junit.extensions.util.TestContextProperties;
import javax.jms.*;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
+import java.util.*;
/**
* Implements a test client as described in the interop testing spec
@@ -57,8 +55,8 @@
*
* <p><table id="crc"><caption>CRC Card</caption>
* <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Handle all incoming control messages. <td> {@link InteropClientTestCase}
- * <tr><td> Configure and look up test cases by name. <td> {@link InteropClientTestCase}
+ * <tr><td> Handle all incoming control messages. <td> {@link TestClientControlledTest}
+ * <tr><td> Configure and look up test cases by name. <td> {@link TestClientControlledTest}
* </table>
*/
public class TestClient implements MessageListener
@@ -86,10 +84,10 @@
TestContextProperties.getInstance(MessagingTestConfigProperties.defaults);
/** Holds all the test cases loaded from the classpath. */
- Map<String, InteropClientTestCase> testCases = new HashMap<String, InteropClientTestCase>();
+ Map<String, TestClientControlledTest> testCases = new HashMap<String, TestClientControlledTest>();
/** Holds the test case currently being run by this client. */
- protected InteropClientTestCase currentTestCase;
+ protected TestClientControlledTest currentTestCase;
/** Holds the connection to the broker that the test is being coordinated on. */
protected Connection connection;
@@ -97,7 +95,7 @@
/** Holds the message producer to hold the test coordination over. */
protected MessageProducer producer;
- /** Holds the JMS session for the test coordination. */
+ /** Holds the JMS controlSession for the test coordination. */
protected Session session;
/** Holds the name of this client, with a default value. */
@@ -113,11 +111,12 @@
* @param brokerUrl The url of the broker to connect to.
* @param virtualHost The virtual host to conect to.
* @param clientName The client name to use.
+ * @param join Flag to indicate that this client should attempt to join running tests.
*/
public TestClient(String brokerUrl, String virtualHost, String clientName, boolean join)
{
- log.debug("public SustainedTestClient(String brokerUrl = " + brokerUrl + ", String virtualHost = " + virtualHost
- + ", String clientName = " + clientName + "): called");
+ log.debug("public TestClient(String brokerUrl = " + brokerUrl + ", String virtualHost = " + virtualHost
+ + ", String clientName = " + clientName + ", boolean join = " + join + "): called");
// Retain the connection parameters.
this.brokerUrl = brokerUrl;
@@ -140,6 +139,9 @@
*/
public static void main(String[] args)
{
+ log.debug("public static void main(String[] args = " + Arrays.toString(args) + "): called");
+ console.info("Qpid Distributed Test Client.");
+
// Override the default broker url to be localhost:5672.
testContextProperties.setProperty(MessagingTestConfigProperties.BROKER_PROPNAME, "tcp://localhost:5672");
@@ -163,18 +165,22 @@
String brokerUrl = options.getProperty("b");
String virtualHost = options.getProperty("h");
String clientName = options.getProperty("n");
+ clientName = (clientName == null) ? CLIENT_NAME : clientName;
boolean join = options.getPropertyAsBoolean("j");
+ // To distinguish logging output set up an NDC on the client name.
+ NDC.push(clientName);
+
// Create a test client and start it running.
- TestClient client = new TestClient(brokerUrl, virtualHost, (clientName == null) ? CLIENT_NAME : clientName, join);
+ TestClient client = new TestClient(brokerUrl, virtualHost, clientName, join);
// Use a class path scanner to find all the interop test case implementations.
// Hard code the test classes till the classpath scanner is fixed.
- Collection<Class<? extends InteropClientTestCase>> testCaseClasses =
- new ArrayList<Class<? extends InteropClientTestCase>>();
- // ClasspathScanner.getMatches(InteropClientTestCase.class, "^TestCase.*", true);
+ Collection<Class<? extends TestClientControlledTest>> testCaseClasses =
+ new ArrayList<Class<? extends TestClientControlledTest>>();
+ // ClasspathScanner.getMatches(TestClientControlledTest.class, "^TestCase.*", true);
Collections.addAll(testCaseClasses, TestCase1DummyRun.class, TestCase2BasicP2P.class, TestCase3BasicPubSub.class,
- SustainedClientTestCase.class);
+ SustainedClientTestCase.class, TestClientCircuitEnd.class);
try
{
@@ -183,6 +189,7 @@
catch (Exception e)
{
log.error("The test client was unable to start.", e);
+ console.info(e.getMessage());
System.exit(1);
}
}
@@ -195,16 +202,17 @@
*
* @throws JMSException Any underlying JMSExceptions are allowed to fall through.
*/
- protected void start(Collection<Class<? extends InteropClientTestCase>> testCaseClasses) throws JMSException
+ protected void start(Collection<Class<? extends TestClientControlledTest>> testCaseClasses) throws JMSException
{
- log.debug("private void start(): called");
+ log.debug("protected void start(Collection<Class<? extends TestClientControlledTest>> testCaseClasses = "
+ + testCaseClasses + "): called");
// Create all the test case implementations and index them by the test names.
- for (Class<? extends InteropClientTestCase> nextClass : testCaseClasses)
+ for (Class<? extends TestClientControlledTest> nextClass : testCaseClasses)
{
try
{
- InteropClientTestCase testCase = nextClass.newInstance();
+ TestClientControlledTest testCase = nextClass.newInstance();
testCases.put(testCase.getName(), testCase);
}
catch (InstantiationException e)
@@ -259,6 +267,7 @@
*/
public void onMessage(Message message)
{
+ NDC.push(clientName);
log.debug("public void onMessage(Message message = " + message + "): called");
try
@@ -266,7 +275,7 @@
String controlType = message.getStringProperty("CONTROL_TYPE");
String testName = message.getStringProperty("TEST_NAME");
- log.info("onMessage(Message message = " + message + "): for '" + controlType + "' to '" + testName + "'");
+ log.debug("Received control of type '" + controlType + "' for the test '" + testName + "'");
// Check if the message is a test invite.
if ("INVITE".equals(controlType))
@@ -280,13 +289,21 @@
log.debug("Got an invite to test: " + testName);
// Check if the requested test case is available.
- InteropClientTestCase testCase = testCases.get(testName);
+ TestClientControlledTest testCase = testCases.get(testName);
if (testCase != null)
{
+ log.debug("Found implementing class for test '" + testName + "', enlisting for it.");
+
+ // Check if the test case will accept the invitation.
+ enlist = testCase.acceptInvite(message);
+
+ log.debug("The test case "
+ + (enlist ? " accepted the invite, enlisting for it."
+ : " did not accept the invite, not enlisting."));
+
// Make the requested test case the current test case.
currentTestCase = testCase;
- enlist = true;
}
else
{
@@ -295,7 +312,7 @@
}
else
{
- log.debug("Got a compulsory invite.");
+ log.debug("Got a compulsory invite, enlisting for it.");
enlist = true;
}
@@ -309,7 +326,20 @@
enlistMessage.setStringProperty("CLIENT_PRIVATE_CONTROL_KEY", "iop.control." + clientName);
enlistMessage.setJMSCorrelationID(message.getJMSCorrelationID());
- log.info("Sending Message '" + enlistMessage + "'. to " + message.getJMSReplyTo());
+ log.debug("Sending enlist message '" + enlistMessage + "' to " + message.getJMSReplyTo());
+
+ producer.send(message.getJMSReplyTo(), enlistMessage);
+ }
+ else
+ {
+ // Reply with the client name in an Decline message.
+ Message enlistMessage = session.createMessage();
+ enlistMessage.setStringProperty("CONTROL_TYPE", "DECLINE");
+ enlistMessage.setStringProperty("CLIENT_NAME", clientName);
+ enlistMessage.setStringProperty("CLIENT_PRIVATE_CONTROL_KEY", "iop.control." + clientName);
+ enlistMessage.setJMSCorrelationID(message.getJMSCorrelationID());
+
+ log.debug("Sending decline message '" + enlistMessage + "' to " + message.getJMSReplyTo());
producer.send(message.getJMSReplyTo(), enlistMessage);
}
@@ -321,15 +351,18 @@
log.debug("Got a role assignment to role: " + roleName);
- InteropClientTestCase.Roles role = Enum.valueOf(InteropClientTestCase.Roles.class, roleName);
+ TestClientControlledTest.Roles role = Enum.valueOf(TestClientControlledTest.Roles.class, roleName);
currentTestCase.assignRole(role, message);
// Reply by accepting the role in an Accept Role message.
Message acceptRoleMessage = session.createMessage();
+ acceptRoleMessage.setStringProperty("CLIENT_NAME", clientName);
acceptRoleMessage.setStringProperty("CONTROL_TYPE", "ACCEPT_ROLE");
acceptRoleMessage.setJMSCorrelationID(message.getJMSCorrelationID());
+ log.debug("Sending accept role message '" + acceptRoleMessage + "' to " + message.getJMSReplyTo());
+
producer.send(message.getJMSReplyTo(), acceptRoleMessage);
}
else if ("START".equals(controlType) || "STATUS_REQUEST".equals(controlType))
@@ -338,8 +371,21 @@
{
log.debug("Got a start notification.");
+ // Extract the number of test messages to send from the start notification.
+ int numMessages;
+
+ try
+ {
+ numMessages = message.getIntProperty("MESSAGE_COUNT");
+ }
+ catch (JMSException e)
+ {
+ // If the number of messages is not specified, use the default of one.
+ numMessages = 1;
+ }
+
// Start the current test case.
- currentTestCase.start();
+ currentTestCase.start(numMessages);
}
else
{
@@ -348,9 +394,12 @@
// Generate the report from the test case and reply with it as a Report message.
Message reportMessage = currentTestCase.getReport(session);
+ reportMessage.setStringProperty("CLIENT_NAME", clientName);
reportMessage.setStringProperty("CONTROL_TYPE", "REPORT");
reportMessage.setJMSCorrelationID(message.getJMSCorrelationID());
+ log.debug("Sending report message '" + reportMessage + "' to " + message.getJMSReplyTo());
+
producer.send(message.getJMSReplyTo(), reportMessage);
}
else if ("TERMINATE".equals(controlType))
@@ -370,8 +419,18 @@
catch (JMSException e)
{
// Log a warning about this, but otherwise ignore it.
- log.warn("A JMSException occurred whilst handling a message.");
- log.debug("Got JMSException whilst handling message: " + message, e);
+ log.warn("Got JMSException whilst handling message: " + message, e);
+ }
+ // Log any runtimes that fall through this message handler. These are fatal errors for the test client.
+ catch (RuntimeException e)
+ {
+ log.error("The test client message handler got an unhandled exception: ", e);
+ console.info("The message handler got an unhandled exception, terminating the test client.");
+ System.exit(1);
+ }
+ finally
+ {
+ NDC.pop();
}
}
}
Modified: incubator/qpid/branches/M2/java/perftests/jar-with-dependencies.xml
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2/java/perftests/jar-with-dependencies.xml?view=diff&rev=561855&r1=561854&r2=561855
==============================================================================
--- incubator/qpid/branches/M2/java/perftests/jar-with-dependencies.xml (original)
+++ incubator/qpid/branches/M2/java/perftests/jar-with-dependencies.xml Wed Aug 1 09:19:31 2007
@@ -16,32 +16,51 @@
specific language governing permissions and limitations
under the License.
-->
-<!-- This is an assembly descriptor that produces a jar file that contains all the
- dependencies, fully expanded into a single jar, required to run the tests of
- a maven project.
- -->
+<!-- This is an assembly descriptor that produces a distribution that contains all the
+ dependencies, with a manifest only jar that references them, required to run the
+ tests of a maven project.
+-->
<assembly>
- <id>all-test-deps</id>
- <formats>
- <format>jar</format>
- </formats>
- <includeBaseDirectory>false</includeBaseDirectory>
- <dependencySets>
- <dependencySet>
- <outputDirectory></outputDirectory>
- <outputFileNameMapping></outputFileNameMapping>
- <unpack>true</unpack>
- <scope>test</scope>
- </dependencySet>
- </dependencySets>
- <fileSets>
- <fileSet>
- <directory>target/classes</directory>
- <outputDirectory></outputDirectory>
- </fileSet>
- <fileSet>
- <directory>target/test-classes</directory>
- <outputDirectory></outputDirectory>
- </fileSet>
- </fileSets>
+ <id>all-test-deps</id>
+ <formats>
+ <format>tar.gz</format>
+ <format>zip</format>
+ </formats>
+ <includeBaseDirectory>false</includeBaseDirectory>
+ <dependencySets>
+ <dependencySet>
+ <outputDirectory>/</outputDirectory>
+ <unpack>false</unpack>
+ <scope>test</scope>
+ </dependencySet>
+ </dependencySets>
+ <fileSets>
+ <fileSet>
+ <directory>target/classes</directory>
+ <outputDirectory></outputDirectory>
+ </fileSet>
+ <fileSet>
+ <directory>target/test-classes</directory>
+ <outputDirectory></outputDirectory>
+ </fileSet>
+
+ <!-- Include the build artifact. -->
+ <fileSet>
+ <directory>target</directory>
+ <outputDirectory></outputDirectory>
+ <includes>
+ <include>qpid-perftests-1.0-incubating-M2-SNAPSHOT.jar</include>
+ </includes>
+ </fileSet>
+
+ <!-- Include the classpath only jar. -->
+ <fileSet>
+ <directory>target</directory>
+ <outputDirectory></outputDirectory>
+ <includes>
+ <include>qpid-perftests-1.0-incubating-M2-SNAPSHOT-tests.jar</include>
+ </includes>
+ </fileSet>
+
+ </fileSets>
</assembly>
Modified: incubator/qpid/branches/M2/java/perftests/pom.xml
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2/java/perftests/pom.xml?view=diff&rev=561855&r1=561854&r2=561855
==============================================================================
--- incubator/qpid/branches/M2/java/perftests/pom.xml (original)
+++ incubator/qpid/branches/M2/java/perftests/pom.xml Wed Aug 1 09:19:31 2007
@@ -72,6 +72,11 @@
</dependency>
<dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-systests</artifactId>
+ </dependency>
+
+ <dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</dependency>
@@ -85,9 +90,10 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
+ <scope>compile</scope>
</dependency>
- <dependency>
+ <dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.4.0</version>
@@ -354,11 +360,32 @@
<configuration>
<descriptors>
<descriptor>jar-with-dependencies.xml</descriptor>
- <descriptor>dist-zip.xml</descriptor>
+ <!--<descriptor>dist-zip.xml</descriptor>-->
</descriptors>
<outputDirectory>target</outputDirectory>
<workDirectory>target/assembly/work</workDirectory>
</configuration>
+ </plugin>
+
+ <!-- Build a manifest only jar with all the required jars for the broker in its classpath. -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>test_jar</id>
+ <configuration>
+ <archive>
+ <manifest>
+ <addClasspath>true</addClasspath>
+ </manifest>
+ </archive>
+ </configuration>
+ <goals>
+ <goal>test-jar</goal>
+ </goals>
+ </execution>
+ </executions>
</plugin>
</plugins>
Modified: incubator/qpid/branches/M2/java/perftests/src/main/java/org/apache/qpid/requestreply/PingPongBouncer.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2/java/perftests/src/main/java/org/apache/qpid/requestreply/PingPongBouncer.java?view=diff&rev=561855&r1=561854&r2=561855
==============================================================================
--- incubator/qpid/branches/M2/java/perftests/src/main/java/org/apache/qpid/requestreply/PingPongBouncer.java (original)
+++ incubator/qpid/branches/M2/java/perftests/src/main/java/org/apache/qpid/requestreply/PingPongBouncer.java Wed Aug 1 09:19:31 2007
@@ -92,10 +92,10 @@
/** The producer for sending replies with. */
private MessageProducer _replyProducer;
- /** The consumer session. */
+ /** The consumer controlSession. */
private Session _consumerSession;
- /** The producer session. */
+ /** The producer controlSession. */
private Session _producerSession;
/** Holds the connection to the broker. */
@@ -149,7 +149,7 @@
// Set up the failover notifier.
getConnection().setConnectionListener(new FailoverNotifier());
- // Create a session to listen for messages on and one to send replies on, transactional depending on the
+ // Create a controlSession to listen for messages on and one to send replies on, transactional depending on the
// command line option.
_consumerSession = (Session) getConnection().createSession(transacted, Session.AUTO_ACKNOWLEDGE);
_producerSession = (Session) getConnection().createSession(transacted, Session.AUTO_ACKNOWLEDGE);
@@ -323,8 +323,8 @@
}
/**
- * Convenience method to commit the transaction on the specified session. If the session to commit on is not
- * a transactional session, this method does nothing.
+ * Convenience method to commit the transaction on the specified controlSession. If the controlSession to commit on is not
+ * a transactional controlSession, this method does nothing.
*
* <p/>If the {@link #_failBeforeCommit} flag is set, this will prompt the user to kill the broker before the
* commit is applied. If the {@link #_failAfterCommit} flag is set, this will prompt the user to kill the broker
Modified: incubator/qpid/branches/M2/java/perftests/src/main/java/org/apache/qpid/requestreply/PingPongProducer.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2/java/perftests/src/main/java/org/apache/qpid/requestreply/PingPongProducer.java?view=diff&rev=561855&r1=561854&r2=561855
==============================================================================
--- incubator/qpid/branches/M2/java/perftests/src/main/java/org/apache/qpid/requestreply/PingPongProducer.java (original)
+++ incubator/qpid/branches/M2/java/perftests/src/main/java/org/apache/qpid/requestreply/PingPongProducer.java Wed Aug 1 09:19:31 2007
@@ -395,10 +395,10 @@
/** Holds the connection to the broker. */
protected Connection _connection;
- /** Holds the session on which ping replies are received. */
+ /** Holds the controlSession on which ping replies are received. */
protected Session _consumerSession;
- /** Holds the producer session, needed to create ping messages. */
+ /** Holds the producer controlSession, needed to create ping messages. */
protected Session _producerSession;
/** Holds the destination where the response messages will arrive. */
@@ -1305,8 +1305,8 @@
}
/**
- * Convenience method to commit the transaction on the specified session. If the session to commit on is not a
- * transactional session, this method does nothing (unless the failover after send flag is set).
+ * Convenience method to commit the transaction on the specified controlSession. If the controlSession to commit on is not a
+ * transactional controlSession, this method does nothing (unless the failover after send flag is set).
*
* <p/>If the {@link #_failAfterSend} flag is set, this will prompt the user to kill the broker before the commit is
* applied. This flag applies whether the pinger is transactional or not.
@@ -1315,9 +1315,9 @@
* is applied. If the {@link #_failAfterCommit} flag is set, this will prompt the user to kill the broker after the
* commit is applied. These flags will only apply if using a transactional pinger.
*
- * @param session The session to commit
+ * @param session The controlSession to commit
*
- * @return <tt>true</tt> if the session was committed, <tt>false</tt> if it was not.
+ * @return <tt>true</tt> if the controlSession was committed, <tt>false</tt> if it was not.
*
* @throws javax.jms.JMSException If the commit fails and then the rollback fails.
*
@@ -1327,7 +1327,7 @@
*/
protected boolean commitTx(Session session) throws JMSException
{
- // log.debug("protected void commitTx(Session session): called");
+ // log.debug("protected void commitTx(Session controlSession): called");
boolean committed = false;
Added: incubator/qpid/branches/M2/java/perftests/src/test/java/org/apache/qpid/perftests/QpidTestThroughputPerf.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2/java/perftests/src/test/java/org/apache/qpid/perftests/QpidTestThroughputPerf.java?view=auto&rev=561855
==============================================================================
--- incubator/qpid/branches/M2/java/perftests/src/test/java/org/apache/qpid/perftests/QpidTestThroughputPerf.java (added)
+++ incubator/qpid/branches/M2/java/perftests/src/test/java/org/apache/qpid/perftests/QpidTestThroughputPerf.java Wed Aug 1 09:19:31 2007
@@ -0,0 +1,170 @@
+/*
+ *
+ * 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.perftests;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.log4j.Logger;
+
+import org.apache.qpid.test.framework.Assertion;
+import org.apache.qpid.test.framework.Circuit;
+import org.apache.qpid.test.framework.FrameworkBaseCase;
+import org.apache.qpid.test.framework.MessagingTestConfigProperties;
+import org.apache.qpid.test.framework.sequencers.CircuitFactory;
+
+import uk.co.thebadgerset.junit.extensions.TestThreadAware;
+import uk.co.thebadgerset.junit.extensions.TimingController;
+import uk.co.thebadgerset.junit.extensions.TimingControllerAware;
+import uk.co.thebadgerset.junit.extensions.util.ParsedProperties;
+import uk.co.thebadgerset.junit.extensions.util.TestContextProperties;
+
+import java.util.LinkedList;
+
+/**
+ * QpidTestThroughputPerf runs a test over a {@link Circuit} controlled by the test parameters. It logs timings of
+ * the time required to receive samples consisting of batches of messages. As the time samples is taken over a reasonable
+ * sized message batch, it measures message throughput.
+ *
+ * <p/><table id="crc"><caption>CRC Card</caption>
+ * <tr><th> Responsibilities <th> Collaborations
+ * <tr><td>
+ * </table>
+ *
+ * @todo Check that all of the messages were sent. Check that the receiving end got the same number of messages as
+ * the publishing end.
+ */
+public class QpidTestThroughputPerf extends FrameworkBaseCase implements TimingControllerAware, TestThreadAware
+{
+ /** Used for debugging. */
+ private static final Logger log = Logger.getLogger(QpidTestThroughputPerf.class);
+
+ /** Holds the timing controller, used to log test timings from self-timed tests. */
+ private TimingController timingController;
+
+ /** Thread local to hold the per-thread test setup fields. */
+ ThreadLocal<PerThreadSetup> threadSetup = new ThreadLocal<PerThreadSetup>();
+
+ /**
+ * Creates a new test case with the specified name.
+ *
+ * @param name The test case name.
+ */
+ public QpidTestThroughputPerf(String name)
+ {
+ super(name);
+ }
+
+ /**
+ * Performs the a basic P2P test case.
+ *
+ * @param numMessages The number of messages to send in the test.
+ */
+ public void testThroughput(int numMessages)
+ {
+ log.debug("public void testThroughput(): called");
+
+ PerThreadSetup setup = threadSetup.get();
+ assertNoFailures(setup.testCircuit.test(numMessages, new LinkedList<Assertion>()));
+ }
+
+ /**
+ * Should provide a translation from the junit method name of a test to its test case name as known to the test
+ * clients that will run the test. The purpose of this is to convert the JUnit method name into the correct test
+ * case name to place into the test invite. 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)
+ {
+ log.debug("public String getTestCaseNameForTestMethod(String methodName = " + methodName + "): called");
+
+ return "DEFAULT_CIRCUIT_TEST";
+ }
+
+ /**
+ * Used by test runners that can supply a {@link uk.co.thebadgerset.junit.extensions.TimingController} to set the
+ * controller on an aware test.
+ *
+ * @param controller The timing controller.
+ */
+ public void setTimingController(TimingController controller)
+ {
+ timingController = controller;
+ }
+
+ /**
+ * Performs test fixture creation on a per thread basis. This will only be called once for each test thread.
+ */
+ public void threadSetUp()
+ {
+ // Get the test parameters, any overrides on the command line will have been applied.
+ ParsedProperties testProps = TestContextProperties.getInstance(MessagingTestConfigProperties.defaults);
+
+ // Customize the test parameters.
+ testProps.setProperty("TEST_NAME", "DEFAULT_CIRCUIT_TEST");
+ testProps.setProperty(MessagingTestConfigProperties.SEND_DESTINATION_NAME_ROOT_PROPNAME, "testqueue");
+
+ // Get the test circuit factory to create test circuits and run the standard test procedure through.
+ CircuitFactory circuitFactory = getCircuitFactory();
+
+ // Create the test circuit. This projects the circuit onto the available test nodes and connects it up.
+ Circuit testCircuit = circuitFactory.createCircuit(testProps);
+
+ // Store the test configuration for the thread.
+ PerThreadSetup setup = new PerThreadSetup();
+ setup.testCircuit = testCircuit;
+ threadSetup.set(setup);
+ }
+
+ /**
+ * Called when a test thread is destroyed.
+ */
+ public void threadTearDown()
+ { }
+
+ /**
+ * Holds the per-thread test configurations.
+ */
+ protected static class PerThreadSetup
+ {
+ /** Holds the test circuit to run tests on. */
+ Circuit testCircuit;
+ }
+
+ /**
+ * Compiles all the tests in this class into a suite.
+ *
+ * @return The test suite.
+ */
+ public static Test suite()
+ {
+ // Build a new test suite
+ TestSuite suite = new TestSuite("Qpid Throughput Performance Tests");
+
+ suite.addTest(new QpidTestThroughputPerf("testThroughput"));
+
+ return suite;
+ }
+}
Added: incubator/qpid/branches/M2/java/systests/etc/bin/testclients.sh
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2/java/systests/etc/bin/testclients.sh?view=auto&rev=561855
==============================================================================
--- incubator/qpid/branches/M2/java/systests/etc/bin/testclients.sh (added)
+++ incubator/qpid/branches/M2/java/systests/etc/bin/testclients.sh Wed Aug 1 09:19:31 2007
@@ -0,0 +1,23 @@
+#!/bin/bash
+#
+# 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.
+#
+for x in `seq 1 $1`;
+do
+ java -cp qpid-integrationtests-1.0-incubating-M2-SNAPSHOT-all-test-deps.jar -Dlog4j.configuration=file:/home/rupert/qpid/trunk/qpid/java/etc/mylog4j.xml org.apache.qpid.test.framework.distributedtesting.TestClient -n $x &
+done
Modified: incubator/qpid/branches/M2/java/systests/src/main/java/org/apache/qpid/server/exchange/ImmediateMessageTest.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2/java/systests/src/main/java/org/apache/qpid/server/exchange/ImmediateMessageTest.java?view=diff&rev=561855&r1=561854&r2=561855
==============================================================================
--- incubator/qpid/branches/M2/java/systests/src/main/java/org/apache/qpid/server/exchange/ImmediateMessageTest.java (original)
+++ incubator/qpid/branches/M2/java/systests/src/main/java/org/apache/qpid/server/exchange/ImmediateMessageTest.java Wed Aug 1 09:19:31 2007
@@ -20,11 +20,11 @@
*/
package org.apache.qpid.server.exchange;
-import org.apache.qpid.test.framework.sequencers.TestCaseSequencer;
import org.apache.qpid.test.framework.Circuit;
import org.apache.qpid.test.framework.FrameworkBaseCase;
import org.apache.qpid.test.framework.MessagingTestConfigProperties;
import static org.apache.qpid.test.framework.MessagingTestConfigProperties.*;
+import org.apache.qpid.test.framework.sequencers.CircuitFactory;
import uk.co.thebadgerset.junit.extensions.util.ParsedProperties;
import uk.co.thebadgerset.junit.extensions.util.TestContextProperties;
@@ -85,9 +85,10 @@
testProps.setProperty(PUBSUB_PROPNAME, false);
// Run the default test sequence over the test circuit checking for no errors.
- TestCaseSequencer sequencer = getTestSequencer();
- Circuit testCircuit = sequencer.createCircuit(testProps);
- sequencer.sequenceTest(testCircuit, assertionList(testCircuit.getPublisher().noExceptionsAssertion()), testProps);
+ CircuitFactory circuitFactory = getCircuitFactory();
+ Circuit testCircuit = circuitFactory.createCircuit(testProps);
+
+ assertNoFailures(testCircuit.test(1, assertionList(testCircuit.getPublisher().noExceptionsAssertion())));
}
/** Check that an immediate message is committed succesfully in a transaction when a consumer is connected. */
@@ -98,43 +99,44 @@
testProps.setProperty(PUBSUB_PROPNAME, false);
// Send one message with no errors.
- TestCaseSequencer sequencer = getTestSequencer();
- Circuit testCircuit = sequencer.createCircuit(testProps);
- sequencer.sequenceTest(testCircuit, assertionList(testCircuit.getPublisher().noExceptionsAssertion()), testProps);
+ CircuitFactory circuitFactory = getCircuitFactory();
+ Circuit testCircuit = circuitFactory.createCircuit(testProps);
+
+ assertNoFailures(testCircuit.test(1, assertionList(testCircuit.getPublisher().noExceptionsAssertion())));
}
/** Check that an immediate message results in no consumers code, not using transactions, when a consumer is disconnected. */
- public void test_QPID_517_ImmediateFailsConsumerDisconnectedNoTxP2P() throws Exception
+ public void test_QPID_517_ImmediateFailsConsumerDisconnectedNoTxP2P()
{
// Ensure transactional sessions are off.
testProps.setProperty(TRANSACTED_PROPNAME, false);
testProps.setProperty(PUBSUB_PROPNAME, false);
- TestCaseSequencer sequencer = getTestSequencer();
- Circuit testCircuit = sequencer.createCircuit(testProps);
-
// Disconnect the consumer.
- testCircuit.getReceiver().getConsumer().close();
+ testProps.setProperty(RECEIVER_CONSUMER_ACTIVE_PROPNAME, false);
+
+ CircuitFactory circuitFactory = getCircuitFactory();
+ Circuit testCircuit = circuitFactory.createCircuit(testProps);
// Send one message and get a linked no consumers exception.
- sequencer.sequenceTest(testCircuit, assertionList(testCircuit.getPublisher().noConsumersAssertion()), testProps);
+ assertNoFailures(testCircuit.test(1, assertionList(testCircuit.getPublisher().noConsumersAssertion())));
}
/** Check that an immediate message results in no consumers code, in a transaction, when a consumer is disconnected. */
- public void test_QPID_517_ImmediateFailsConsumerDisconnectedTxP2P() throws Exception
+ public void test_QPID_517_ImmediateFailsConsumerDisconnectedTxP2P()
{
// Ensure transactional sessions are on.
testProps.setProperty(TRANSACTED_PROPNAME, true);
testProps.setProperty(PUBSUB_PROPNAME, false);
- TestCaseSequencer sequencer = getTestSequencer();
- Circuit testCircuit = sequencer.createCircuit(testProps);
-
// Disconnect the consumer.
- testCircuit.getReceiver().getConsumer().close();
+ testProps.setProperty(RECEIVER_CONSUMER_ACTIVE_PROPNAME, false);
+
+ CircuitFactory circuitFactory = getCircuitFactory();
+ Circuit testCircuit = circuitFactory.createCircuit(testProps);
// Send one message and get a linked no consumers exception.
- sequencer.sequenceTest(testCircuit, assertionList(testCircuit.getPublisher().noConsumersAssertion()), testProps);
+ assertNoFailures(testCircuit.test(1, assertionList(testCircuit.getPublisher().noConsumersAssertion())));
}
/** Check that an immediate message results in no route code, not using transactions, when no outgoing route is connected. */
@@ -149,9 +151,10 @@
testProps.setProperty(RECEIVER_CONSUMER_BIND_PROPNAME, false);
// Send one message and get a linked no route exception.
- TestCaseSequencer sequencer = getTestSequencer();
- Circuit testCircuit = sequencer.createCircuit(testProps);
- sequencer.sequenceTest(testCircuit, assertionList(testCircuit.getPublisher().noRouteAssertion()), testProps);
+ CircuitFactory circuitFactory = getCircuitFactory();
+ Circuit testCircuit = circuitFactory.createCircuit(testProps);
+
+ assertNoFailures(testCircuit.test(1, assertionList(testCircuit.getPublisher().noRouteAssertion())));
}
/** Check that an immediate message results in no route code, upon transaction commit, when no outgoing route is connected. */
@@ -166,9 +169,10 @@
testProps.setProperty(RECEIVER_CONSUMER_BIND_PROPNAME, false);
// Send one message and get a linked no route exception.
- TestCaseSequencer sequencer = getTestSequencer();
- Circuit testCircuit = sequencer.createCircuit(testProps);
- sequencer.sequenceTest(testCircuit, assertionList(testCircuit.getPublisher().noRouteAssertion()), testProps);
+ CircuitFactory circuitFactory = getCircuitFactory();
+ Circuit testCircuit = circuitFactory.createCircuit(testProps);
+
+ assertNoFailures(testCircuit.test(1, assertionList(testCircuit.getPublisher().noRouteAssertion())));
}
/** Check that an immediate message is sent succesfully not using transactions when a consumer is connected. */
@@ -179,9 +183,10 @@
testProps.setProperty(PUBSUB_PROPNAME, true);
// Send one message with no errors.
- TestCaseSequencer sequencer = getTestSequencer();
- Circuit testCircuit = sequencer.createCircuit(testProps);
- sequencer.sequenceTest(testCircuit, assertionList(testCircuit.getPublisher().noExceptionsAssertion()), testProps);
+ CircuitFactory circuitFactory = getCircuitFactory();
+ Circuit testCircuit = circuitFactory.createCircuit(testProps);
+
+ assertNoFailures(testCircuit.test(1, assertionList(testCircuit.getPublisher().noExceptionsAssertion())));
}
/** Check that an immediate message is committed succesfully in a transaction when a consumer is connected. */
@@ -192,13 +197,14 @@
testProps.setProperty(PUBSUB_PROPNAME, true);
// Send one message with no errors.
- TestCaseSequencer sequencer = getTestSequencer();
- Circuit testCircuit = sequencer.createCircuit(testProps);
- sequencer.sequenceTest(testCircuit, assertionList(testCircuit.getPublisher().noExceptionsAssertion()), testProps);
+ CircuitFactory circuitFactory = getCircuitFactory();
+ Circuit testCircuit = circuitFactory.createCircuit(testProps);
+
+ assertNoFailures(testCircuit.test(1, assertionList(testCircuit.getPublisher().noExceptionsAssertion())));
}
/** Check that an immediate message results in no consumers code, not using transactions, when a consumer is disconnected. */
- public void test_QPID_517_ImmediateFailsConsumerDisconnectedNoTxPubSub() throws Exception
+ public void test_QPID_517_ImmediateFailsConsumerDisconnectedNoTxPubSub()
{
// Ensure transactional sessions are off.
testProps.setProperty(TRANSACTED_PROPNAME, false);
@@ -207,18 +213,18 @@
// Use durable subscriptions, so that the route remains open with no subscribers.
testProps.setProperty(DURABLE_SUBSCRIPTION_PROPNAME, true);
- TestCaseSequencer sequencer = getTestSequencer();
- Circuit testCircuit = sequencer.createCircuit(testProps);
-
// Disconnect the consumer.
- testCircuit.getReceiver().getConsumer().close();
+ testProps.setProperty(RECEIVER_CONSUMER_ACTIVE_PROPNAME, false);
+
+ CircuitFactory circuitFactory = getCircuitFactory();
+ Circuit testCircuit = circuitFactory.createCircuit(testProps);
// Send one message and get a linked no consumers exception.
- sequencer.sequenceTest(testCircuit, assertionList(testCircuit.getPublisher().noConsumersAssertion()), testProps);
+ assertNoFailures(testCircuit.test(1, assertionList(testCircuit.getPublisher().noConsumersAssertion())));
}
/** Check that an immediate message results in no consumers code, in a transaction, when a consumer is disconnected. */
- public void test_QPID_517_ImmediateFailsConsumerDisconnectedTxPubSub() throws Exception
+ public void test_QPID_517_ImmediateFailsConsumerDisconnectedTxPubSub()
{
// Ensure transactional sessions are on.
testProps.setProperty(TRANSACTED_PROPNAME, true);
@@ -227,14 +233,14 @@
// Use durable subscriptions, so that the route remains open with no subscribers.
testProps.setProperty(DURABLE_SUBSCRIPTION_PROPNAME, true);
- TestCaseSequencer sequencer = getTestSequencer();
- Circuit testCircuit = sequencer.createCircuit(testProps);
-
// Disconnect the consumer.
- testCircuit.getReceiver().getConsumer().close();
+ testProps.setProperty(RECEIVER_CONSUMER_ACTIVE_PROPNAME, false);
+
+ CircuitFactory circuitFactory = getCircuitFactory();
+ Circuit testCircuit = circuitFactory.createCircuit(testProps);
// Send one message and get a linked no consumers exception.
- sequencer.sequenceTest(testCircuit, assertionList(testCircuit.getPublisher().noConsumersAssertion()), testProps);
+ assertNoFailures(testCircuit.test(1, assertionList(testCircuit.getPublisher().noConsumersAssertion())));
}
/** Check that an immediate message results in no route code, not using transactions, when no outgoing route is connected. */
@@ -249,9 +255,10 @@
testProps.setProperty(RECEIVER_CONSUMER_BIND_PROPNAME, false);
// Send one message and get a linked no route exception.
- TestCaseSequencer sequencer = getTestSequencer();
- Circuit testCircuit = sequencer.createCircuit(testProps);
- sequencer.sequenceTest(testCircuit, assertionList(testCircuit.getPublisher().noRouteAssertion()), testProps);
+ CircuitFactory circuitFactory = getCircuitFactory();
+ Circuit testCircuit = circuitFactory.createCircuit(testProps);
+
+ assertNoFailures(testCircuit.test(1, assertionList(testCircuit.getPublisher().noRouteAssertion())));
}
/** Check that an immediate message results in no route code, upon transaction commit, when no outgoing route is connected. */
@@ -266,9 +273,10 @@
testProps.setProperty(RECEIVER_CONSUMER_BIND_PROPNAME, false);
// Send one message and get a linked no route exception.
- TestCaseSequencer sequencer = getTestSequencer();
- Circuit testCircuit = sequencer.createCircuit(testProps);
- sequencer.sequenceTest(testCircuit, assertionList(testCircuit.getPublisher().noRouteAssertion()), testProps);
+ CircuitFactory circuitFactory = getCircuitFactory();
+ Circuit testCircuit = circuitFactory.createCircuit(testProps);
+
+ assertNoFailures(testCircuit.test(1, assertionList(testCircuit.getPublisher().noRouteAssertion())));
}
protected void setUp() throws Exception
@@ -283,5 +291,6 @@
/** Bind the receivers consumer by default. */
testProps.setProperty(RECEIVER_CONSUMER_BIND_PROPNAME, true);
+ testProps.setProperty(RECEIVER_CONSUMER_ACTIVE_PROPNAME, true);
}
}
Modified: incubator/qpid/branches/M2/java/systests/src/main/java/org/apache/qpid/server/exchange/MandatoryMessageTest.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2/java/systests/src/main/java/org/apache/qpid/server/exchange/MandatoryMessageTest.java?view=diff&rev=561855&r1=561854&r2=561855
==============================================================================
--- incubator/qpid/branches/M2/java/systests/src/main/java/org/apache/qpid/server/exchange/MandatoryMessageTest.java (original)
+++ incubator/qpid/branches/M2/java/systests/src/main/java/org/apache/qpid/server/exchange/MandatoryMessageTest.java Wed Aug 1 09:19:31 2007
@@ -20,11 +20,11 @@
*/
package org.apache.qpid.server.exchange;
-import org.apache.qpid.test.framework.sequencers.TestCaseSequencer;
import org.apache.qpid.test.framework.Circuit;
import org.apache.qpid.test.framework.FrameworkBaseCase;
import org.apache.qpid.test.framework.MessagingTestConfigProperties;
import static org.apache.qpid.test.framework.MessagingTestConfigProperties.*;
+import org.apache.qpid.test.framework.sequencers.CircuitFactory;
import uk.co.thebadgerset.junit.extensions.util.ParsedProperties;
import uk.co.thebadgerset.junit.extensions.util.TestContextProperties;
@@ -85,9 +85,10 @@
testProps.setProperty(PUBSUB_PROPNAME, false);
// Run the default test sequence over the test circuit checking for no errors.
- TestCaseSequencer sequencer = getTestSequencer();
- Circuit testCircuit = sequencer.createCircuit(testProps);
- sequencer.sequenceTest(testCircuit, assertionList(testCircuit.getPublisher().noExceptionsAssertion()), testProps);
+ CircuitFactory circuitFactory = getCircuitFactory();
+ Circuit testCircuit = circuitFactory.createCircuit(testProps);
+
+ assertNoFailures(testCircuit.test(1, assertionList(testCircuit.getPublisher().noExceptionsAssertion())));
}
/** Check that an mandatory message is committed succesfully in a transaction when a consumer is connected. */
@@ -98,49 +99,50 @@
testProps.setProperty(PUBSUB_PROPNAME, false);
// Run the default test sequence over the test circuit checking for no errors.
- TestCaseSequencer sequencer = getTestSequencer();
- Circuit testCircuit = sequencer.createCircuit(testProps);
- sequencer.sequenceTest(testCircuit, assertionList(testCircuit.getPublisher().noExceptionsAssertion()), testProps);
+ CircuitFactory circuitFactory = getCircuitFactory();
+ Circuit testCircuit = circuitFactory.createCircuit(testProps);
+
+ assertNoFailures(testCircuit.test(1, assertionList(testCircuit.getPublisher().noExceptionsAssertion())));
}
/**
* Check that a mandatory message is sent succesfully, not using transactions, when a consumer is disconnected but
* the route exists.
*/
- public void test_QPID_517_MandatoryOkConsumerDisconnectedNoTxP2P() throws Exception
+ public void test_QPID_517_MandatoryOkConsumerDisconnectedNoTxP2P()
{
// Ensure transactional sessions are off.
testProps.setProperty(TRANSACTED_PROPNAME, false);
testProps.setProperty(PUBSUB_PROPNAME, false);
- TestCaseSequencer sequencer = getTestSequencer();
- Circuit testCircuit = sequencer.createCircuit(testProps);
-
// Disconnect the consumer.
- testCircuit.getReceiver().getConsumer().close();
+ testProps.setProperty(RECEIVER_CONSUMER_ACTIVE_PROPNAME, false);
+
+ CircuitFactory circuitFactory = getCircuitFactory();
+ Circuit testCircuit = circuitFactory.createCircuit(testProps);
// Send one message with no errors.
- sequencer.sequenceTest(testCircuit, assertionList(testCircuit.getPublisher().noExceptionsAssertion()), testProps);
+ assertNoFailures(testCircuit.test(1, assertionList(testCircuit.getPublisher().noExceptionsAssertion())));
}
/**
* Check that a mandatory message is sent succesfully, in a transaction, when a consumer is disconnected but
* the route exists.
*/
- public void test_QPID_517_MandatoryOkConsumerDisconnectedTxP2P() throws Exception
+ public void test_QPID_517_MandatoryOkConsumerDisconnectedTxP2P()
{
// Ensure transactional sessions are on.
testProps.setProperty(TRANSACTED_PROPNAME, true);
testProps.setProperty(PUBSUB_PROPNAME, false);
- TestCaseSequencer sequencer = getTestSequencer();
- Circuit testCircuit = sequencer.createCircuit(testProps);
-
// Disconnect the consumer.
- testCircuit.getReceiver().getConsumer().close();
+ testProps.setProperty(RECEIVER_CONSUMER_ACTIVE_PROPNAME, false);
+
+ CircuitFactory circuitFactory = getCircuitFactory();
+ Circuit testCircuit = circuitFactory.createCircuit(testProps);
// Send one message with no errors.
- sequencer.sequenceTest(testCircuit, assertionList(testCircuit.getPublisher().noExceptionsAssertion()), testProps);
+ assertNoFailures(testCircuit.test(1, assertionList(testCircuit.getPublisher().noExceptionsAssertion())));
}
/** Check that an mandatory message results in no route code, not using transactions, when no consumer is connected. */
@@ -155,9 +157,10 @@
testProps.setProperty(RECEIVER_CONSUMER_BIND_PROPNAME, false);
// Send one message and get a linked no route exception.
- TestCaseSequencer sequencer = getTestSequencer();
- Circuit testCircuit = sequencer.createCircuit(testProps);
- sequencer.sequenceTest(testCircuit, assertionList(testCircuit.getPublisher().noRouteAssertion()), testProps);
+ CircuitFactory circuitFactory = getCircuitFactory();
+ Circuit testCircuit = circuitFactory.createCircuit(testProps);
+
+ assertNoFailures(testCircuit.test(1, assertionList(testCircuit.getPublisher().noRouteAssertion())));
}
/** Check that an mandatory message results in no route code, upon transaction commit, when a consumer is connected. */
@@ -172,9 +175,10 @@
testProps.setProperty(RECEIVER_CONSUMER_BIND_PROPNAME, false);
// Send one message and get a linked no route exception.
- TestCaseSequencer sequencer = getTestSequencer();
- Circuit testCircuit = sequencer.createCircuit(testProps);
- sequencer.sequenceTest(testCircuit, assertionList(testCircuit.getPublisher().noRouteAssertion()), testProps);
+ CircuitFactory circuitFactory = getCircuitFactory();
+ Circuit testCircuit = circuitFactory.createCircuit(testProps);
+
+ assertNoFailures(testCircuit.test(1, assertionList(testCircuit.getPublisher().noRouteAssertion())));
}
/** Check that an mandatory message is sent succesfully not using transactions when a consumer is connected. */
@@ -185,9 +189,10 @@
testProps.setProperty(PUBSUB_PROPNAME, true);
// Run the default test sequence over the test circuit checking for no errors.
- TestCaseSequencer sequencer = getTestSequencer();
- Circuit testCircuit = sequencer.createCircuit(testProps);
- sequencer.sequenceTest(testCircuit, assertionList(testCircuit.getPublisher().noExceptionsAssertion()), testProps);
+ CircuitFactory circuitFactory = getCircuitFactory();
+ Circuit testCircuit = circuitFactory.createCircuit(testProps);
+
+ assertNoFailures(testCircuit.test(1, assertionList(testCircuit.getPublisher().noExceptionsAssertion())));
}
/** Check that an mandatory message is committed succesfully in a transaction when a consumer is connected. */
@@ -198,16 +203,17 @@
testProps.setProperty(PUBSUB_PROPNAME, true);
// Run the default test sequence over the test circuit checking for no errors.
- TestCaseSequencer sequencer = getTestSequencer();
- Circuit testCircuit = sequencer.createCircuit(testProps);
- sequencer.sequenceTest(testCircuit, assertionList(testCircuit.getPublisher().noExceptionsAssertion()), testProps);
+ CircuitFactory circuitFactory = getCircuitFactory();
+ Circuit testCircuit = circuitFactory.createCircuit(testProps);
+
+ assertNoFailures(testCircuit.test(1, assertionList(testCircuit.getPublisher().noExceptionsAssertion())));
}
/**
* Check that a mandatory message is sent succesfully, not using transactions, when a consumer is disconnected but
* the route exists.
*/
- public void test_QPID_517_MandatoryOkConsumerDisconnectedNoTxPubSub() throws Exception
+ public void test_QPID_517_MandatoryOkConsumerDisconnectedNoTxPubSub()
{
// Ensure transactional sessions are off.
testProps.setProperty(TRANSACTED_PROPNAME, false);
@@ -216,21 +222,21 @@
// Use durable subscriptions, so that the route remains open with no subscribers.
testProps.setProperty(DURABLE_SUBSCRIPTION_PROPNAME, true);
- TestCaseSequencer sequencer = getTestSequencer();
- Circuit testCircuit = sequencer.createCircuit(testProps);
-
// Disconnect the consumer.
- testCircuit.getReceiver().getConsumer().close();
+ testProps.setProperty(RECEIVER_CONSUMER_ACTIVE_PROPNAME, false);
+
+ CircuitFactory circuitFactory = getCircuitFactory();
+ Circuit testCircuit = circuitFactory.createCircuit(testProps);
// Send one message with no errors.
- sequencer.sequenceTest(testCircuit, assertionList(testCircuit.getPublisher().noExceptionsAssertion()), testProps);
+ assertNoFailures(testCircuit.test(1, assertionList(testCircuit.getPublisher().noExceptionsAssertion())));
}
/**
* Check that a mandatory message is sent succesfully, in a transaction, when a consumer is disconnected but
* the route exists.
*/
- public void test_QPID_517_MandatoryOkConsumerDisconnectedTxPubSub() throws Exception
+ public void test_QPID_517_MandatoryOkConsumerDisconnectedTxPubSub()
{
// Ensure transactional sessions are on.
testProps.setProperty(TRANSACTED_PROPNAME, true);
@@ -239,14 +245,14 @@
// Use durable subscriptions, so that the route remains open with no subscribers.
testProps.setProperty(DURABLE_SUBSCRIPTION_PROPNAME, true);
- TestCaseSequencer sequencer = getTestSequencer();
- Circuit testCircuit = sequencer.createCircuit(testProps);
-
// Disconnect the consumer.
- testCircuit.getReceiver().getConsumer().close();
+ testProps.setProperty(RECEIVER_CONSUMER_ACTIVE_PROPNAME, false);
+
+ CircuitFactory circuitFactory = getCircuitFactory();
+ Circuit testCircuit = circuitFactory.createCircuit(testProps);
// Send one message with no errors.
- sequencer.sequenceTest(testCircuit, assertionList(testCircuit.getPublisher().noExceptionsAssertion()), testProps);
+ assertNoFailures(testCircuit.test(1, assertionList(testCircuit.getPublisher().noExceptionsAssertion())));
}
/** Check that an mandatory message results in no route code, not using transactions, when no consumer is connected. */
@@ -261,9 +267,10 @@
testProps.setProperty(RECEIVER_CONSUMER_BIND_PROPNAME, false);
// Send one message and get a linked no route exception.
- TestCaseSequencer sequencer = getTestSequencer();
- Circuit testCircuit = sequencer.createCircuit(testProps);
- sequencer.sequenceTest(testCircuit, assertionList(testCircuit.getPublisher().noRouteAssertion()), testProps);
+ CircuitFactory circuitFactory = getCircuitFactory();
+ Circuit testCircuit = circuitFactory.createCircuit(testProps);
+
+ assertNoFailures(testCircuit.test(1, assertionList(testCircuit.getPublisher().noRouteAssertion())));
}
/** Check that an mandatory message results in no route code, upon transaction commit, when a consumer is connected. */
@@ -278,9 +285,10 @@
testProps.setProperty(RECEIVER_CONSUMER_BIND_PROPNAME, false);
// Send one message and get a linked no route exception.
- TestCaseSequencer sequencer = getTestSequencer();
- Circuit testCircuit = sequencer.createCircuit(testProps);
- sequencer.sequenceTest(testCircuit, assertionList(testCircuit.getPublisher().noRouteAssertion()), testProps);
+ CircuitFactory circuitFactory = getCircuitFactory();
+ Circuit testCircuit = circuitFactory.createCircuit(testProps);
+
+ assertNoFailures(testCircuit.test(1, assertionList(testCircuit.getPublisher().noRouteAssertion())));
}
protected void setUp() throws Exception
@@ -295,5 +303,6 @@
/** Bind the receivers consumer by default. */
testProps.setProperty(RECEIVER_CONSUMER_BIND_PROPNAME, true);
+ testProps.setProperty(RECEIVER_CONSUMER_ACTIVE_PROPNAME, true);
}
}