Commit aa055616 authored by afreyssin's avatar afreyssin

Test the setting of redeliveryDelay after Queue creation.

parent 65294cfd
......@@ -7176,7 +7176,7 @@
<param name="jndiconf" value="jms2/jndi.properties"/>
<param name="a3conf" value="jms2/a3servers1.xml"/>
<param name="jvmargs" value=""/>
<param name="args" value="0 X"/>
<param name="args" value="0 D"/>
</antcall>
<antcall target="test.run" inheritAll="true">
<param name="transaction" value="fr.dyade.aaa.ext.NGTransaction"/>
......@@ -7185,7 +7185,16 @@
<param name="jndiconf" value="jms2/jndi.properties"/>
<param name="a3conf" value="jms2/a3servers.xml"/>
<param name="jvmargs" value=""/>
<param name="args" value="0"/>
<param name="args" value="0 P"/>
</antcall>
<antcall target="test.run" inheritAll="true">
<param name="transaction" value="fr.dyade.aaa.ext.NGTransaction"/>
<param name="testid" value="jms2.redeliveryDelay_Q_T-3"/>
<param name="className" value="joram.jms2.RedeliveryDelay_Q"/>
<param name="jndiconf" value="jms2/jndi.properties"/>
<param name="a3conf" value="jms2/a3servers.xml"/>
<param name="jvmargs" value=""/>
<param name="args" value="0 C"/>
</antcall>
</target>
......@@ -7220,7 +7229,7 @@
<param name="jndiconf" value="jms2/jndi.properties"/>
<param name="a3conf" value="jms2/a3servers1.xml"/>
<param name="jvmargs" value=""/>
<param name="args" value="1 X"/>
<param name="args" value="1 D"/>
</antcall>
<antcall target="test.run" inheritAll="true">
<param name="transaction" value="fr.dyade.aaa.ext.NGTransaction"/>
......@@ -7229,7 +7238,16 @@
<param name="jndiconf" value="jms2/jndi.properties"/>
<param name="a3conf" value="jms2/a3servers.xml"/>
<param name="jvmargs" value=""/>
<param name="args" value="1"/>
<param name="args" value="1 P"/>
</antcall>
<antcall target="test.run" inheritAll="true">
<param name="transaction" value="fr.dyade.aaa.ext.NGTransaction"/>
<param name="testid" value="jms2.redeliveryDelay_Q_A-3"/>
<param name="className" value="joram.jms2.RedeliveryDelay_Q"/>
<param name="jndiconf" value="jms2/jndi.properties"/>
<param name="a3conf" value="jms2/a3servers.xml"/>
<param name="jvmargs" value=""/>
<param name="args" value="1 C"/>
</antcall>
</target>
......@@ -7264,7 +7282,7 @@
<param name="jndiconf" value="jms2/jndi.properties"/>
<param name="a3conf" value="jms2/a3servers1.xml"/>
<param name="jvmargs" value=""/>
<param name="args" value="2 X"/>
<param name="args" value="2 D"/>
</antcall>
<antcall target="test.run" inheritAll="true">
<param name="transaction" value="fr.dyade.aaa.ext.NGTransaction"/>
......@@ -7273,7 +7291,16 @@
<param name="jndiconf" value="jms2/jndi.properties"/>
<param name="a3conf" value="jms2/a3servers.xml"/>
<param name="jvmargs" value=""/>
<param name="args" value="2"/>
<param name="args" value="2 P"/>
</antcall>
<antcall target="test.run" inheritAll="true">
<param name="transaction" value="fr.dyade.aaa.ext.NGTransaction"/>
<param name="testid" value="jms2.redeliveryDelay_Q_C-3"/>
<param name="className" value="joram.jms2.RedeliveryDelay_Q"/>
<param name="jndiconf" value="jms2/jndi.properties"/>
<param name="a3conf" value="jms2/a3servers.xml"/>
<param name="jvmargs" value=""/>
<param name="args" value="2 C"/>
</antcall>
</target>
......
......@@ -48,18 +48,18 @@ import framework.TestCase;
public class RedeliveryDelay_Q extends TestCase implements javax.jms.MessageListener {
public static void main(String[] args) {
new RedeliveryDelay_Q().run(Integer.parseInt(args[0]), (args.length > 1));
new RedeliveryDelay_Q().run(Integer.parseInt(args[0]), args[1]);
}
JMSContext context;
JMSConsumer consumer;
public void run(int sessionMode, boolean useDefault) {
public void run(int sessionMode, String mode) {
try {
startAgentServer((short) 0);
Thread.sleep(1000);
admin(useDefault);
admin(mode);
test(sessionMode);
Thread.sleep(5000);
......@@ -82,14 +82,20 @@ public class RedeliveryDelay_Q extends TestCase implements javax.jms.MessageList
ConnectionFactory cf = null;
Queue dest = null;
void admin(boolean useDefault) throws Exception {
void admin(String mode) throws Exception {
cf = TcpConnectionFactory.create("localhost", 2560);
AdminModule.connect(cf, "root", "root");
User.create("anonymous", "anonymous", 0);
if (useDefault) {
if ("D".equals(mode)) { // "D" -> Default
System.out.println("Default redelivery delay set.");
dest = Queue.create("queue");
} else {
} else if ("P".equals(mode)) { // "P" -> Use setProperties
System.out.println("Configure Queue redelivery delay.");
dest = Queue.create(0, name);
Properties prop = new Properties();
prop.setProperty(Queue.REDELIVERY_DELAY, "5");
dest.setProperties(prop);
} else { // "C" -> set at creation time
System.out.println("Configure Queue redelivery delay.");
Properties prop = new Properties();
prop.setProperty(Queue.REDELIVERY_DELAY, "5");
......@@ -99,6 +105,7 @@ public class RedeliveryDelay_Q extends TestCase implements javax.jms.MessageList
dest.setFreeReading();
dest.setFreeWriting();
AdminModule.disconnect();
}
void test(int sessionMode) throws InterruptedException {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment