On Tue, Sep 7, 2010 at 10:30 AM, Robbie Gemmell
<[email protected]> wrote:
> On 7 September 2010 14:53, Rajith Attapattu <[email protected]> wrote:
>> On Mon, Sep 6, 2010 at 7:06 AM, Robbie Gemmell <[email protected]> 
>> wrote:
>>> Both the included test cases are failing on the default and java
>>> profiles because the addressing syntax isnt supported, so I have
>>> excluded them from the 0-8/9 test profiles.
>>
>> Hmm.. I thought I had them on those lists.
>> These tests were added a while ago, but thanks for adding them to the
>> lists again.
>>
>
> The commit I replied to from Friday added the tests unless im missing 
> something?
My bad ! Clearly I have been on some strong drugs.
Anyways sorry for the inconvenience and thx for adding this into the
correct exclude lists.

>>> As the queue policy types arent currently supported by the Java broker
>>> at all I have also seperately excluded the tests from all of the Java
>>> test profiles. I did note however that testRejectPolicy() is actually
>>> passing on the java.0.10 profile which im guessing it probably
>>> shouldnt, so perhaps that test needs updated.
>>
>> Maybe Rob Godfrey implemented the queue limits ?
>
> Not that im aware of...looking at the test it seems it just doesnt
> have a failure path if no exception gets thrown because the feature
> isnt implemented.
Thx for spotting this. I added a statement to fail the test if an
exception isn't thrown.

