You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beehive.apache.org by ek...@apache.org on 2005/06/16 16:45:47 UTC
svn commit: r190926 - in /incubator/beehive/trunk/system-controls:
src/webservice/org/apache/beehive/controls/system/webservice/jaxrpc/ServiceControlImpl.jcs
test/src/webservice/tests/org/apache/beehive/controls/system/webservice/units/SoapMarshallingDocLitWrappedArrayTypesTest.java
Author: ekoneil
Date: Thu Jun 16 07:45:46 2005
New Revision: 190926
URL: http://svn.apache.org/viewcvs?rev=190926&view=rev
Log:
Fix for BEEHIVe-822. The service control now correctly handles primitive array types. This change also converts the internal exception handling to remove unnecessary "throws Exception" clauses into throwing a ControlException out of the "invoke" method.
Additional primitive array tests have been enabled as well.
Contribution from Chad Schoettger.
BB: self
DRT: service control pass
Modified:
incubator/beehive/trunk/system-controls/src/webservice/org/apache/beehive/controls/system/webservice/jaxrpc/ServiceControlImpl.jcs
incubator/beehive/trunk/system-controls/test/src/webservice/tests/org/apache/beehive/controls/system/webservice/units/SoapMarshallingDocLitWrappedArrayTypesTest.java
Modified: incubator/beehive/trunk/system-controls/src/webservice/org/apache/beehive/controls/system/webservice/jaxrpc/ServiceControlImpl.jcs
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/system-controls/src/webservice/org/apache/beehive/controls/system/webservice/jaxrpc/ServiceControlImpl.jcs?rev=190926&r1=190925&r2=190926&view=diff
==============================================================================
--- incubator/beehive/trunk/system-controls/src/webservice/org/apache/beehive/controls/system/webservice/jaxrpc/ServiceControlImpl.jcs (original)
+++ incubator/beehive/trunk/system-controls/src/webservice/org/apache/beehive/controls/system/webservice/jaxrpc/ServiceControlImpl.jcs Thu Jun 16 07:45:46 2005
@@ -26,6 +26,7 @@
import java.lang.reflect.Type;
import java.net.MalformedURLException;
import java.net.URL;
+import java.rmi.RemoteException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@@ -48,6 +49,9 @@
import org.apache.beehive.controls.api.bean.Extensible;
import org.apache.beehive.controls.api.context.Context;
import org.apache.beehive.controls.api.context.ControlBeanContext;
+import org.apache.beehive.controls.api.ControlException;
+import org.apache.beehive.controls.system.webservice.ServiceControl;
+import org.apache.beehive.controls.system.webservice.utils.HolderUtils;
import org.apache.beehive.wsm.axis.databinding.SystemTypeLookupService;
import org.apache.beehive.wsm.axis.registration.AxisTypeRegistrar;
import org.apache.beehive.wsm.databinding.BindingLookupService;
@@ -56,10 +60,9 @@
import org.apache.beehive.wsm.model.BeehiveWsTypeMetadata;
import org.apache.beehive.wsm.model.wsdl.XmlBeanWSDLProcessor;
import org.apache.beehive.wsm.registration.TypeRegistrar;
-import org.apache.beehive.controls.system.webservice.ServiceControl;
-import org.apache.beehive.controls.system.webservice.utils.HolderUtils;
import org.apache.beehive.wsm.wsdl.Utilities;
import org.apache.log4j.Logger;
+import org.apache.xmlbeans.XmlException;
import org.w3c.dom.Element;
import org.xmlsoap.schemas.wsdl.DefinitionsDocument;
@@ -104,8 +107,6 @@
public Object invoke(Method method, Object[] args)
throws NoSuchMethodException, Exception {
- assert method != null;
-
logger.debug("invoke method: " + method.getName());
initialize();
String operationName = method.getName();
@@ -119,11 +120,16 @@
Object[] callArgs = prepareArgsForSend(method, wmm, args);
- Object res = call.invoke(callArgs);
- fillHolders(method, wmm, call, args);
+ Object res = null;
+ try {
+ res = call.invoke(callArgs);
+ } catch (RemoteException e) {
+ throw new ControlException(e.getMessage(), e);
+ }
- return res;
- }
+ fillHolders(method, wmm, call, args);
+ return res;
+ }
// create a new copy of the args where holders value have been extracted.
// ignore the out values
@@ -144,15 +150,15 @@
if ((nxtParamMetaData.getWpMode() == WebParam.Mode.INOUT)
&& Holder.class.isAssignableFrom(javaTypeFromClass)) {
- try {
- Holder holder = (Holder) args[i];
- Field valueField = holder.getClass().getField("value");
- argsList.add(valueField.get(holder));
- } catch (Exception e) {
- throw new RuntimeException(
- "failed in getting holder value for: "
- + nxtParamMetaData.getWpName());
- }
+ try {
+ Holder holder = (Holder) args[i];
+ Field valueField = holder.getClass().getField("value");
+ argsList.add(valueField.get(holder));
+ } catch (Exception e) {
+ throw new ControlException(
+ "failed in getting holder value for: "
+ + nxtParamMetaData.getWpName());
+ }
} else {
argsList.add(args[i]);
@@ -209,9 +215,9 @@
if (hasReturnValue)
stuffHolderValue(holder, value);
- } catch (Exception e) {
- throw new RuntimeException("Failed in getting holder value for: " + nxtParamMetaData.getWpName());
- }
+ } catch (Exception e) {
+ throw new ControlException("Failed in getting holder value for: " + nxtParamMetaData.getWpName());
+ }
} else {
continue;
@@ -234,92 +240,98 @@
private Call buildCallObject(Method method, BeehiveWsMethodMetadata wmm)
throws ServiceException, Exception {
- // TODO: Later cache the call objects for each method.
+ // TODO: Later cache the call objects for each method.
+ Call call = null;
+ try {
+ call = service.createCall();
+ } catch (ServiceException se) {
+ throw new ControlException(se.getMessage(), se);
+ }
- Call call = service.createCall();
- if (getWsdlPort() != null) {
- call.setPortTypeName(getWsdlPort());
- }
- if (getUsername() != null) {
- call.setProperty(Call.USERNAME_PROPERTY, getUsername());
- }
- if (getPassword() != null) {
- call.setProperty(Call.PASSWORD_PROPERTY, getPassword());
- }
- call.setOperationName(
- new javax.xml.namespace.QName(mWSTM.getWsTargetNamespace(), wmm.getWmOperationName()));
+ if (getWsdlPort() != null) {
+ call.setPortTypeName(getWsdlPort());
+ }
- // The target endpoint
- logger.debug("endpoint: " + getEndPoint().toExternalForm());
- call.setTargetEndpointAddress(getEndPoint().toExternalForm());
- //
- // NO TImeout property in the JaxRPC
- // int timeout = serviceControl.getTimeout();
- // if (timeout != 0) {
- // call.setTimeout(new Integer(timeout));
- // }
-
- // set style
- SOAPBinding.Style omStyle = mWSTM.getSoapBinding().getStyle();
- String style;
- if (omStyle == SOAPBinding.Style.DOCUMENT) {
- if (mWSTM.getSoapBinding().getParameterStyle() == SOAPBinding.ParameterStyle.WRAPPED)
- // wrapped implies document also!
- style = "wrapped";
- else
- style = "document";
- } else if (omStyle == SOAPBinding.Style.RPC)
- style = "rpc";
- else
- throw new RuntimeException("Ivalid Binding style: " + omStyle);
+ if (getUsername() != null) {
+ call.setProperty(Call.USERNAME_PROPERTY, getUsername());
+ }
- logger.debug("Call style: " + style);
- call.setProperty(Call.OPERATION_STYLE_PROPERTY, style);
+ if (getPassword() != null) {
+ call.setProperty(Call.PASSWORD_PROPERTY, getPassword());
+ }
- if ("rpc".equals(style) && SOAPBinding.Use.LITERAL == mWSTM.getSoapBinding().getUse()) {
- ((org.apache.axis.client.Call) call).setOperationUse(Use.LITERAL);
- }
- // walk the argument meta data list, register type of parameters, add
- // parameters to the
- // call object
- // TODO: Make sure there is nothing special that needs to be done about
- // holder objects.
- List<BeehiveWsParameterMetadata> omArgMetaDataList = new ArrayList<BeehiveWsParameterMetadata>();
- omArgMetaDataList.addAll(wmm.getParams());
+ call.setOperationName(
+ new javax.xml.namespace.QName(mWSTM.getWsTargetNamespace(), wmm.getWmOperationName()));
- Class[] methodParameterTypes = method.getParameterTypes();
- Type[] genericMethodParamTypes = method.getGenericParameterTypes();
+ // The target endpoint
+ logger.debug("endpoint: " + getEndPoint().toExternalForm());
+ call.setTargetEndpointAddress(getEndPoint().toExternalForm());
+
+ // set style
+ SOAPBinding.Style omStyle = mWSTM.getSoapBinding().getStyle();
+ String style;
+ if (omStyle == SOAPBinding.Style.DOCUMENT) {
+ if (mWSTM.getSoapBinding().getParameterStyle() == SOAPBinding.ParameterStyle.WRAPPED) {
+ // wrapped implies document
+ style = "wrapped";
+ } else {
+ style = "document";
+ }
+ } else if (omStyle == SOAPBinding.Style.RPC) {
+ style = "rpc";
+ } else {
+ throw new ControlException("Invalid Binding style: " + omStyle);
+ }
- if (omArgMetaDataList.size() != methodParameterTypes.length)
- throw new RuntimeException("Object model and method definition don't match!");
- List argsToSend = new ArrayList<Object>();
- for (int i = 0; i < methodParameterTypes.length; i++) {
+ logger.debug("Call style: " + style);
+ call.setProperty(Call.OPERATION_STYLE_PROPERTY, style);
- BeehiveWsParameterMetadata nxtArgMetaData = omArgMetaDataList.get(i);
- Class javaTypeFromClass = methodParameterTypes[i];
+ if ("rpc".equals(style) && SOAPBinding.Use.LITERAL == mWSTM.getSoapBinding().getUse()) {
+ ((org.apache.axis.client.Call) call).setOperationUse(Use.LITERAL);
+ }
- // make sure the type is registered
- ParameterMode mode;
- WebParam.Mode omMode = nxtArgMetaData.getWpMode();
- if (omMode == WebParam.Mode.IN)
- mode = ParameterMode.IN;
- else if (omMode == WebParam.Mode.OUT)
- mode = ParameterMode.OUT;
- else if (omMode == WebParam.Mode.INOUT) {
- if (!Holder.class.isAssignableFrom(javaTypeFromClass))
- throw new RuntimeException("Holder classes are required for the in/out parameters.");
- mode = ParameterMode.INOUT;
- } else
- throw new RuntimeException("Invalid parameter mode: " + omMode);
-
- // if mode is in or in/out and the type is holder then holder, get
- // its value type
- QName registeredTypeQName;
+ // walk the argument meta data list, register type of parameters, add
+ // parameters to the call object
+ // TODO: Make sure there is nothing special that needs to be done about holder objects.
+ List<BeehiveWsParameterMetadata> omArgMetaDataList = new ArrayList<BeehiveWsParameterMetadata>();
+ omArgMetaDataList.addAll(wmm.getParams());
- if ((mode == ParameterMode.OUT || mode == ParameterMode.INOUT)
- && Holder.class.isAssignableFrom(javaTypeFromClass)) {
- javaTypeFromClass = TypeRegistrar.getHoldersValueClass(genericMethodParamTypes[i]);
- }
+ Class[] methodParameterTypes = method.getParameterTypes();
+ Type[] genericMethodParamTypes = method.getGenericParameterTypes();
+
+ if (omArgMetaDataList.size() != methodParameterTypes.length) {
+ throw new ControlException("Object model and method definition don't match!");
+ }
+
+ for (int i = 0; i < methodParameterTypes.length; i++) {
+
+ BeehiveWsParameterMetadata nxtArgMetaData = omArgMetaDataList.get(i);
+ Class javaTypeFromClass = methodParameterTypes[i];
+
+ // make sure the type is registered
+ ParameterMode mode;
+ WebParam.Mode omMode = nxtArgMetaData.getWpMode();
+ if (omMode == WebParam.Mode.IN) {
+ mode = ParameterMode.IN;
+ } else if (omMode == WebParam.Mode.OUT) {
+ mode = ParameterMode.OUT;
+ } else if (omMode == WebParam.Mode.INOUT) {
+ if (!Holder.class.isAssignableFrom(javaTypeFromClass)) {
+ throw new ControlException("Holder classes are required for the in/out parameters.");
+ }
+ mode = ParameterMode.INOUT;
+ } else {
+ throw new ControlException("Invalid parameter mode: " + omMode);
+ }
+
+ // if mode is in or in/out and the type is holder then holder, get
+ // its value type
+ QName registeredTypeQName;
+
+ if ((mode == ParameterMode.OUT || mode == ParameterMode.INOUT)
+ && Holder.class.isAssignableFrom(javaTypeFromClass)) {
+ javaTypeFromClass = TypeRegistrar.getHoldersValueClass(genericMethodParamTypes[i]);
+ }
registeredTypeQName =
registrar.registerType(javaTypeFromClass,
@@ -346,8 +358,6 @@
}
// register the return type
if (!wmm.isOneWay()) {
- // QName xmlTypeFromWSDL = new QName(wmm.getWrTargetNamespace(),
- // wmm.getWrName()); //wmm.getXmlReturnType();
Class javaTypeFromClass = method.getReturnType();
QName resultsRegisteredTypeQName = registrar.registerType(
javaTypeFromClass,
@@ -355,11 +365,7 @@
mWSTM.getSoapBinding().getStyle(),
mWSTM.getSoapBinding().getUse());
- call.setReturnType(resultsRegisteredTypeQName);
-// if ("rpc".equals(style)) {
-// ((org.apache.axis.client.Call) call).setReturnQName(new QName("", "return")); // Hack, may need this for google! TBD, verify the need for this.
-// ((org.apache.axis.client.Call) call).setReturnClass(javaTypeFromClass); // Hack, may need this for google! TBD, verify the need for this.
-// }
+ call.setReturnType(resultsRegisteredTypeQName, javaTypeFromClass);
} else
call.setReturnType(registrar.getVoidType());
// AXIS dependecy... this is needed for the Handlers
@@ -371,10 +377,8 @@
/**
* @param method
* @param operationName
- * @throws Exception
*/
- private BeehiveWsMethodMetadata findMethodInOM(Method method, String operationName)
- throws NoSuchMethodException, Exception {
+ private BeehiveWsMethodMetadata findMethodInOM(Method method, String operationName) {
// the obejct model doesn't store holders, rather the underlying
// types, so to get the method
@@ -402,14 +406,13 @@
sb.append(cls.getName());
}
sb.append(')');
- throw new NoSuchMethodException(sb.toString());
+ throw new ControlException("", new NoSuchMethodException(sb.toString()));
}
return wmm;
}
- private synchronized void initialize()
- throws Exception {
+ private synchronized void initialize() {
if (initialized)
return;
@@ -420,11 +423,15 @@
wsdlProcessor = new XmlBeanWSDLProcessor(parseWSDL(), lookupService);
assert wsdlProcessor != null : "Did not find a valid WSDL processor";
- mWSTM = wsdlProcessor.getObjectModel();
-
- ServiceFactory factory = ServiceFactory.newInstance();
- service = factory.createService(wsdlProcessor.getServiceName());
+ try {
+ mWSTM = wsdlProcessor.getObjectModel();
+ service = ServiceFactory.newInstance().createService(wsdlProcessor.getServiceName());
+ } catch (ServiceException se) {
+ throw new ControlException(se.getMessage(), se);
+ } catch (Exception e) {
+ throw new ControlException(e.getMessage(), e);
+ }
HandlerInfo hInfo = new HandlerInfo();
hInfo.setHandlerClass(HeaderHandler.class);
@@ -455,8 +462,7 @@
return null;
}
- private DefinitionsDocument parseWSDL()
- throws Exception {
+ private DefinitionsDocument parseWSDL() {
File f = null;
URL url = null;
@@ -467,66 +473,76 @@
assert(wsdl != null) : "The control is mising the required @WSDL annotations";
assert(wsdl.path() != null) : "The control is missing the required path attribute for the @WSDL annotations";
-
- if(wsdl == null)
- throw new RuntimeException("No WSDL annotation found.");
+
+ if (wsdl == null)
+ throw new ControlException("No WSDL annotation found.");
logger.debug("read wsdl from: " + wsdl.path());
-
- if ( wsdl.path().startsWith("http://") || wsdl.path().startsWith("file:/")) {
- url = new URL( wsdl.path());
- wsdlStream = url.openStream();
- }
- else { // it is a local file name
- wsdlStream = cbContext.getBeanContext().getResourceAsStream( wsdl.path(), null);
- if (wsdlStream == null) {
- logger.info("Failed to load the wsdl from context, will try classloader!");
- wsdlStream = this.getClass().getClassLoader().getResourceAsStream(wsdl.path());
+ if (wsdl.path().startsWith("http://") || wsdl.path().startsWith("file:/")) {
+ url = new URL(wsdl.path());
+ wsdlStream = url.openStream();
+ } else { // it is a local file name
+ wsdlStream = cbContext.getBeanContext().getResourceAsStream(wsdl.path(), null);
+
+ if (wsdlStream == null) {
+ logger.info("Failed to load the wsdl from context, will try classloader!");
+ wsdlStream = this.getClass().getClassLoader().getResourceAsStream(wsdl.path());
/*
todo: why does this try to load from a hard file path?
this value is generally unstable in a running server
*/
- if(null == wsdlStream) {
- f = new File(wsdl.path());
- wsdlStream = new FileInputStream(f);
- }
- }
- }
- return Utilities.parseWSDL(wsdlStream);
- } catch (MalformedURLException e) {
- logger.error("ERROR: WSDL is not found, invalid URL " + url);
- throw e;
- } catch (FileNotFoundException e) {
- logger.error("ERROR: WSDL File not found: " + f.getCanonicalPath());
- throw e;
- } catch (IOException e) {
- logger.error("ERROR: IO Exception in reading WSDL File" );
- throw e;
- } finally {
- if(wsdlStream != null)
- wsdlStream.close();
+ if (null == wsdlStream) {
+ f = new File(wsdl.path());
+ wsdlStream = new FileInputStream(f);
+ }
+ }
+ }
+ return Utilities.parseWSDL(wsdlStream);
+ } catch (MalformedURLException e) {
+ logger.error("ERROR: WSDL is not found, invalid URL " + url);
+ throw new ControlException("ERROR: WSDL is not found, invalid URL " + url, e);
+ } catch (FileNotFoundException e) {
+ String fpath = null;
+ try {
+ fpath = f.getCanonicalPath();
+ } catch (IOException ioe) { }
+ logger.error("ERROR: WSDL File not found: " + fpath);
+ throw new ControlException("ERROR: WSDL File not found: " + fpath, e);
+ } catch (IOException e) {
+ logger.error("ERROR: IO Exception in reading WSDL File");
+ throw new ControlException("ERROR: IO Exception in reading WSDL File.", e);
+ } catch (XmlException e) {
+ throw new ControlException(e.getMessage(), e);
}
- }
+ finally {
+ if (wsdlStream != null) {
+ try { wsdlStream.close(); } catch (IOException ioe) {}
+ }
+ }
+ }
+
+ private void configureEndPoint() {
- private void configureEndPoint()
- throws Exception {
-
- if (null == getEndPoint()) {
- ServiceControl.Location location =
- (ServiceControl.Location)cbContext.getControlPropertySet(ServiceControl.Location.class);
+ if (getEndPoint() == null) {
+ ServiceControl.Location location =
+ (ServiceControl.Location) cbContext.getControlPropertySet(ServiceControl.Location.class);
if (location != null) {
assert location.urls() != null;
assert location.urls().length > 0;
- setEndPoint(new URL(location.urls()[0]));
- } else {
- throw new RuntimeException("No Location annotation found.");
- }
- }
- }
+ try {
+ setEndPoint(new URL(location.urls()[0]));
+ } catch (MalformedURLException e) {
+ throw new ControlException(e.getMessage(), e);
+ }
+ } else {
+ throw new ControlException("No Location annotation found.");
+ }
+ }
+ }
/**
* @return Returns the endPoint.
@@ -627,7 +643,7 @@
}
/**
- *
+ *
*/
public void reset() {
endPoint = null;
@@ -640,7 +656,7 @@
/*
* @see org.apache.beehive.controls.system.webservice.ServiceControl#getInputHeaders()
- *
+ *
* If there are any input header it is stored on my thread's Handler.
*/
public Element[] getInputHeaders() {
Modified: incubator/beehive/trunk/system-controls/test/src/webservice/tests/org/apache/beehive/controls/system/webservice/units/SoapMarshallingDocLitWrappedArrayTypesTest.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/system-controls/test/src/webservice/tests/org/apache/beehive/controls/system/webservice/units/SoapMarshallingDocLitWrappedArrayTypesTest.java?rev=190926&r1=190925&r2=190926&view=diff
==============================================================================
--- incubator/beehive/trunk/system-controls/test/src/webservice/tests/org/apache/beehive/controls/system/webservice/units/SoapMarshallingDocLitWrappedArrayTypesTest.java (original)
+++ incubator/beehive/trunk/system-controls/test/src/webservice/tests/org/apache/beehive/controls/system/webservice/units/SoapMarshallingDocLitWrappedArrayTypesTest.java Thu Jun 16 07:45:46 2005
@@ -1,4 +1,5 @@
/*
+ *
* Copyright 2004 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -12,6 +13,7 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
+ *
*/
package org.apache.beehive.controls.system.webservice.units;
@@ -31,18 +33,16 @@
import java.util.GregorianCalendar;
import java.util.Arrays;
-
public class SoapMarshallingDocLitWrappedArrayTypesTest
extends ControlTestCase {
@Control
public SoapMarshallingDocLitWrappedArrayTypesService client;
-// @todo: fails
-// public void testEchobooleanArray() throws Exception {
-// boolean[] array = new boolean[] {true, false, true};
-// assertTrue(Arrays.equals(array, client.echoboolean(array)));
-// }
+ public void testEchobooleanArray() throws Exception {
+ boolean[] array = new boolean[] {true, false, true};
+ assertTrue(Arrays.equals(array, client.echoboolean(array)));
+ }
// @todo: Verify if webservice control method generation is correct!
// public void testEchoBooleanArray() throws Exception {
@@ -61,11 +61,10 @@
// assertEquals(array, client.echoByte(array));
// }
-// @todo: fails
-// public void testEchoshortArray() throws Exception {
-// short[] array = new short[] {Short.MAX_VALUE, 0, Short.MAX_VALUE};
-// assertTrue(Arrays.equals(array, client.echoshort(array)));
-// }
+ public void testEchoshortArray() throws Exception {
+ short[] array = new short[] {Short.MAX_VALUE, 0, Short.MAX_VALUE};
+ assertTrue(Arrays.equals(array, client.echoshort(array)));
+ }
// @todo: Verify if webservice control method generation is correct!
// public void testEchoShortArray() throws Exception {
@@ -73,11 +72,10 @@
// assertEquals(array, client.echoShort(array));
// }
-// @todo: fails
-// public void testEchointArray() throws Exception {
-// int[] array = new int[] {Integer.MAX_VALUE, 0, Integer.MAX_VALUE};
-// assertTrue(Arrays.equals(array, client.echoint(array)));
-// }
+ public void testEchointArray() throws Exception {
+ int[] array = new int[] {Integer.MAX_VALUE, 0, Integer.MAX_VALUE};
+ assertTrue(Arrays.equals(array, client.echoint(array)));
+ }
// @todo: Verify if webservice control method generation is correct!
// public void testEchoIntegerArray() throws Exception {
@@ -85,11 +83,10 @@
// assertEquals(array, client.echoInteger(array));
// }
-// @todo: fails
-// public void testEcholongArray() throws Exception {
-// long[] array = new long[] {Long.MAX_VALUE, 0, Long.MAX_VALUE};
-// assertTrue(Arrays.equals(array, client.echolong(array)));
-// }
+ public void testEcholongArray() throws Exception {
+ long[] array = new long[] {Long.MAX_VALUE, 0, Long.MAX_VALUE};
+ assertTrue(Arrays.equals(array, client.echolong(array)));
+ }
// @todo: Verify if webservice control method generation is correct!
// public void testEchoLongArray() throws Exception {
@@ -98,16 +95,15 @@
// }
// @todo: fails
-// public void testEchoBigIntegerArray() throws Exception {
-// BigInteger[] array = new BigInteger[] {BigInteger.TEN, BigInteger.ONE, BigInteger.TEN};
-// assertTrue(Arrays.equals(array, client.echoBigInteger(array)));
-// }
+ public void testEchoBigIntegerArray() throws Exception {
+ BigInteger[] array = new BigInteger[] {BigInteger.TEN, BigInteger.ONE, BigInteger.TEN};
+ assertTrue(Arrays.equals(array, client.echoBigInteger(array)));
+ }
-// @todo: fails
-// public void testEchofloatArray() throws Exception {
-// float[] array = new float[] {Float.MAX_VALUE, 0, Float.MAX_VALUE};
-// assertTrue(Arrays.equals(array, client.echofloat(array)));
-// }
+ public void testEchofloatArray() throws Exception {
+ float[] array = new float[] {Float.MAX_VALUE, 0, Float.MAX_VALUE};
+ assertTrue(Arrays.equals(array, client.echofloat(array)));
+ }
// @todo: Verify if webservice control method generation is correct!
// public void testEchoFloatArray() throws Exception {
@@ -115,10 +111,10 @@
// assertEquals(array, client.echoFloat(array));
// }
-// public void testEchodoubleArray() throws Exception {
-// double[] array = new double[] {Double.MAX_VALUE, 0, Double.MAX_VALUE};
-// assertTrue(Arrays.equals(array, client.echodouble(array)));
-// }
+ public void testEchodoubleArray() throws Exception {
+ double[] array = new double[] {Double.MAX_VALUE, 0, Double.MAX_VALUE};
+ assertTrue(Arrays.equals(array, client.echodouble(array)));
+ }
// @todo: Verify if webservice control method generation is correct!
// public void testEchoDoubleArray() throws Exception {
@@ -126,17 +122,15 @@
// assertEquals(array, client.echoDouble(array));
// }
-// @todo: fails
-// public void testEchoBigDecimalArray() throws Exception {
-// BigDecimal[] array = new BigDecimal[] {BigDecimal.TEN, BigDecimal.ONE, BigDecimal.TEN};
-// assertTrue(Arrays.equals(array, client.echoBigDecimal(array)));
-// }
+ public void testEchoBigDecimalArray() throws Exception {
+ BigDecimal[] array = new BigDecimal[] {BigDecimal.TEN, BigDecimal.ONE, BigDecimal.TEN};
+ assertTrue(Arrays.equals(array, client.echoBigDecimal(array)));
+ }
-// @todo: fails
-// public void testEchoStringArray() throws Exception {
-// String[] array = new String[] {"Hello", ",", "World!"};
-// assertTrue(Arrays.equals(array, client.echoString(array)));
-// }
+ public void testEchoStringArray() throws Exception {
+ String[] array = new String[] {"Hello", ",", "World!"};
+ assertTrue(Arrays.equals(array, client.echoString(array)));
+ }
// @todo: fails
// public void testEchoGregorianCalendarArray() throws Exception {
@@ -146,7 +140,6 @@
// assertTrue(Arrays.equals(array, client.echoGregorianCalendar(array)));
// }
- // TODO: Sort this out - control is being gened with Calendar instead of Date
// @todo: fails
// public void testEchoDateArray() throws Exception {
// Calendar cal = new GregorianCalendar();
@@ -179,15 +172,12 @@
// assertTrue(Arrays.equals(array, client.echoGDuration(array)));
// }
-// @todo: fails
-// public void testEchoQNameArray() throws Exception {
-// QName qname = new QName("http://foo.bar", "foofoo");
-// QName array[] = new QName[] { qname, qname };
-// assertTrue(Arrays.equals(array, client.echoQName(array)));
-// }
-
+ public void testEchoQNameArray() throws Exception {
+ QName qname = new QName("http://foo.bar", "foofoo");
+ QName array[] = new QName[] { qname, qname };
+ assertTrue(Arrays.equals(array, client.echoQName(array)));
+ }
-
public void setUp() throws Exception {
try {
super.setUp();
@@ -199,9 +189,15 @@
}
}
- public SoapMarshallingDocLitWrappedArrayTypesTest() throws Exception { }
+ public SoapMarshallingDocLitWrappedArrayTypesTest()
+ throws Exception {
+ }
- public static Test suite() { return new TestSuite(SoapMarshallingDocLitWrappedArrayTypesTest.class); }
+ public static Test suite() {
+ return new TestSuite(SoapMarshallingDocLitWrappedArrayTypesTest.class);
+ }
- public static void main(String[] args) { junit.textui.TestRunner.run(suite()); }
+ public static void main(String[] args) {
+ junit.textui.TestRunner.run(suite());
+ }
}