1 package org.objectweb.celtix.bus.jaxws; 2 3 import java.util.Map ; 4 5 import javax.xml.ws.Binding; 6 import javax.xml.ws.handler.MessageContext; 7 8 import junit.framework.TestCase; 9 10 import org.easymock.IMocksControl; 11 import org.easymock.classextension.EasyMock; 12 import org.objectweb.celtix.context.ObjectMessageContext; 13 import org.objectweb.celtix.context.ObjectMessageContextImpl; 14 15 public class BindingProviderImplTest extends TestCase { 16 17 private ObjectMessageContext objectCtx; 18 private BindingProviderImpl bindingProviderImpl; 19 private Binding binding; 20 private IMocksControl control; 21 22 public void setUp() throws Exception { 23 objectCtx = new ObjectMessageContextImpl(); 24 bindingProviderImpl = new BindingProviderImpl(); 25 control = EasyMock.createNiceControl(); 26 binding = control.createMock(Binding.class); 27 } 28 29 public void testResponseContext() { 30 objectCtx.put("foo", new String ("fooObject")); 31 objectCtx.setScope("foo", MessageContext.Scope.APPLICATION); 32 bindingProviderImpl.populateResponseContext(objectCtx); 33 Map <String , Object > map = bindingProviderImpl.getResponseContext(); 34 String str = (String )map.get("foo"); 35 assertTrue(str.equals("fooObject")); 36 } 37 38 public void testBinding() { 39 bindingProviderImpl.setBinding(binding); 40 Binding thebinding = bindingProviderImpl.getBinding(); 41 assertEquals("Objects should be equal", binding, thebinding); 42 } 43 44 public void testRequestContext() { 45 Map <String , Object > map = bindingProviderImpl.getRequestContext(); 46 assertNotNull(map); 47 } 48 49 50 51 } 52 | Popular Tags |