gdaniels 02/03/22 13:26:01 Modified: java/test/RPCDispatch TestSerializedRPC.java Log: Cope with the debug flag being off by making sure that the param names we use in the testOutOfOrderParams test match whatever is in the operation metadata (i.e. "in0", "in1" when there's no debug info). Revision Changes Path 1.28 +23 -2 xml-axis/java/test/RPCDispatch/TestSerializedRPC.java Index: TestSerializedRPC.java =================================================================== RCS file: /home/cvs/xml-axis/java/test/RPCDispatch/TestSerializedRPC.java,v retrieving revision 1.27 retrieving revision 1.28 diff -u -r1.27 -r1.28 --- TestSerializedRPC.java 22 Mar 2002 16:08:32 -0000 1.27 +++ TestSerializedRPC.java 22 Mar 2002 21:26:01 -0000 1.28 @@ -6,6 +6,8 @@ import org.apache.axis.Handler; import org.apache.axis.Message; import org.apache.axis.MessageContext; +import org.apache.axis.description.ServiceDesc; +import org.apache.axis.description.OperationDesc; import org.apache.axis.providers.java.RPCProvider; import org.apache.axis.configuration.SimpleProvider; import org.apache.axis.encoding.ser.BeanSerializerFactory; @@ -45,6 +47,9 @@ private SimpleProvider provider = new SimpleProvider(); private AxisServer engine = new AxisServer(provider); + + String firstParamName = null; + String secondParamName = null; private String SOAPAction = "urn:reverse"; @@ -57,7 +62,7 @@ reverse.setOption("className", "test.RPCDispatch.Service"); reverse.setOption("allowedMethods", "*"); provider.deployService(SOAPAction, reverse); - + // And deploy the type mapping Class javaType = Data.class; QName xmlType = new QName("urn:foo", "Data"); @@ -71,6 +76,20 @@ tmr.register(Constants.URI_CURRENT_SOAP_ENC, tm); } tm.register(javaType, xmlType, sf, df); + + ServiceDesc desc = new ServiceDesc(); + desc.loadServiceDescByIntrospection(Service.class, tm); + reverse.setServiceDescription(desc); + + // Now we've got the service description loaded up. We're going to + // be testing parameter dispatch by name, so if debug info isn't + // compiled into the Service class, the names are going to be "in0", + // etc. Make sure they match. + OperationDesc oper = desc.getOperationDescByName("concatenate"); + assertNotNull(oper); + + firstParamName = oper.getParameter(0).getName(); + secondParamName = oper.getParameter(1).getName(); } /** @@ -174,7 +193,9 @@ * Test out-of-order parameters, using the names to match */ public void testOutOfOrderParams() throws Exception { - String body = "<a2>world!</a2><a1>Hello, </a1>"; + String body = "<" + secondParamName + ">world!</" + + secondParamName + "><" + firstParamName + ">Hello, </" + + firstParamName + ">"; String expected = "Hello, world!"; assertEquals("Concatenated value was wrong", expected,