Author: lquack
Date: Fri Dec 9 15:56:15 2016
New Revision: 1773417
URL: http://svn.apache.org/viewvc?rev=1773417&view=rev
Log:
QPID-7546: Make PropertyValueTest pass with new JMS client.
Modified:
qpid/java/trunk/systests/src/test/java/org/apache/qpid/test/unit/basic/PropertyValueTest.java
Modified:
qpid/java/trunk/systests/src/test/java/org/apache/qpid/test/unit/basic/PropertyValueTest.java
URL:
http://svn.apache.org/viewvc/qpid/java/trunk/systests/src/test/java/org/apache/qpid/test/unit/basic/PropertyValueTest.java?rev=1773417&r1=1773416&r2=1773417&view=diff
==============================================================================
---
qpid/java/trunk/systests/src/test/java/org/apache/qpid/test/unit/basic/PropertyValueTest.java
(original)
+++
qpid/java/trunk/systests/src/test/java/org/apache/qpid/test/unit/basic/PropertyValueTest.java
Fri Dec 9 15:56:15 2016
@@ -75,12 +75,11 @@ public class PropertyValueTest extends Q
private void init(Connection connection) throws Exception
{
_connection = connection;
- _session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+ _session = connection.createSession(true, Session.SESSION_TRANSACTED);
_destination = createTestQueue(_session);
// set up a slow consumer
- connection.start()
- ;
+ connection.start();
_session.createConsumer(_destination).setMessageListener(this);
}
@@ -325,7 +324,7 @@ public class PropertyValueTest extends Q
}
int count = _count;
- send(count);
+ send(count, run);
waitFor(count);
check();
_logger.info("Completed without failure");
@@ -341,13 +340,13 @@ public class PropertyValueTest extends Q
}
}
- void send(int count) throws JMSException
+ void send( int count, final int iteration) throws JMSException
{
// create a publisher
MessageProducer producer = _session.createProducer(_destination);
for (int i = 0; i < count; i++)
{
- String text = "Message " + i;
+ String text = "Message " + iteration;
messages.add(text);
Message m = _session.createTextMessage(text);
@@ -391,10 +390,11 @@ public class PropertyValueTest extends Q
_logger.debug("Sending Msg:" + m);
producer.send(m);
+ _session.commit();
}
}
- void waitFor(int count) throws InterruptedException
+ void waitFor(int count) throws Exception
{
synchronized (received)
{
@@ -403,6 +403,7 @@ public class PropertyValueTest extends Q
received.wait();
}
}
+ _session.commit();
}
void check() throws JMSException, URISyntaxException
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]