Return-Path: Delivered-To: apmail-ws-axis-cvs-archive@www.apache.org Received: (qmail 71988 invoked from network); 1 Jul 2005 09:08:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 1 Jul 2005 09:08:09 -0000 Received: (qmail 26104 invoked by uid 500); 1 Jul 2005 09:08:07 -0000 Delivered-To: apmail-ws-axis-cvs-archive@ws.apache.org Received: (qmail 26043 invoked by uid 500); 1 Jul 2005 09:08:07 -0000 Mailing-List: contact axis-cvs-help@ws.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-cvs@ws.apache.org Received: (qmail 26030 invoked by uid 99); 1 Jul 2005 09:08:07 -0000 X-ASF-Spam-Status: No, hits=0.7 required=10.0 tests=NO_REAL_NAME,WEIRD_PORT X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Fri, 01 Jul 2005 02:08:06 -0700 Received: (qmail 71959 invoked by uid 1877); 1 Jul 2005 09:08:04 -0000 Date: 1 Jul 2005 09:08:04 -0000 Message-ID: <20050701090804.71958.qmail@minotaur.apache.org> From: dicka@apache.org To: ws-axis-cvs@apache.org Subject: cvs commit: ws-axis/c/tests/auto_build/testcases/wsdls XSD_boolean.wsdl X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N dicka 2005/07/01 02:08:04 Modified: c/include/axis AxisUserAPI.h AxisUserAPI.hpp c/tests/auto_build/testcases unitTest.list Added: c/tests/auto_build/testcases/client/cpp XSD_booleanClient.cpp c/tests/auto_build/testcases/output XSD_boolean.expected XSD_boolean_ServerResponse.expected c/tests/auto_build/testcases/tests XSD_boolean.xml c/tests/auto_build/testcases/wsdls XSD_boolean.wsdl Log: Testcase for the XSD built-in simple types. The boolean type. Also including fixes for small problem highlighted while developing this testcase. PR: AXISCPP-715, AXISCPP-724 Submitted by: Adrian Dick Revision Changes Path 1.14 +2 -2 ws-axis/c/include/axis/AxisUserAPI.h Index: AxisUserAPI.h =================================================================== RCS file: /home/cvs/ws-axis/c/include/axis/AxisUserAPI.h,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- AxisUserAPI.h 30 Jun 2005 06:57:35 -0000 1.13 +++ AxisUserAPI.h 1 Jul 2005 09:08:03 -0000 1.14 @@ -402,8 +402,8 @@ AXISC_DEFINED_POINTER_ARRAY(xsdc__QName) AXISC_DEFINED_POINTER_ARRAY(xsdc__notation) -static const int xsdc_boolean_true = 1; -static const int xsdc_boolean_false = 0; +static const xsdc__boolean xsdc_boolean_true = (xsdc__boolean) 1; +static const xsdc__boolean xsdc_boolean_false = (xsdc__boolean) 0; typedef enum { AXISC_NORMAL_CHANNEL=0, 1.11 +2 -2 ws-axis/c/include/axis/AxisUserAPI.hpp Index: AxisUserAPI.hpp =================================================================== RCS file: /home/cvs/ws-axis/c/include/axis/AxisUserAPI.hpp,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- AxisUserAPI.hpp 14 Jun 2005 12:07:03 -0000 1.10 +++ AxisUserAPI.hpp 1 Jul 2005 09:08:03 -0000 1.11 @@ -375,8 +375,8 @@ #define AXIS_OUT_PARAM -static const int xsd_boolean_true = 1; -static const int xsd_boolean_false = 0; +static const xsd__boolean xsd_boolean_true = (xsd__boolean) 1; +static const xsd__boolean xsd_boolean_false = (xsd__boolean) 0; typedef enum { NORMAL_CHANNEL=0, 1.6 +2 -1 ws-axis/c/tests/auto_build/testcases/unitTest.list Index: unitTest.list =================================================================== RCS file: /home/cvs/ws-axis/c/tests/auto_build/testcases/unitTest.list,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- unitTest.list 30 Jun 2005 16:26:12 -0000 1.5 +++ unitTest.list 1 Jul 2005 09:08:04 -0000 1.6 @@ -22,4 +22,5 @@ XSD_gYearMonth.xml XSD_gMonth.xml XSD_gMonthDay.xml -XSD_gDay.xml \ No newline at end of file +XSD_gDay.xml +XSD_boolean.xml \ No newline at end of file 1.1 ws-axis/c/tests/auto_build/testcases/client/cpp/XSD_booleanClient.cpp Index: XSD_booleanClient.cpp =================================================================== // Copyright 2003-2004 The Apache Software Foundation. // (c) Copyright IBM Corp. 2004, 2005 All Rights Reserved // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // 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. #include "XSD_boolean.hpp" #include #include #include int main(int argc, char* argv[]) { char endpoint[256]; const char* url="http://localhost:80/axis/XSD_boolean"; if(argc>1) url = argv[1]; // bool bSuccess = false; try { // Test true and false, using 0, 1, false_, true_, xsd_boolean_false, and xsd_boolean_true sprintf(endpoint, "%s", url); XSD_boolean* ws = new XSD_boolean(endpoint); // Test non-nillable element, with all valid permutations for representing true and false. xsd__boolean result = ws->asNonNillableElement((xsd__boolean)0); cout << "non-nillable element, using 0=" << result << endl; result = ws->asNonNillableElement((xsd__boolean)1); cout << "non-nillable element, using 1=" << result << endl; result = ws->asNonNillableElement(false_); cout << "non-nillable element, using false_=" << result << endl; result = ws->asNonNillableElement(true_); cout << "non-nillable element, using true_=" << result << endl; result = ws->asNonNillableElement(xsd_boolean_false); cout << "non-nillable element, using xsd_boolean_false=" << result << endl; result = ws->asNonNillableElement(xsd_boolean_true); cout << "non-nillable element, using xsd_boolean_true=" << result << endl; // Test nillable element, with a value xsd__boolean* nillableInput = new xsd__boolean(); *(nillableInput) = (xsd__boolean)0; xsd__boolean* nillableResult = ws->asNillableElement(nillableInput); if (nillableResult) { cout << "nillable element=" << *(nillableResult) << endl; delete nillableResult; } else { cout << "nillable element=" << endl; } delete nillableInput; // Test nillable element, with nil nillableResult = ws->asNillableElement(NULL); if (nillableResult) { cout << "nil element=" << *(nillableResult) << endl; delete nillableResult; } else { cout << "nil element=" << endl; } // Test required attribute RequiredAttributeElement requiredAttributeInput; requiredAttributeInput.setrequiredAttribute((xsd__boolean)1); RequiredAttributeElement* requiredAttributeResult = ws->asRequiredAttribute(&requiredAttributeInput); cout << "required attribute=" << requiredAttributeResult->getrequiredAttribute() << endl; delete requiredAttributeResult; /* Optional Attributes currently unsupported by WSDL2Ws * Exact coding of this section may change depending on chosen implementation // Test optional attribute, with a value OptionalAttributeElement optionalAttributeInput; optionalAttributeInput.setoptionalAttribute(false_); OptionalAttributeElement* optionalAttributeResult = ws->asOptionalAttribute(&optionalAttributeInput); if (optionalAttributeResult->getoptionalAttribute()) { cout << "optional attribute, with data=" << *(optionalAttributeResult->getoptionalAttribute()) << endl; } else { cout << "optional attribute, with data=" << endl; } delete optionalAttributeResult; // Test optional attribute, not present optionalAttributeInput.setattribute(); optionalAttributeResult = ws->asOptionalAttribute(&optionalAttributeInput); if (optionalAttributeResult->getoptionalAttribute()) { cout << "optional attribute, not present=" << *(optionalAttributeResult->getoptionalAttribute()) << endl; } else { cout << "optional attribute, not present=" << endl; } delete optionalAttributeResult; */ // Test array xsd__boolean_Array arrayInput; arrayInput.m_Array = new xsd__boolean*[2]; xsd__boolean * array = new xsd__boolean[2]; arrayInput.m_Size = 2; for (int inputIndex=0 ; inputIndex < 2 ; inputIndex++) { array[inputIndex] = true_; arrayInput.m_Array[inputIndex] = &array[inputIndex]; } xsd__boolean_Array arrayResult = ws->asArray(arrayInput); cout << "array of " << arrayResult.m_Size << " elements" << endl; for (int index = 0; index < arrayResult.m_Size ; index++) { cout << " element[" << index << "]=" << *((xsd__boolean*)(arrayResult.m_Array[index])) << endl; delete arrayResult.m_Array[index]; } delete [] array; delete [] arrayInput.m_Array; delete [] arrayResult.m_Array; // Test complex type SimpleComplexType complexTypeInput; complexTypeInput.setcomplexTypeElement(xsd_boolean_false); SimpleComplexType* complexTypeResult = ws->asComplexType(&complexTypeInput); cout << "within complex type=" << complexTypeResult->getcomplexTypeElement() << endl; delete complexTypeResult; // Tests now complete delete ws; } catch(AxisException& e) { cout << "Exception : " << e.what() << endl; } catch(exception& e) { cout << "Unknown exception has occured: " << e.what() << endl; } catch(...) { cout << "Unknown exception has occured" << endl; } cout<< "---------------------- TEST COMPLETE -----------------------------"<< endl; return 0; } 1.1 ws-axis/c/tests/auto_build/testcases/output/XSD_boolean.expected Index: XSD_boolean.expected =================================================================== non-nillable element, using 0=0 non-nillable element, using 1=1 non-nillable element, using false_=0 non-nillable element, using true_=1 non-nillable element, using xsd_boolean_false=0 non-nillable element, using xsd_boolean_true=1 nillable element=0 nil element= required attribute=1 array of 2 elements element[0]=1 element[1]=1 within complex type=0 ---------------------- TEST COMPLETE ----------------------------- 1.1 ws-axis/c/tests/auto_build/testcases/output/XSD_boolean_ServerResponse.expected Index: XSD_boolean_ServerResponse.expected =================================================================== HTTP/1.1 200 OK Server: WebSphere Application Server/5.1 Content-Type: text/xml; charset=utf-8 Content-Language: en-GB Transfer-Encoding: chunked ### false 0 HTTP/1.1 200 OK Server: WebSphere Application Server/5.1 Content-Type: text/xml; charset=utf-8 Content-Language: en-GB Transfer-Encoding: chunked ### true 0 HTTP/1.1 200 OK Server: WebSphere Application Server/5.1 Content-Type: text/xml; charset=utf-8 Content-Language: en-GB Transfer-Encoding: chunked ### false 0 HTTP/1.1 200 OK Server: WebSphere Application Server/5.1 Content-Type: text/xml; charset=utf-8 Content-Language: en-GB Transfer-Encoding: chunked ### true 0 HTTP/1.1 200 OK Server: WebSphere Application Server/5.1 Content-Type: text/xml; charset=utf-8 Content-Language: en-GB Transfer-Encoding: chunked ### false 0 HTTP/1.1 200 OK Server: WebSphere Application Server/5.1 Content-Type: text/xml; charset=utf-8 Content-Language: en-GB Transfer-Encoding: chunked ### true 0 HTTP/1.1 200 OK Server: WebSphere Application Server/5.1 Content-Type: text/xml; charset=utf-8 Content-Language: en-GB Transfer-Encoding: chunked ### false 0 HTTP/1.1 200 OK Server: WebSphere Application Server/5.1 Content-Type: text/xml; charset=utf-8 Content-Language: en-GB Transfer-Encoding: chunked ### 0 HTTP/1.1 200 OK Server: WebSphere Application Server/5.1 Content-Type: text/xml; charset=utf-8 Content-Language: en-GB Transfer-Encoding: chunked ### 0 HTTP/1.1 200 OK Server: WebSphere Application Server/5.1 Content-Type: text/xml; charset=utf-8 Content-Language: en-GB Transfer-Encoding: chunked ### truetrue 0 HTTP/1.1 200 OK Server: WebSphere Application Server/5.1 Content-Type: text/xml; charset=utf-8 Content-Language: en-GB Transfer-Encoding: chunked ### false 0 1.1 ws-axis/c/tests/auto_build/testcases/tests/XSD_boolean.xml Index: XSD_boolean.xml =================================================================== XSD_boolean Test serialization and deserialization of the XSD built-in simple type boolean cpp XSD_booleanClient.cpp XSD_boolean.wsdl XSD_boolean.expected XSD_boolean_ServerResponse.expected http://localhost:80/axis/XSD_boolean 1.1 ws-axis/c/tests/auto_build/testcases/wsdls/XSD_boolean.wsdl Index: XSD_boolean.wsdl ===================================================================