1 22 package org.jboss.test.webservice.jbws163; 23 24 import junit.framework.Test; 25 import org.jboss.test.webservice.WebserviceTestBase; 26 27 import javax.naming.InitialContext ; 28 import javax.xml.rpc.Service ; 29 import javax.xml.rpc.holders.BigIntegerHolder ; 30 import javax.xml.rpc.holders.IntHolder ; 31 import javax.xml.rpc.holders.LongHolder ; 32 import javax.xml.rpc.holders.ShortHolder ; 33 import java.math.BigInteger ; 34 35 42 public class JBWS163TestCase extends WebserviceTestBase 43 { 44 private static Hello hello; 45 46 48 public JBWS163TestCase(String name) 49 { 50 super(name); 51 } 52 53 54 public static Test suite() throws Exception 55 { 56 return getDeploySetup(JBWS163TestCase.class, "ws4ee-jbws163.war, ws4ee-jbws163-client.jar"); 57 } 58 59 protected void setUp() throws Exception 60 { 61 super.setUp(); 62 63 if (hello == null) 64 { 65 InitialContext iniCtx = getClientContext(); 66 Service service = (Service )iniCtx.lookup("java:comp/env/service/HelloService"); 67 hello = (Hello)service.getPort(Hello.class); 68 } 69 } 70 71 public void testNonPositiveInteger() throws Exception 72 { 73 BigInteger argIN = new BigInteger ("-100"); 74 BigIntegerHolder argINOUT = new BigIntegerHolder (new BigInteger ("-200")); 75 BigIntegerHolder argOUT = new BigIntegerHolder (); 76 hello.nonPositiveInteger(argIN, argINOUT, argOUT); 77 assertEquals(argINOUT.value, argIN); 78 assertEquals(argOUT.value, argIN); 79 } 80 81 public void testNegativeInteger() throws Exception 82 { 83 BigInteger argIN = new BigInteger ("-100"); 84 BigIntegerHolder argINOUT = new BigIntegerHolder (new BigInteger ("-200")); 85 BigIntegerHolder argOUT = new BigIntegerHolder (); 86 hello.negativeInteger(argIN, argINOUT, argOUT); 87 assertEquals(argINOUT.value, argIN); 88 assertEquals(argOUT.value, argIN); 89 } 90 91 public void testNonNegativeInteger() throws Exception 92 { 93 BigInteger argIN = new BigInteger ("100"); 94 BigIntegerHolder argINOUT = new BigIntegerHolder (new BigInteger ("200")); 95 BigIntegerHolder argOUT = new BigIntegerHolder (); 96 hello.nonNegativeInteger(argIN, argINOUT, argOUT); 97 assertEquals(argINOUT.value, argIN); 98 assertEquals(argOUT.value, argIN); 99 } 100 101 public void testUnsignedLong() throws Exception 102 { 103 BigInteger argIN = new BigInteger ("100"); 104 BigIntegerHolder argINOUT = new BigIntegerHolder (new BigInteger ("200")); 105 BigIntegerHolder argOUT = new BigIntegerHolder (); 106 hello.unsignedLong(argIN, argINOUT, argOUT); 107 assertEquals(argINOUT.value, argIN); 108 assertEquals(argOUT.value, argIN); 109 } 110 111 public void testPositiveInteger() throws Exception 112 { 113 BigInteger argIN = new BigInteger ("100"); 114 BigIntegerHolder argINOUT = new BigIntegerHolder (new BigInteger ("200")); 115 BigIntegerHolder argOUT = new BigIntegerHolder (); 116 hello.positiveInteger(argIN, argINOUT, argOUT); 117 assertEquals(argINOUT.value, argIN); 118 assertEquals(argOUT.value, argIN); 119 } 120 121 public void testUnsignedInt() throws Exception 122 { 123 long argIN = 100; 124 LongHolder argINOUT = new LongHolder (200); 125 LongHolder argOUT = new LongHolder (); 126 hello.unsignedInt(argIN, argINOUT, argOUT); 127 assertEquals(argINOUT.value, argIN); 128 assertEquals(argOUT.value, argIN); 129 } 130 131 public void testUnsignedShort() throws Exception 132 { 133 int argIN = 100; 134 IntHolder argINOUT = new IntHolder (200); 135 IntHolder argOUT = new IntHolder (); 136 hello.unsignedShort(argIN, argINOUT, argOUT); 137 assertEquals(argINOUT.value, argIN); 138 assertEquals(argOUT.value, argIN); 139 } 140 141 public void testUnsignedByte() throws Exception 142 { 143 short argIN = 100; 144 ShortHolder argINOUT = new ShortHolder ((short)200); 145 ShortHolder argOUT = new ShortHolder (); 146 hello.unsignedByte(argIN, argINOUT, argOUT); 147 assertEquals(argINOUT.value, argIN); 148 assertEquals(argOUT.value, argIN); 149 } 150 } 151 | Popular Tags |