KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > celtix > bus > transports > jms > JMSUtilsTest


1 package org.objectweb.celtix.bus.transports.jms;
2
3 import java.util.Properties JavaDoc;
4
5 import javax.naming.Context JavaDoc;
6
7 import junit.framework.TestCase;
8
9 import org.objectweb.celtix.transports.jms.JMSAddressPolicyType;
10 import org.objectweb.celtix.transports.jms.JMSNamingPropertyType;
11
12 public class JMSUtilsTest extends TestCase {
13
14     public JMSUtilsTest(String JavaDoc name) {
15         super(name);
16     }
17
18     /**
19      * @param args
20      */

21     public static void main(String JavaDoc[] args) {
22         junit.textui.TestRunner.run(JMSUtilsTest.class);
23     }
24     
25     public void setUp() throws Exception JavaDoc {
26     }
27     
28     public void tearDown() throws Exception JavaDoc {
29         //
30
}
31     
32     // This is just a place holder for now it will be chaning in next task
33
// when the new JMS address policies and configurations are introdced.
34
public void testpopulateIncomingContextNonNull() throws Exception JavaDoc {
35         JMSAddressPolicyType addrType = new JMSAddressPolicyType();
36         
37         JMSNamingPropertyType prop = new JMSNamingPropertyType();
38         prop.setName(Context.APPLET);
39         prop.setValue("testValue");
40         addrType.getJMSNamingProperty().add(prop);
41         
42         prop.setName(Context.BATCHSIZE);
43         prop.setValue("12");
44         addrType.getJMSNamingProperty().add(prop);
45         
46         
47         Properties JavaDoc env = new Properties JavaDoc();
48         assertTrue(env.size() <= 0);
49         JMSUtils.populateContextEnvironment(addrType, env);
50         assertTrue("Environment should not be empty", env.size() > 0);
51         assertTrue("Environemnt should contain NamingBatchSize property", env.get(Context.BATCHSIZE) != null);
52     }
53
54 }
55
Popular Tags