From 1072e3151c8fcad4554ca68908708f27b2aca149 Mon Sep 17 00:00:00 2001 From: nash Date: Sun, 27 Mar 2011 14:02:43 +0000 Subject: Add test for @WebParam annotation git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1085938 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/main/java/wsdlgen/verify/DataTypes.java | 8 ++++++-- .../java/wsdlgen/verify/impl/DataTypesImpl.java | 12 +++++++++-- .../java/wsdlgen/verify/DataTypesTestCase.java | 24 +++++++++++++++++----- 3 files changed, 35 insertions(+), 9 deletions(-) (limited to 'sca-java-1.x/trunk') diff --git a/sca-java-1.x/trunk/itest/wsdlgen-verify/src/main/java/wsdlgen/verify/DataTypes.java b/sca-java-1.x/trunk/itest/wsdlgen-verify/src/main/java/wsdlgen/verify/DataTypes.java index 23a062ff80..68b87d3947 100644 --- a/sca-java-1.x/trunk/itest/wsdlgen-verify/src/main/java/wsdlgen/verify/DataTypes.java +++ b/sca-java-1.x/trunk/itest/wsdlgen-verify/src/main/java/wsdlgen/verify/DataTypes.java @@ -54,11 +54,15 @@ public interface DataTypes { DataObject testDynamicSDO(); + void testWebParamSDO(@WebParam(name="foo") DataObject myObject); + + void testWebParamSDOArray(@WebParam(name="foo") DataObject[] myArray); /* + @SOAPBinding(parameterStyle=SOAPBinding.ParameterStyle.BARE) - void testWebParam(@WebParam(name="simpleInt") int simple); + void testWebParamBare(@WebParam(name="simpleInt") int simple); @SOAPBinding(parameterStyle=SOAPBinding.ParameterStyle.BARE) - void testWebParamArray(@WebParam(name="arrayInt") int[] array); + void testWebParamBareArray(@WebParam(name="arrayInt") int[] array); */ } diff --git a/sca-java-1.x/trunk/itest/wsdlgen-verify/src/main/java/wsdlgen/verify/impl/DataTypesImpl.java b/sca-java-1.x/trunk/itest/wsdlgen-verify/src/main/java/wsdlgen/verify/impl/DataTypesImpl.java index 13e17a63fa..55e59947ad 100644 --- a/sca-java-1.x/trunk/itest/wsdlgen-verify/src/main/java/wsdlgen/verify/impl/DataTypesImpl.java +++ b/sca-java-1.x/trunk/itest/wsdlgen-verify/src/main/java/wsdlgen/verify/impl/DataTypesImpl.java @@ -69,9 +69,17 @@ public class DataTypesImpl implements DataTypes { return null; } - public void testWebParam(int simple) { + public void testWebParamSDO(DataObject myObject) { } - public void testWebParamArray(int[] array) { + public void testWebParamSDOArray(DataObject[] myArray) { } +/* + + public void testWebParamBare(int simple) { + } + + public void testWebParamBareArray(int[] array) { + } +*/ } diff --git a/sca-java-1.x/trunk/itest/wsdlgen-verify/src/test/java/wsdlgen/verify/DataTypesTestCase.java b/sca-java-1.x/trunk/itest/wsdlgen-verify/src/test/java/wsdlgen/verify/DataTypesTestCase.java index cc0de43b29..9071edb986 100644 --- a/sca-java-1.x/trunk/itest/wsdlgen-verify/src/test/java/wsdlgen/verify/DataTypesTestCase.java +++ b/sca-java-1.x/trunk/itest/wsdlgen-verify/src/test/java/wsdlgen/verify/DataTypesTestCase.java @@ -116,25 +116,39 @@ public class DataTypesTestCase extends BaseFramework { assertEquals("xs:anyType", returnType("testDynamicSDO")); } + @Test + public void testWebParamSDO() throws Exception { + Element paramElement = parameterElement("testWebParamSDO"); + assertEquals("foo", paramElement.getAttribute("name")); + assertEquals("xs:anyType", paramElement.getAttribute("type")); + } + + @Test + public void testWebParamSDOArray() throws Exception { + Element paramElement = parameterElement("testWebParamSDOArray"); + assertEquals("foo", paramElement.getAttribute("name")); + assertEquals("xs:anyType", paramElement.getAttribute("type")); + assertEquals("unbounded", paramElement.getAttribute("maxOccurs")); + } /* + @Test - public void testWebParam() throws Exception { - Element paramElement = parameterElement("testWebParam"); + public void testWebParamBare() throws Exception { + Element paramElement = parameterElement("testWebParamBare"); assertEquals("simpleInt", paramElement.getAttribute("name")); assertEquals("xs:int", paramElement.getAttribute("type")); } @Test @Ignore - public void testWebParamArray() throws Exception { - Element paramElement = parameterElement("testWebParamArray"); + public void testWebParamBareArray() throws Exception { + Element paramElement = parameterElement("testWebParamBareArray"); assertEquals("arrayInt", paramElement.getAttribute("name")); assertEquals("xs:int", paramElement.getAttribute("type")); assertEquals("unbounded", paramElement.getAttribute("maxOccurs")); } */ - @BeforeClass public static void setUpBeforeClass() throws Exception { BaseFramework.start("DataTypes"); -- cgit v1.2.3