1 22 package org.jboss.test.webservice.jbws663; 23 24 import javax.naming.InitialContext ; 25 import javax.xml.rpc.Service ; 26 27 import junit.framework.Test; 28 29 import org.jboss.test.webservice.WebserviceTestBase; 30 import org.jboss.test.webservice.jbws663.holders.ResponseInfoHolder; 31 import org.jboss.test.webservice.jbws663.holders.SubscriptionInfoHolder; 32 33 41 public class JBWS663WrappedBoundTestCase extends WebserviceTestBase 42 { 43 private static SMSTextMessagingSoapWrappedBound port; 44 45 public JBWS663WrappedBoundTestCase(String name) 46 { 47 super(name); 48 } 49 50 51 public static Test suite() throws Exception 52 { 53 return getDeploySetupForJBossWS(JBWS663WrappedBoundTestCase.class, "ws4ee-jbws663wb.war, ws4ee-jbws663wb-client.jar"); 54 } 55 56 protected void setUp() throws Exception 57 { 58 super.setUp(); 59 if (port == null && isJBossWSAvailable()) 60 { 61 InitialContext iniCtx = getClientContext(); 62 Service service = (Service )iniCtx.lookup("java:comp/env/service/SMSService"); 63 port = (SMSTextMessagingSoapWrappedBound)service.getPort(SMSTextMessagingSoapWrappedBound.class); 64 } 65 } 66 67 public void testCreateService() throws Exception 68 { 69 if (isJBossWSAvailable()) 70 { 71 assertNotNull("port not null", port); 72 } 73 } 74 75 public void testSendMessage() throws Exception 76 { 77 if (isJBossWSAvailable()) 78 { 79 LicenseInfo li = new LicenseInfo(null, new RegisteredUser("kermit", "thefrog")); 80 ResponseInfoHolder rih = new ResponseInfoHolder(); 81 SubscriptionInfoHolder sih = new SubscriptionInfoHolder(); 82 SMSTextMessageTargetStatus status = port.sendMessage("1234", "5678", "Kermit", "I luv Piggy", li, rih, sih); 83 84 assertNotNull("status not null", status); 85 assertEquals(100, status.getMessageStatus().getStatusCode()); 86 assertEquals("ok", status.getMessageStatus().getStatusText()); 87 assertEquals("kermit", status.getMessageStatus().getStatusExtra()); 88 89 assertEquals("all ok", rih.value.getResponse()); 90 assertEquals("valid", sih.value.getLicenseStatus()); 91 } 92 } 93 } 94 | Popular Tags |