01: /*
02: * Copyright (c) 2002-2003 by OpenSymphony
03: * All rights reserved.
04: */
05: package com.opensymphony.oscache.plugins.clustersupport;
06:
07: import com.opensymphony.oscache.base.Config;
08:
09: import junit.framework.Test;
10: import junit.framework.TestSuite;
11:
12: /**
13: * Test all the public methods of the broadcasting listener and assert the
14: * return values
15: *
16: * @author <a href="mailto:chris@swebtec.com">Chris Miller</a>
17: */
18: public final class TestJMSBroadcastingListener extends
19: BaseTestBroadcastingListener {
20: public TestJMSBroadcastingListener(String str) {
21: super (str);
22: }
23:
24: /**
25: * This methods returns the name of this test class to JUnit.
26: *
27: * @return The test for this class
28: */
29: public static Test suite() {
30: return new TestSuite(TestJMSBroadcastingListener.class);
31: }
32:
33: /**
34: * Returns a configured JavaGroupsBroadcastingListener instance
35: * for testing.
36: */
37: public AbstractBroadcastingListener getListener() {
38: return new JMSBroadcastingListener();
39: }
40:
41: /**
42: * Return the configuration for the JMS listener
43: */
44: Config getConfig() {
45: Config config = new Config();
46:
47: // There needs to be an application resource file present "jndi.properties" that contains the following
48: // parameters:
49: // config.set(Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.ApplicationClientInitialContextFactory");
50: // config.set(Context.PROVIDER_URL, "ormi://localhost:23791/");
51: // config.set(Context.SECURITY_PRINCIPAL, "admin");
52: // config.set(Context.SECURITY_CREDENTIALS, "xxxxxx");
53: config.set("cache.cluster.jms.topic.factory",
54: "java:comp/env/jms/TopicConnectionFactory");
55: config.set("cache.cluster.jms.topic.name",
56: "java:comp/env/jms/OSCacheTopic");
57: config.set("cache.cluster.jms.node.name", "cacheNode1");
58:
59: return config;
60: }
61: }
|