1 16 package test.servicedesc; 17 18 import java.util.List ; 19 20 import junit.framework.TestCase; 21 22 import org.apache.axis.description.JavaServiceDesc; 23 import org.apache.axis.description.OperationDesc; 24 import org.apache.axis.encoding.DefaultTypeMappingImpl; 25 26 import javax.xml.namespace.QName ; 27 28 public class TestServiceDesc extends TestCase { 29 30 public TestServiceDesc(String name) { 31 super(name); 32 } 33 34 public TestServiceDesc() { 35 super("Test ServiceDesc Synch"); 36 } 37 38 public void testFaultSynch() throws Exception { 39 JavaServiceDesc desc = new JavaServiceDesc(); 40 desc.setTypeMapping(DefaultTypeMappingImpl.getSingletonDelegate()); 41 42 desc.loadServiceDescByIntrospection(ServiceClass.class); 43 44 List operations = desc.getOperations(); 45 46 assertTrue(operations != null); 47 assertEquals("invalid number of registered operations", 48 2, operations.size()); 49 50 OperationDesc operation; 51 List faults; 52 53 operation = (OperationDesc)operations.get(0); 54 assertEquals("doIt1", operation.getName()); 55 56 faults = operation.getFaults(); 57 58 assertTrue(faults != null); 59 assertEquals("invalid number of registered faults", 60 2, faults.size()); 61 62 operation = (OperationDesc)operations.get(1); 63 assertEquals("doIt2", operation.getName()); 64 65 faults = operation.getFaults(); 66 67 assertTrue(faults != null); 68 assertEquals("invalid number of registered faults", 69 2, faults.size()); 70 71 72 } 73 74 } 75 | Popular Tags |