KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > celtix > bus > bindings > xml > XMLBindingFactoryTest


1 package org.objectweb.celtix.bus.bindings.xml;
2
3 import javax.xml.ws.Binding;
4
5 import junit.framework.TestCase;
6
7 import org.objectweb.celtix.Bus;
8 import org.objectweb.celtix.bindings.BindingFactory;
9 import org.objectweb.celtix.bindings.ClientBinding;
10 import org.objectweb.celtix.ws.addressing.EndpointReferenceType;
11
12 public class XMLBindingFactoryTest extends TestCase {
13
14     private TestUtils testUtils = new TestUtils();
15     
16     public XMLBindingFactoryTest(String JavaDoc arg0) {
17         super(arg0);
18     }
19
20     public static void main(String JavaDoc[] args) {
21         junit.textui.TestRunner.run(XMLBindingFactoryTest.class);
22     }
23
24     public void setUp() {
25         testUtils = new TestUtils();
26     }
27     
28     public void testCreateClientBinding() throws Exception JavaDoc {
29         Bus bus = Bus.init(new String JavaDoc[0]);
30         BindingFactory factory =
31             bus.getBindingManager().getBindingFactory(
32                 "http://celtix.objectweb.org/bindings/xmlformat");
33         assertNotNull(factory);
34         
35         EndpointReferenceType address = testUtils.getEndpointReference();
36         
37         ClientBinding clientBinding = factory.createClientBinding(address);
38         assertNotNull(clientBinding);
39         assertTrue(XMLClientBinding.class.isInstance(clientBinding));
40         
41         XMLClientBinding xmlClientBinding = (XMLClientBinding)clientBinding;
42         Binding b = xmlClientBinding.getBinding();
43         assertNotNull(b);
44         assertTrue(XMLBindingImpl.class.isInstance(b));
45                
46         bus.shutdown(true);
47     }
48 }
49
Popular Tags