01: package org.objectweb.celtix.bus.bindings.xml;
02:
03: import javax.xml.ws.Binding;
04:
05: import junit.framework.TestCase;
06:
07: import org.objectweb.celtix.Bus;
08: import org.objectweb.celtix.bindings.BindingFactory;
09: 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 arg0) {
17: super (arg0);
18: }
19:
20: public static void main(String[] 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 {
29: Bus bus = Bus.init(new String[0]);
30: BindingFactory factory = bus
31: .getBindingManager()
32: .getBindingFactory(
33: "http://celtix.objectweb.org/bindings/xmlformat");
34: assertNotNull(factory);
35:
36: EndpointReferenceType address = testUtils
37: .getEndpointReference();
38:
39: ClientBinding clientBinding = factory
40: .createClientBinding(address);
41: assertNotNull(clientBinding);
42: assertTrue(XMLClientBinding.class.isInstance(clientBinding));
43:
44: XMLClientBinding xmlClientBinding = (XMLClientBinding) clientBinding;
45: Binding b = xmlClientBinding.getBinding();
46: assertNotNull(b);
47: assertTrue(XMLBindingImpl.class.isInstance(b));
48:
49: bus.shutdown(true);
50: }
51: }
|