KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > opensymphony > oscache > plugins > clustersupport > TestJMS10BroadcastingListener


1 /*
2  * Copyright (c) 2002-2003 by OpenSymphony
3  * All rights reserved.
4  */

5 package com.opensymphony.oscache.plugins.clustersupport;
6
7 import com.opensymphony.oscache.base.Config;
8
9 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="&#109;a&#105;&#108;&#116;&#111;:chris&#64;swebtec.&#99;&#111;&#109;">Chris Miller</a>
17  */

18 public final class TestJMS10BroadcastingListener extends BaseTestBroadcastingListener {
19     public TestJMS10BroadcastingListener(String JavaDoc str) {
20         super(str);
21     }
22
23     /**
24      * This methods returns the name of this test class to JUnit.
25      *
26      * @return The test for this class
27      */

28     public static Test suite() {
29         return new TestSuite(TestJMS10BroadcastingListener.class);
30     }
31
32     /**
33      * Returns a configured JavaGroupsBroadcastingListener instance
34      * for testing.
35      */

36     public AbstractBroadcastingListener getListener() {
37         return new JMS10BroadcastingListener();
38     }
39
40     /**
41      * Return the configuration for the JMS listener
42      */

43     Config getConfig() {
44         Config config = new Config();
45
46         // There needs to be an application resource file present "jndi.properties" that contains the following
47
// parameters:
48
// config.set(Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.ApplicationClientInitialContextFactory");
49
// config.set(Context.PROVIDER_URL, "ormi://localhost:23791/");
50
// config.set(Context.SECURITY_PRINCIPAL, "admin");
51
// config.set(Context.SECURITY_CREDENTIALS, "xxxxxx");
52
config.set("cache.cluster.jms.topic.factory", "java:comp/env/jms/TopicConnectionFactory");
53         config.set("cache.cluster.jms.topic.name", "java:comp/env/jms/OSCacheTopic");
54         config.set("cache.cluster.jms.node.name", "cacheNode1");
55
56         return config;
57     }
58 }
59
Popular Tags