Commit 54b7b3a4 authored by Guillaume Surrel's avatar Guillaume Surrel
Browse files

Adapt tests to new extended destinations.

parent caf1d306
......@@ -34,11 +34,14 @@ import javax.jms.Session;
import javax.naming.Context;
import javax.naming.InitialContext;
import org.objectweb.joram.client.jms.Destination;
import org.objectweb.joram.client.jms.Queue;
import org.objectweb.joram.client.jms.admin.AdminModule;
import org.objectweb.joram.client.jms.admin.User;
import org.objectweb.joram.client.jms.tcp.TcpConnectionFactory;
import com.scalagent.joram.mom.dest.collector.URLAcquisition;
import framework.TestCase;
/**
......@@ -75,7 +78,7 @@ public class TestCollectorQueue1 extends TestCase implements MessageListener {
Thread.sleep(12000);
assertTrue(nbReceived > 2);
assertTrue(nbReceived >= 2);
cnx.close();
} catch (Throwable exc) {
......@@ -87,7 +90,7 @@ public class TestCollectorQueue1 extends TestCase implements MessageListener {
}
}
String url = null;
String url = "http://www.gnu.org/licenses/lgpl.txt";
/**
* Admin : Create queue and a user anonymous use jndi
......@@ -96,17 +99,16 @@ public class TestCollectorQueue1 extends TestCase implements MessageListener {
// connection
AdminModule.connect("localhost", 2560, "root", "root", 60);
url = "http://www.gnu.org/licenses/lgpl.txt";
Properties properties = new Properties();
properties.setProperty("expiration", "0");
properties.setProperty("persistent", "true");
properties.setProperty("period", "5000");
properties.setProperty("acquisition.period", "5000");
properties.setProperty("collector.url", url);
properties.setProperty("collector.type", "" + org.objectweb.joram.shared.messages.Message.BYTES);
properties.setProperty("collector.className", "com.scalagent.joram.mom.dest.collector.URLCollector");
properties.setProperty("acquisition.className", URLAcquisition.class.getName());
// create a Queue
Queue queue = Queue.create(0, "CollectorQueue", Queue.COLLECTOR_QUEUE, properties);
Queue queue = Queue.create(0, "CollectorQueue", Destination.ACQUISITION_QUEUE, properties);
// create a user
User.create("anonymous", "anonymous");
......
......@@ -22,6 +22,8 @@
*/
package joram.collector;
import java.util.Properties;
import javax.jms.Connection;
import javax.jms.ConnectionFactory;
import javax.jms.JMSException;
......@@ -33,11 +35,14 @@ import javax.jms.Session;
import javax.naming.Context;
import javax.naming.InitialContext;
import org.objectweb.joram.client.jms.Destination;
import org.objectweb.joram.client.jms.Queue;
import org.objectweb.joram.client.jms.admin.AdminModule;
import org.objectweb.joram.client.jms.admin.User;
import org.objectweb.joram.client.jms.tcp.TcpConnectionFactory;
import com.scalagent.joram.mom.dest.collector.URLAcquisition;
import framework.TestCase;
/**
......@@ -84,15 +89,14 @@ public class TestCollectorQueue2 extends TestCase implements MessageListener {
Message msg = sessionp.createMessage();
msg.setStringProperty("expiration", "0");
msg.setStringProperty("persistent", "true");
msg.setStringProperty("period", "5000");
msg.setStringProperty("acquisition.period", "5000");
msg.setStringProperty("collector.url", url);
msg.setStringProperty("collector.type", "" + org.objectweb.joram.shared.messages.Message.BYTES);
msg.setStringProperty("collector.className", "com.scalagent.joram.mom.dest.collector.URLCollector");
producer.send(msg);
Thread.sleep(12000);
assertTrue(nbReceived > 2);
assertTrue(nbReceived >= 2);
cnx.close();
} catch (Throwable exc) {
......@@ -112,7 +116,9 @@ public class TestCollectorQueue2 extends TestCase implements MessageListener {
AdminModule.connect("localhost", 2560, "root", "root", 60);
// create a queue
Queue queue = Queue.create(0, "CollectorQueue", Queue.COLLECTOR_QUEUE, null);
Properties props = new Properties();
props.put("acquisition.className", URLAcquisition.class.getName());
Queue queue = Queue.create(0, "CollectorQueue", Destination.ACQUISITION_QUEUE, props);
// create a user
User.create("anonymous", "anonymous");
......
......@@ -34,11 +34,14 @@ import javax.jms.Session;
import javax.naming.Context;
import javax.naming.InitialContext;
import org.objectweb.joram.client.jms.Destination;
import org.objectweb.joram.client.jms.Topic;
import org.objectweb.joram.client.jms.admin.AdminModule;
import org.objectweb.joram.client.jms.admin.User;
import org.objectweb.joram.client.jms.tcp.TcpConnectionFactory;
import com.scalagent.joram.mom.dest.collector.URLAcquisition;
import framework.TestCase;
/**
......@@ -100,13 +103,13 @@ public class TestCollectorTopic1 extends TestCase implements MessageListener {
Properties properties = new Properties();
properties.setProperty("expiration", "0");
properties.setProperty("persistent", "true");
properties.setProperty("period", "5000");
properties.setProperty("acquisition.period", "5000");
properties.setProperty("collector.url", url);
properties.setProperty("collector.type", "" + org.objectweb.joram.shared.messages.Message.BYTES);
properties.setProperty("collector.className", "com.scalagent.joram.mom.dest.collector.URLCollector");
properties.setProperty("acquisition.className", URLAcquisition.class.getName());
// create a Topic
Topic topic = Topic.create(0, "CollectorTopic", Topic.COLLECTOR_TOPIC, properties);
Topic topic = Topic.create(0, "CollectorTopic", Destination.ACQUISITION_TOPIC, properties);
// create a user
User.create("anonymous", "anonymous");
......
......@@ -22,6 +22,8 @@
*/
package joram.collector;
import java.util.Properties;
import javax.jms.Connection;
import javax.jms.ConnectionFactory;
import javax.jms.JMSException;
......@@ -33,11 +35,14 @@ import javax.jms.Session;
import javax.naming.Context;
import javax.naming.InitialContext;
import org.objectweb.joram.client.jms.Destination;
import org.objectweb.joram.client.jms.Topic;
import org.objectweb.joram.client.jms.admin.AdminModule;
import org.objectweb.joram.client.jms.admin.User;
import org.objectweb.joram.client.jms.tcp.TcpConnectionFactory;
import com.scalagent.joram.mom.dest.collector.URLAcquisition;
import framework.TestCase;
/**
......@@ -84,15 +89,14 @@ public class TestCollectorTopic2 extends TestCase implements MessageListener {
Message msg = sessionp.createMessage();
msg.setStringProperty("expiration", "0");
msg.setStringProperty("persistent", "true");
msg.setStringProperty("period", "5000");
msg.setStringProperty("acquisition.period", "5000");
msg.setStringProperty("collector.url", url);
msg.setStringProperty("collector.type", "" + org.objectweb.joram.shared.messages.Message.BYTES);
msg.setStringProperty("collector.className", "com.scalagent.joram.mom.dest.collector.URLCollector");
producer.send(msg);
Thread.sleep(12000);
assertTrue(nbReceived > 2);
assertTrue(nbReceived >= 2);
cnx.close();
} catch (Throwable exc) {
......@@ -112,7 +116,9 @@ public class TestCollectorTopic2 extends TestCase implements MessageListener {
AdminModule.connect("localhost", 2560, "root", "root", 60);
// create a Topic
Topic topic = Topic.create(0, "CollectorTopic", Topic.COLLECTOR_TOPIC, null);
Properties props = new Properties();
props.put("acquisition.className", URLAcquisition.class.getName());
Topic topic = Topic.create(0, "CollectorTopic", Destination.ACQUISITION_TOPIC, props);
// create a user
User.create("anonymous", "anonymous");
......
Supports Markdown
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