1 package org.objectweb.celtix.bus.transports.jms; 2 3 import java.util.Properties ; 4 5 import javax.naming.Context ; 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 name) { 15 super(name); 16 } 17 18 21 public static void main(String [] args) { 22 junit.textui.TestRunner.run(JMSUtilsTest.class); 23 } 24 25 public void setUp() throws Exception { 26 } 27 28 public void tearDown() throws Exception { 29 } 31 32 public void testpopulateIncomingContextNonNull() throws Exception { 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 env = new Properties (); 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 |