You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ra...@apache.org on 2010/05/18 19:53:02 UTC
svn commit: r945789 -
/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/AMQConnectionTest.java
Author: rajith
Date: Tue May 18 17:53:02 2010
New Revision: 945789
URL: http://svn.apache.org/viewvc?rev=945789&view=rev
Log:
Modified the test slightly to make it work against the 0-10 code path.
Verified that it works against the C++ broker and the Java broker (both 0-8 and 0-10 codepaths).
Modified:
qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/AMQConnectionTest.java
Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/AMQConnectionTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/AMQConnectionTest.java?rev=945789&r1=945788&r2=945789&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/AMQConnectionTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/AMQConnectionTest.java Tue May 18 17:53:02 2010
@@ -230,7 +230,16 @@ public class AMQConnectionTest extends Q
producer.send(producerSession.createTextMessage("test"));
}
- MessageConsumer consumerB = consSessA.createConsumer(_queue);
+ MessageConsumer consumerB = null;
+ if (isBroker08())
+ {
+ Session consSessB = _connection.createSession(true, Session.AUTO_ACKNOWLEDGE);
+ consumerB = consSessB.createConsumer(_queue);
+ }
+ else
+ {
+ consumerB = consSessA.createConsumer(_queue);
+ }
Message msg;
// Check that consumer A has 2 messages
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org
Re: svn commit: r945789 - /qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/AMQConnectionTest.java
Posted by Rajith Attapattu <ra...@gmail.com>.
On Wed, May 19, 2010 at 8:26 AM, Martin Ritchie <ri...@apache.org> wrote:
> All Java test writers
>
> It would make the test code much easier to read if we use
> Session.TRANSACTED_SESSION when we really mean to create a transacted
> session:
> The intent of the following line is unclear:
>> + Session consSessB = _connection.createSession(true, Session.AUTO_ACKNOWLEDGE);
>
> Rajith did you want a Transacted session here?
Not really. I blindly copied it from the session creation for
consumerA from a few lines above.
I only noticed the transacted='true' once Robbie pointed it out in the JIRA.
I actually modified this in my local but didn't commit it yet.
I totally agree with you that if we need the session transacted, then
we should use Session.TRANSACTED_SESSION as the ack mode.
> Martin
>
>
> On 18 May 2010 18:53, <ra...@apache.org> wrote:
>> Author: rajith
>> Date: Tue May 18 17:53:02 2010
>> New Revision: 945789
>>
>> URL: http://svn.apache.org/viewvc?rev=945789&view=rev
>> Log:
>> Modified the test slightly to make it work against the 0-10 code path.
>> Verified that it works against the C++ broker and the Java broker (both 0-8 and 0-10 codepaths).
>>
>> Modified:
>> qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/AMQConnectionTest.java
>>
>> Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/AMQConnectionTest.java
>> URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/AMQConnectionTest.java?rev=945789&r1=945788&r2=945789&view=diff
>> ==============================================================================
>> --- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/AMQConnectionTest.java (original)
>> +++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/AMQConnectionTest.java Tue May 18 17:53:02 2010
>> @@ -230,7 +230,16 @@ public class AMQConnectionTest extends Q
>> producer.send(producerSession.createTextMessage("test"));
>> }
>>
>> - MessageConsumer consumerB = consSessA.createConsumer(_queue);
>> + MessageConsumer consumerB = null;
>> + if (isBroker08())
>> + {
>> + Session consSessB = _connection.createSession(true, Session.AUTO_ACKNOWLEDGE);
>> + consumerB = consSessB.createConsumer(_queue);
>> + }
>> + else
>> + {
>> + consumerB = consSessA.createConsumer(_queue);
>> + }
>>
>> Message msg;
>> // Check that consumer A has 2 messages
>>
>>
>>
>> ---------------------------------------------------------------------
>> Apache Qpid - AMQP Messaging Implementation
>> Project: http://qpid.apache.org
>> Use/Interact: mailto:commits-subscribe@qpid.apache.org
>>
>>
>
>
>
> --
> Martin Ritchie
>
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project: http://qpid.apache.org
> Use/Interact: mailto:dev-subscribe@qpid.apache.org
>
>
--
Regards,
Rajith Attapattu
Red Hat
http://rajith.2rlabs.com/
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org
Re: svn commit: r945789 - /qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/AMQConnectionTest.java
Posted by Martin Ritchie <ri...@apache.org>.
All Java test writers
It would make the test code much easier to read if we use
Session.TRANSACTED_SESSION when we really mean to create a transacted
session:
The intent of the following line is unclear:
> + Session consSessB = _connection.createSession(true, Session.AUTO_ACKNOWLEDGE);
Rajith did you want a Transacted session here?
Martin
On 18 May 2010 18:53, <ra...@apache.org> wrote:
> Author: rajith
> Date: Tue May 18 17:53:02 2010
> New Revision: 945789
>
> URL: http://svn.apache.org/viewvc?rev=945789&view=rev
> Log:
> Modified the test slightly to make it work against the 0-10 code path.
> Verified that it works against the C++ broker and the Java broker (both 0-8 and 0-10 codepaths).
>
> Modified:
> qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/AMQConnectionTest.java
>
> Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/AMQConnectionTest.java
> URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/AMQConnectionTest.java?rev=945789&r1=945788&r2=945789&view=diff
> ==============================================================================
> --- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/AMQConnectionTest.java (original)
> +++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/AMQConnectionTest.java Tue May 18 17:53:02 2010
> @@ -230,7 +230,16 @@ public class AMQConnectionTest extends Q
> producer.send(producerSession.createTextMessage("test"));
> }
>
> - MessageConsumer consumerB = consSessA.createConsumer(_queue);
> + MessageConsumer consumerB = null;
> + if (isBroker08())
> + {
> + Session consSessB = _connection.createSession(true, Session.AUTO_ACKNOWLEDGE);
> + consumerB = consSessB.createConsumer(_queue);
> + }
> + else
> + {
> + consumerB = consSessA.createConsumer(_queue);
> + }
>
> Message msg;
> // Check that consumer A has 2 messages
>
>
>
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project: http://qpid.apache.org
> Use/Interact: mailto:commits-subscribe@qpid.apache.org
>
>
--
Martin Ritchie
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org