>>
>>> Robbie
>>>
>>> On 3 September 2010 17:22,  <[email protected]> wrote:
>>>> Author: rajith
>>>> Date: Fri Sep  3 16:22:07 2010
>>>> New Revision: 992352
>>>>
>>>> URL: http://svn.apache.org/viewvc?rev=992352&view=rev
>>>> Log:
>>>> QPID-2845
>>>> Adjusted the address string to include arguments inside the arguments map 
>>>> instead of putting them directly in x-declare.
>>>>
>>>> Added:
>>>>    
>>>> qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/client/queue/QueuePolicyTest.java
>>>>
>>>> Added: 
>>>> qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/client/queue/QueuePolicyTest.java
>>>> URL: 
>>>> http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/client/queue/QueuePolicyTest.java?rev=992352&view=auto
>>>> ==============================================================================
>>>> --- 
>>>> qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/client/queue/QueuePolicyTest.java
>>>>  (added)
>>>> +++ 
>>>> qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/client/queue/QueuePolicyTest.java
>>>>  Fri Sep  3 16:22:07 2010
>>>> @@ -0,0 +1,89 @@
>>>> +package org.apache.qpid.test.client.queue;
>>>> +
>>>> +import javax.jms.Connection;
>>>> +import javax.jms.Destination;
>>>> +import javax.jms.MessageConsumer;
>>>> +import javax.jms.MessageProducer;
>>>> +import javax.jms.Session;
>>>> +import javax.jms.TextMessage;
>>>> +
>>>> +import org.apache.qpid.AMQException;
>>>> +import org.apache.qpid.client.AMQSession;
>>>> +import org.apache.qpid.test.utils.QpidBrokerTestCase;
>>>> +import org.slf4j.Logger;
>>>> +import org.slf4j.LoggerFactory;
>>>> +
>>>> +public class QueuePolicyTest extends QpidBrokerTestCase
>>>> +{
>>>> +    private static final Logger _logger = 
>>>> LoggerFactory.getLogger(QueuePolicyTest.class);
>>>> +    private Connection _connection;
>>>> +
>>>> +   �...@override
>>>> +    public void setUp() throws Exception
>>>> +    {
>>>> +        super.setUp();
>>>> +        _connection = getConnection() ;
>>>> +        _connection.start();
>>>> +    }
>>>> +
>>>> +   �...@override
>>>> +    public void tearDown() throws Exception
>>>> +    {
>>>> +        _connection.close();
>>>> +        super.tearDown();
>>>> +    }
>>>> +
>>>> +    public void testRejectPolicy() throws Exception
>>>> +    {
>>>> +        String addr = "ADDR:queue; {create: always, " +
>>>> +        "node: {x-bindings: [{exchange : 'amq.direct', key : test}], " +
>>>> +        "x-declare:{ arguments : {'qpid.max_count':5} }}}";
>>>> +
>>>> +        Session ssn = 
>>>> _connection.createSession(false,Session.AUTO_ACKNOWLEDGE);
>>>> +
>>>> +        Destination dest = ssn.createQueue(addr);
>>>> +        MessageConsumer consumer = ssn.createConsumer(dest);
>>>> +        MessageProducer prod = 
>>>> ssn.createProducer(ssn.createQueue("ADDR:amq.direct/test"));
>>>> +
>>>> +        for (int i=0; i<50; i++)
>>>> +        {
>>>> +            prod.send(ssn.createMessage());
>>>> +        }
>>>> +
>>>> +        try
>>>> +        {
>>>> +            prod.send(ssn.createMessage());
>>>> +            ((AMQSession)ssn).sync();
>>>> +        }
>>>> +        catch (AMQException e)
>>>> +        {
>>>> +           assertTrue("The correct error code is not 
>>>> set",e.getErrorCode().toString().contains("506"));
>>>> +        }
>>>> +    }
>>>> +
>>>> +    public void testRingPolicy() throws Exception
>>>> +    {
>>>> +        Session ssn = 
>>>> _connection.createSession(false,Session.AUTO_ACKNOWLEDGE);
>>>> +
>>>> +        String addr = "ADDR:my-ring-queue; {create: always, " +
>>>> +        "node: {x-bindings: [{exchange : 'amq.direct', key : test}], " +
>>>> +               "x-declare:{arguments : {'qpid.policy_type':ring, 
>>>> 'qpid.max_count':2} }}}";
>>>> +
>>>> +        Destination dest = ssn.createQueue(addr);
>>>> +        MessageConsumer consumer = ssn.createConsumer(dest);
>>>> +        MessageProducer prod = 
>>>> ssn.createProducer(ssn.createQueue("ADDR:amq.direct/test"));
>>>> +
>>>> +        prod.send(ssn.createTextMessage("Test1"));
>>>> +        prod.send(ssn.createTextMessage("Test2"));
>>>> +        prod.send(ssn.createTextMessage("Test3"));
>>>> +
>>>> +        TextMessage msg = (TextMessage)consumer.receive(1000);
>>>> +        assertEquals("The consumer should receive the msg with 
>>>> body='Test2'",msg.getText(),"Test2");
>>>> +
>>>> +        msg = (TextMessage)consumer.receive(1000);
>>>> +        assertEquals("The consumer should receive the msg with 
>>>> body='Test3'",msg.getText(),"Test3");
>>>> +
>>>> +        prod.send(ssn.createTextMessage("Test4"));
>>>> +        assertEquals("The consumer should receive the msg with 
>>>> body='Test4'",msg.getText(),"Test3");
>>>> +    }
>>>> +}
>>>>
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> Apache Qpid - AMQP Messaging Implementation
>>>> Project:      http://qpid.apache.org
>>>> Use/Interact: mailto:[email protected]
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> Apache Qpid - AMQP Messaging Implementation
>>> Project:      http://qpid.apache.org
>>> Use/Interact: mailto:[email protected]
>>>
>>>
>>
>>
>>
>> --
>> Regards,
>>
>> Rajith Attapattu
>> Red Hat
>> http://rajith.2rlabs.com/
>>
>> ---------------------------------------------------------------------
>> Apache Qpid - AMQP Messaging Implementation
>> Project:      http://qpid.apache.org
>> Use/Interact: mailto:[email protected]
>>
>>
>
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project:      http://qpid.apache.org
> Use/Interact: mailto:[email protected]
>
>



-- 
Regards,

Rajith Attapattu
Red Hat
http://rajith.2rlabs.com/

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:[email protected]

Reply via email to