1 7 8 package org.apache.axis.wsi.scm.retailer; 9 10 public class RetailerServiceTestCase extends junit.framework.TestCase { 11 public RetailerServiceTestCase(java.lang.String name) { 12 super(name); 13 } 14 15 23 24 public void test1RetailerPortGetCatalog() throws Exception { 25 org.apache.axis.wsi.scm.retailer.RetailerSoapBindingStub binding; 26 try { 27 binding = (org.apache.axis.wsi.scm.retailer.RetailerSoapBindingStub) 28 new org.apache.axis.wsi.scm.retailer.RetailerServiceLocator().getRetailerPort(); 29 } 30 catch (javax.xml.rpc.ServiceException jre) { 31 if(jre.getLinkedCause()!=null) 32 jre.getLinkedCause().printStackTrace(); 33 throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); 34 } 35 assertNotNull("binding is null", binding); 36 37 binding.setTimeout(60000); 39 40 org.apache.axis.wsi.scm.retailer.catalog.CatalogType catalog = null; 42 catalog = binding.getCatalog(); 43 45 assertNotNull("catalog is null", catalog); 46 47 org.apache.axis.wsi.scm.retailer.catalog.CatalogItem[] items = catalog.getItem(); 48 49 assertTrue(items.length > 0); 50 51 for (int i = 0; i < items.length; i++) { 52 System.out.println("------------------"); 53 System.out.println(items[i].getName()); 54 System.out.println(items[i].getBrand()); 55 } 56 } 57 58 public void test2RetailerPortSubmitOrder() throws Exception { 59 org.apache.axis.wsi.scm.retailer.RetailerSoapBindingStub binding; 60 try { 61 binding = (org.apache.axis.wsi.scm.retailer.RetailerSoapBindingStub) 62 new org.apache.axis.wsi.scm.retailer.RetailerServiceLocator().getRetailerPort(); 63 } 64 catch (javax.xml.rpc.ServiceException jre) { 65 if(jre.getLinkedCause()!=null) 66 jre.getLinkedCause().printStackTrace(); 67 throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); 68 } 69 assertNotNull("binding is null", binding); 70 71 binding.setTimeout(60000); 73 74 try { 76 org.apache.axis.wsi.scm.retailer.order.PartsOrderResponseType value = null; 77 value = binding.submitOrder(new org.apache.axis.wsi.scm.retailer.order.PartsOrderType(), new org.apache.axis.wsi.scm.retailer.order.CustomerDetailsType(), new org.apache.axis.wsi.scm.configuration.ConfigurationType()); 78 } 79 catch (org.apache.axis.wsi.scm.retailer.order.InvalidProductCodeType e1) { 80 throw new junit.framework.AssertionFailedError("InvalidProductCode Exception caught: " + e1); 81 } 82 catch (org.apache.axis.wsi.scm.retailer.BadOrderFault e2) { 83 throw new junit.framework.AssertionFailedError("BadOrder Exception caught: " + e2); 84 } 85 catch (org.apache.axis.wsi.scm.configuration.ConfigurationFaultType e3) { 86 throw new junit.framework.AssertionFailedError("ConfigurationFault Exception caught: " + e3); 87 } 88 } 90 91 } 92 | Popular Tags |