1 57 58 package providers; 59 60 import javax.wsdl.Definition; 61 import javax.wsdl.PortType; 62 import javax.wsdl.Service; 63 import junit.framework.Test; 64 import junit.framework.TestCase; 65 import junit.framework.TestSuite; 66 import junit.textui.TestRunner; 67 import org.apache.wsif.WSIFPort; 68 import org.apache.wsif.WSIFService; 69 import org.apache.wsif.WSIFServiceFactory; 70 import org.apache.wsif.util.WSIFUtils; 71 72 import util.TestUtilities; 73 74 public class ProvidersInitialisationTest extends TestCase { 75 76 String wsdlLocation = 77 TestUtilities.getWsdlPath("java\\test\\stockquote\\wsifservice") 78 + "Stockquote.wsdl"; 79 80 public ProvidersInitialisationTest(String name) { 81 super(name); 82 } 83 84 public static void main(String [] args) { 85 TestRunner.run(suite()); 86 } 87 88 public static Test suite() { 89 return new TestSuite(ProvidersInitialisationTest.class); 90 } 91 92 public void setUp() { 93 TestUtilities.setUpExtensionsAndProviders(); 94 } 95 96 public void testRegistered() { 97 try { 98 Definition def = WSIFUtils.readWSDL(null, wsdlLocation); 100 Service service = WSIFUtils.selectService(def, null, null); 101 PortType portType = WSIFUtils.selectPortType(def, null, null); 102 WSIFServiceFactory factory = WSIFServiceFactory.newInstance(); 105 WSIFService wsifService = factory.getService(def, service, portType); 106 String portName = "JavaPort"; 108 WSIFPort port = wsifService.getPort(portName); 109 assertTrue("WSIFPort was created correctly", true); 111 } catch (Exception e) { 112 assertTrue("Couldn't create JavaPort so bindings not registered false", false); 113 } 114 } 115 } 116 | Popular Tags |