You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by na...@apache.org on 2006/05/10 05:53:05 UTC
svn commit: r405619 -
/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/
Author: nadiramra
Date: Tue May 9 20:53:03 2006
New Revision: 405619
URL: http://svn.apache.org/viewcvs?rev=405619&view=rev
Log:
Cleanup test cases for creation of C test cases.
Modified:
webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_booleanClient.cpp
webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_byteClient.cpp
webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_dateClient.cpp
webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_dateTimeClient.cpp
webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_decimalClient.cpp
webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_doubleClient.cpp
webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_durationClient.cpp
webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_float1Client.cpp
webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_floatClient.cpp
Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_booleanClient.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_booleanClient.cpp?rev=405619&r1=405618&r2=405619&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_booleanClient.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_booleanClient.cpp Tue May 9 20:53:03 2006
@@ -14,6 +14,16 @@
// limitations under the License.
+/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
+/* NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE */
+/* ---------------------------------------------------------------- */
+/* CHANGES TO THIS FILE MAY ALSO REQUIRE CHANGES TO THE */
+/* C-EQUIVALENT FILE. PLEASE ENSURE THAT IT IS DONE. */
+/* ---------------------------------------------------------------- */
+/* NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE */
+/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
+
+
#include "XSD_boolean.hpp"
#include <axis/AxisException.hpp>
#include <ctype.h>
@@ -22,68 +32,73 @@
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
+ XSD_boolean* ws;
+
+ xsd__boolean result;
+ xsd__boolean input;
+ xsd__boolean* nillableResult;
+
+ char endpoint[256];
+ const char* url="http://localhost:80/axis/XSD_boolean";
+
+ if(argc>1)
+ url = argv[1];
+
+ try
+ {
+ // Test true and false, using 0, 1, false_, true_, xsd_boolean_false, and xsd_boolean_true
+
+ sprintf(endpoint, "%s", url);
+ ws = new XSD_boolean(endpoint);
+
+ // Test non-nillable element, with all valid permutations for representing true and false.
+ result = ws->asNonNillableElement((xsd__boolean)0);
+ cout << "non-nillable element, using 0=" << result << endl;
- 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=<nil>" << endl;
- }
- delete nillableInput;
+ // Test nillable element, with a value
+ input = (xsd__boolean)0;
+ nillableResult = ws->asNillableElement(&input);
+ if (nillableResult)
+ {
+ cout << "nillable element=" << *(nillableResult) << endl;
+ delete nillableResult;
+ }
+ else
+ cout << "nillable element=<nil>" << endl;
- // Test nillable element, with nil
+ // Test nillable element, with nil
nillableResult = ws->asNillableElement(NULL);
- if (nillableResult)
- {
- cout << "nil element=" << *(nillableResult) << endl;
- delete nillableResult;
- }
- else
- {
- cout << "nil element=<nil>" << endl;
- }
+ if (nillableResult)
+ {
+ cout << "nil element=" << *(nillableResult) << endl;
+ delete nillableResult;
+ }
+ else
+ cout << "nil element=<nil>" << endl;
- // Test required attribute
- RequiredAttributeElement requiredAttributeInput;
- requiredAttributeInput.setrequiredAttribute((xsd__boolean)1);
- RequiredAttributeElement* requiredAttributeResult = ws->asRequiredAttribute(&requiredAttributeInput);
- cout << "required attribute=" << requiredAttributeResult->getrequiredAttribute() << endl;
- delete requiredAttributeResult;
+ // Test required attribute
+ RequiredAttributeElement requiredAttributeInput;
+ RequiredAttributeElement* requiredAttributeResult;
+
+ requiredAttributeInput.setrequiredAttribute((xsd__boolean)1);
+ 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
@@ -116,56 +131,58 @@
*/
// Test array
-
+#define ARRAY_SIZE 2
+ int i, outputSize=0;
+
xsd__boolean_Array arrayInput;
- int arraySize=2;
- xsd__boolean ** array = new xsd__boolean*[arraySize];
- for (int inputIndex=0 ; inputIndex < arraySize ; inputIndex++)
- {
- array[inputIndex] = new xsd__boolean(true_);
- }
- arrayInput.set(array,arraySize);
- xsd__boolean_Array* arrayResult = ws->asArray(&arrayInput);
- int outputSize=2;
- const xsd__boolean **output = arrayResult->get(outputSize);
+ xsd__boolean_Array* arrayResult;
+ xsd__boolean * array[ARRAY_SIZE];
+ const xsd__boolean **output;
+
+ for (i=0 ; i < ARRAY_SIZE ; i++)
+ array[i] = new xsd__boolean(true_);
+ arrayInput.set(array,ARRAY_SIZE);
+
+ arrayResult = ws->asArray(&arrayInput);
+
+ if (arrayResult)
+ output = arrayResult->get(outputSize);
cout << "array of " << outputSize << " elements" << endl;
- for (int index = 0; index < outputSize; index++)
- {
- cout << " element[" << index << "]=" << (*output[index]) << endl;
- }
- // Clear up input array
- for (int deleteIndex = 0 ; deleteIndex < arraySize ; deleteIndex++ )
- {
- delete array[deleteIndex];
- }
- delete [] array;
+ for (i = 0; i < outputSize; i++)
+ cout << " element[" << i << "]=" << (*output[i]) << endl;
+
+ // Clear up input array
+ for (i = 0 ; i < ARRAY_SIZE ; i++ )
+ delete array[i];
delete arrayResult;
- // Test complex type
- SimpleComplexType complexTypeInput;
- complexTypeInput.setcomplexTypeElement(xsd_boolean_false);
- SimpleComplexType* complexTypeResult = ws->asComplexType(&complexTypeInput);
- cout << "within complex type=" << complexTypeResult->getcomplexTypeElement() << endl;
- delete complexTypeResult;
+ // Test complex type
+ SimpleComplexType complexTypeInput;
+ SimpleComplexType* complexTypeResult;
+
+ complexTypeInput.setcomplexTypeElement(xsd_boolean_false);
+ 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;
+ }
- // Tests now complete
+ cout<< "---------------------- TEST COMPLETE -----------------------------"<< endl;
- 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;
+ return 0;
}
Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_byteClient.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_byteClient.cpp?rev=405619&r1=405618&r2=405619&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_byteClient.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_byteClient.cpp Tue May 9 20:53:03 2006
@@ -14,6 +14,16 @@
// limitations under the License.
+/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
+/* NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE */
+/* ---------------------------------------------------------------- */
+/* CHANGES TO THIS FILE MAY ALSO REQUIRE CHANGES TO THE */
+/* C-EQUIVALENT FILE. PLEASE ENSURE THAT IT IS DONE. */
+/* ---------------------------------------------------------------- */
+/* NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE */
+/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
+
+
#include "XSD_byte.hpp"
#include <axis/AxisException.hpp>
#include <ctype.h>
@@ -21,6 +31,12 @@
int main(int argc, char* argv[])
{
+ XSD_byte* ws;
+
+ xsd__byte result;
+ xsd__byte input;
+ xsd__byte* nillableResult;
+
char endpoint[256];
const char* url="http://localhost:80/axis/XSD_byte";
@@ -32,34 +48,34 @@
try
{
sprintf(endpoint, "%s", url);
- XSD_byte* ws = new XSD_byte(endpoint);
+ ws = new XSD_byte(endpoint);
xsd__byte result = ws->asNonNillableElement((xsd__byte)127);
cout << "non-nillable element=" << (int) result << endl;
+
result = ws->asNonNillableElement((xsd__byte)1);
cout << "non-nillable element=" << (int) result << endl;
+
result = ws->asNonNillableElement((xsd__byte)-128);
cout << "non-nillable element=" << (int) result << endl;
+
result = ws->asNonNillableElement((xsd__byte)-1);
cout << "non-nillable element=" << (int) result << endl;
+
result = ws->asNonNillableElement((xsd__byte)0);
cout << "non-nillable element=" << (int) result << endl;
// Test nillable element, with a value
- xsd__byte* nillableInput = new xsd__byte();
- *(nillableInput) = (xsd__byte)123;
- xsd__byte* nillableResult = ws->asNillableElement(nillableInput);
+ input = (xsd__byte)123;
+ nillableResult = ws->asNillableElement(&input);
if (nillableResult)
{
cout << "nillable element=" << (int) *(nillableResult) << endl;
delete nillableResult;
}
else
- {
cout << "nillable element=<nil>" << endl;
- }
- delete nillableInput;
// Test nillable element, with nil
nillableResult = ws->asNillableElement(NULL);
@@ -69,14 +85,14 @@
delete nillableResult;
}
else
- {
cout << "nil element=<nil>" << endl;
- }
// Test required attribute
RequiredAttributeElement requiredAttributeInput;
+ RequiredAttributeElement* requiredAttributeResult;
+
requiredAttributeInput.setrequiredAttribute(123);
- RequiredAttributeElement* requiredAttributeResult = ws->asRequiredAttribute(&requiredAttributeInput);
+ requiredAttributeResult = ws->asRequiredAttribute(&requiredAttributeInput);
cout << "required attribute=" << (int) requiredAttributeResult->getrequiredAttribute() << endl;
delete requiredAttributeResult;
@@ -111,36 +127,38 @@
*/
// Test array
+#define ARRAY_SIZE 2
+ int i, outputSize=0;
+
xsd__byte_Array arrayInput;
- int arraySize=2;
- xsd__byte **array = new xsd__byte*[arraySize];
+ xsd__byte_Array* arrayResult;
+ const xsd__byte ** output;
+ xsd__byte *array[ARRAY_SIZE];
- for (int inputIndex=0 ; inputIndex < 2 ; inputIndex++)
- {
- array[inputIndex] = new xsd__byte(123);
- }
- arrayInput.set(array,arraySize);
- xsd__byte_Array* arrayResult = ws->asArray(&arrayInput);
- int outputSize=0;
- const xsd__byte ** output=arrayResult->get(outputSize);
+ for (i=0 ; i < 2 ; i++)
+ array[i] = new xsd__byte(123);
+ arrayInput.set(array,ARRAY_SIZE);
+
+ arrayResult = ws->asArray(&arrayInput);
+ if (arrayResult)
+ output = arrayResult->get(outputSize);
+
cout << "array of " << outputSize << " elements" << endl;
- for (int index = 0; index < outputSize ; index++)
- {
- cout << " element[" << index << "]=" << (int)*output[index] << endl;
- }
+ for (i = 0; i < outputSize ; i++)
+ cout << " element[" << i << "]=" << (int)*output[i] << endl;
+
// Clear up input array
- for (int deleteIndex = 0 ; deleteIndex < arraySize ; deleteIndex++ )
- {
- delete array[deleteIndex];
- }
- delete [] array;
+ for (i = 0 ; i < ARRAY_SIZE ; i++ )
+ delete array[i];
delete arrayResult;
// Test complex type
SimpleComplexType complexTypeInput;
+ SimpleComplexType* complexTypeResult;
+
complexTypeInput.setcomplexTypeElement(123);
- SimpleComplexType* complexTypeResult = ws->asComplexType(&complexTypeInput);
+ complexTypeResult = ws->asComplexType(&complexTypeInput);
cout << "within complex type=" << (int) complexTypeResult->getcomplexTypeElement() << endl;
delete complexTypeResult;
Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_dateClient.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_dateClient.cpp?rev=405619&r1=405618&r2=405619&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_dateClient.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_dateClient.cpp Tue May 9 20:53:03 2006
@@ -14,6 +14,16 @@
// limitations under the License.
+/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
+/* NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE */
+/* ---------------------------------------------------------------- */
+/* CHANGES TO THIS FILE MAY ALSO REQUIRE CHANGES TO THE */
+/* C-EQUIVALENT FILE. PLEASE ENSURE THAT IT IS DONE. */
+/* ---------------------------------------------------------------- */
+/* NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE */
+/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
+
+
#include "XSD_date.hpp"
#include <axis/AxisException.hpp>
#include <ctype.h>
@@ -22,8 +32,19 @@
int main(int argc, char* argv[])
{
+ XSD_date* ws;
+
+ xsd__date result;
+ xsd__date input;
+ xsd__date* nillableResult;
+
char endpoint[256];
const char* url="http://localhost:80/axis/XSD_date";
+
+ char returnString[50];
+
+ time_t timeToTest;
+ struct tm *temp;
if(argc>1)
url = argv[1];
@@ -31,24 +52,19 @@
try
{
sprintf(endpoint, "%s", url);
- XSD_date* ws = new XSD_date(endpoint);
-
- char returnString[50];
+ ws = new XSD_date(endpoint);
- time_t timeToTest = 1100246323;
- struct tm *temp = gmtime(&timeToTest);
- struct tm time;
- memcpy(&time, temp, sizeof(struct tm));
+ timeToTest = 1100246323;
+ temp = gmtime(&timeToTest);
+ memcpy(&input, temp, sizeof(struct tm));
// Test non-nillable element
- xsd__date result = ws->asNonNillableElement(time);
+ result = ws->asNonNillableElement(input);
strftime(returnString, 50, "%a %b %d %Y", &result);
cout << "non-nillable element=" << returnString << endl;
// Test nillable element, with a value
- xsd__date* nillableInput = new xsd__date();
- *(nillableInput) = time;
- xsd__date* nillableResult = ws->asNillableElement(nillableInput);
+ nillableResult = ws->asNillableElement(&input);
if (nillableResult)
{
strftime(returnString, 50, "%a %b %d %Y", nillableResult);
@@ -56,10 +72,7 @@
delete nillableResult;
}
else
- {
cout << "nillable element=<nil>" << endl;
- }
- delete nillableInput;
// Test nillable element, with nil
nillableResult = ws->asNillableElement(NULL);
@@ -70,14 +83,14 @@
delete nillableResult;
}
else
- {
cout << "nil element=<nil>" << endl;
- }
// Test required attribute
RequiredAttributeElement requiredAttributeInput;
- requiredAttributeInput.setrequiredAttribute(time);
- RequiredAttributeElement* requiredAttributeResult = ws->asRequiredAttribute(&requiredAttributeInput);
+ RequiredAttributeElement* requiredAttributeResult;
+
+ requiredAttributeInput.setrequiredAttribute(input);
+ requiredAttributeResult = ws->asRequiredAttribute(&requiredAttributeInput);
result = requiredAttributeResult->getrequiredAttribute();
strftime(returnString, 50, "%a %b %d %Y", &result);
cout << "required attribute=" << returnString << endl;
@@ -115,38 +128,40 @@
delete optionalAttributeResult;
*/
// Test array
+#define ARRAY_SIZE 2
+ int i, outputSize=0;
+
xsd__date_Array arrayInput;
- int arraySize = 2;
- xsd__date ** array = new xsd__date*[arraySize];
+ xsd__date_Array* arrayResult;
+ xsd__date *array[ARRAY_SIZE];
+ const xsd__date **output;
+
+ for (i=0 ; i < ARRAY_SIZE ; i++)
+ array[i] =new xsd__date(input);
+ arrayInput.set(array,ARRAY_SIZE);
- for (int inputIndex=0 ; inputIndex < arraySize ; inputIndex++)
- {
- array[inputIndex] =new xsd__date(time);
+ arrayResult = ws->asArray(&arrayInput);
+
+ if (arrayResult)
+ output = arrayResult->get(outputSize);
- }
- arrayInput.set(array,arraySize);
- xsd__date_Array* arrayResult = ws->asArray(&arrayInput);
- int outputSize = 0;
- const xsd__date **output = arrayResult->get(outputSize);
cout << "array of " << outputSize << " elements" << endl;
- for (int index = 0; index < outputSize ; index++)
+ for (i = 0; i < outputSize ; i++)
{
- strftime(returnString, 50, "%a %b %d %Y", output[index]);
- cout << " element[" << index << "]=" << returnString << endl;
-
+ strftime(returnString, 50, "%a %b %d %Y", output[i]);
+ cout << " element[" << i << "]=" << returnString << endl;
}
// Clear up input array
- for (int deleteIndex = 0 ; deleteIndex < arraySize ; deleteIndex++ )
- {
- delete array[deleteIndex];
- }
- delete [] array;
+ for (i = 0 ; i < ARRAY_SIZE ; i++ )
+ delete array[i];
delete arrayResult;
// Test complex type
SimpleComplexType complexTypeInput;
- complexTypeInput.setcomplexTypeElement(time);
- SimpleComplexType* complexTypeResult = ws->asComplexType(&complexTypeInput);
+ SimpleComplexType* complexTypeResult;
+
+ complexTypeInput.setcomplexTypeElement(input);
+ complexTypeResult = ws->asComplexType(&complexTypeInput);
result = complexTypeResult->getcomplexTypeElement();
strftime(returnString, 50, "%a %b %d %Y", &result);
cout << "within complex type=" << returnString << endl;
Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_dateTimeClient.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_dateTimeClient.cpp?rev=405619&r1=405618&r2=405619&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_dateTimeClient.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_dateTimeClient.cpp Tue May 9 20:53:03 2006
@@ -14,6 +14,16 @@
// limitations under the License.
+/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
+/* NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE */
+/* ---------------------------------------------------------------- */
+/* CHANGES TO THIS FILE MAY ALSO REQUIRE CHANGES TO THE */
+/* C-EQUIVALENT FILE. PLEASE ENSURE THAT IT IS DONE. */
+/* ---------------------------------------------------------------- */
+/* NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE */
+/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
+
+
#include "XSD_dateTime.hpp"
#include <axis/AxisException.hpp>
#include <ctype.h>
@@ -22,68 +32,69 @@
int main(int argc, char* argv[])
{
- char endpoint[256];
- const char* url="http://localhost:80/axis/XSD_dateTime";
-
- if(argc>1)
- url = argv[1];
-
- // bool bSuccess = false;
-
- try
- {
- sprintf(endpoint, "%s", url);
- XSD_dateTime* ws = new XSD_dateTime(endpoint);
+ XSD_dateTime* ws;
+
+ char returnString[50];
+
+ xsd__dateTime result;
+ xsd__dateTime input;
+ xsd__dateTime* nillableResult;
+
+ time_t timeToTest;
+ struct tm *temp;
+
+ char endpoint[256];
+ const char* url="http://localhost:80/axis/XSD_dateTime";
+
+ if(argc>1)
+ url = argv[1];
+
+ try
+ {
+ sprintf(endpoint, "%s", url);
+ XSD_dateTime* ws = new XSD_dateTime(endpoint);
+
+ timeToTest = 1100246323;
+ temp = gmtime(&timeToTest);
+ memcpy(&input, temp, sizeof(struct tm));
- char returnString[50];
-
- time_t timeToTest = 1100246323;
- struct tm *temp = gmtime(&timeToTest);
- struct tm time;
- memcpy(&time, temp, sizeof(struct tm));
-
- // Test non-nillable element
- xsd__dateTime result = ws->asNonNillableElement(time);
+ // Test non-nillable element
+ result = ws->asNonNillableElement(input);
strftime(returnString, 50, "%a %b %d %H:%M:%S %Y", &result);
- cout << "non-nillable element=" << returnString << endl;
+ cout << "non-nillable element=" << returnString << endl;
- // Test nillable element, with a value
- xsd__dateTime* nillableInput = new xsd__dateTime();
- *(nillableInput) = time;
- xsd__dateTime* nillableResult = ws->asNillableElement(nillableInput);
- if (nillableResult)
- {
+ // Test nillable element, with a value
+ nillableResult = ws->asNillableElement(&input);
+ if (nillableResult)
+ {
strftime(returnString, 50, "%a %b %d %H:%M:%S %Y", nillableResult);
- cout << "nillable element=" << returnString << endl;
- delete nillableResult;
- }
- else
- {
- cout << "nillable element=<nil>" << endl;
- }
- delete nillableInput;
+ cout << "nillable element=" << returnString << endl;
+ delete nillableResult;
+ }
+ else
+ cout << "nillable element=<nil>" << endl;
- // Test nillable element, with nil
+ // Test nillable element, with nil
nillableResult = ws->asNillableElement(NULL);
- if (nillableResult)
- {
+ if (nillableResult)
+ {
strftime(returnString, 50, "%a %b %d %H:%M:%S %Y", nillableResult);
- cout << "nil element=" << returnString << endl;
- delete nillableResult;
- }
- else
- {
- cout << "nil element=<nil>" << endl;
- }
+ cout << "nil element=" << returnString << endl;
+ delete nillableResult;
+ }
+ else
+ cout << "nil element=<nil>" << endl;
- // Test required attribute
- RequiredAttributeElement requiredAttributeInput;
- requiredAttributeInput.setrequiredAttribute(time);
- RequiredAttributeElement* requiredAttributeResult = ws->asRequiredAttribute(&requiredAttributeInput);
+ // Test required attribute
+ RequiredAttributeElement requiredAttributeInput;
+ RequiredAttributeElement* requiredAttributeResult;
+
+ requiredAttributeInput.setrequiredAttribute(input);
+ requiredAttributeResult = ws->asRequiredAttribute(&requiredAttributeInput);
result = requiredAttributeResult->getrequiredAttribute();
- strftime(returnString, 50, "%a %b %d %H:%M:%S %Y", &result);
+ strftime(returnString, 50, "%a %b %d %H:%M:%S %Y", &result);
cout << "required attribute=" << returnString << endl;
- delete requiredAttributeResult;
+ delete requiredAttributeResult;
/* Optional Attributes currently unsupported by WSDL2Ws
* Exact coding of this section may change depending on chosen implementation
@@ -97,9 +108,7 @@
cout << "optional attribute, with data=" << returnString << endl;
}
else
- {
cout << "optional attribute, with data=<not present>" << endl;
- }
delete optionalAttributeResult;
// Test optional attribute, not present
@@ -111,67 +120,66 @@
cout << "optional attribute, not present=" << returnString << endl;
}
else
- {
cout << "optional attribute, not present=<not present>" << endl;
- }
delete optionalAttributeResult;
*/
- // Test array
-
+ // Test array
+#define ARRAY_SIZE 2
+ int i, outputSize=0;
+
xsd__dateTime_Array arrayInput;
- int arraySize = 2;
- xsd__dateTime ** array = new xsd__dateTime*[arraySize];
+ xsd__dateTime_Array* arrayResult;
+ xsd__dateTime *array[ARRAY_SIZE];
+ const xsd__dateTime **output;
+
+ for (i=0 ; i < ARRAY_SIZE ; i++)
+ array[i] =new xsd__dateTime(input);
+ arrayInput.set(array,ARRAY_SIZE);
+
+ arrayResult = ws->asArray(&arrayInput);
+
+ if (arrayResult)
+ output = arrayResult->get(outputSize);
- for (int inputIndex=0 ; inputIndex < arraySize ; inputIndex++)
- {
- array[inputIndex] =new xsd__dateTime(time);
-
- }
- arrayInput.set(array,arraySize);
- xsd__dateTime_Array* arrayResult = ws->asArray(&arrayInput);
- int outputSize = 0;
- const xsd__dateTime **output = arrayResult->get(outputSize);
cout << "array of " << outputSize << " elements" << endl;
- for (int index = 0; index < outputSize ; index++)
+ for (i = 0; i < outputSize ; i++)
{
- strftime(returnString, 50, "%a %b %d %H:%M:%S %Y", output[index]);
- cout << " element[" << index << "]=" << returnString << endl;
-
+ strftime(returnString, 50, "%a %b %d %H:%M:%S %Y", output[i]);
+ cout << " element[" << i << "]=" << returnString << endl;
}
- // Clear up input array
- for (int deleteIndex = 0 ; deleteIndex < arraySize ; deleteIndex++ )
- {
- delete array[deleteIndex];
- }
- delete [] array;
+ // Clear up input array
+ for (i = 0 ; i < ARRAY_SIZE ; i++ )
+ delete array[i];
delete arrayResult;
- // Test complex type
- SimpleComplexType complexTypeInput;
- complexTypeInput.setcomplexTypeElement(time);
- SimpleComplexType* complexTypeResult = ws->asComplexType(&complexTypeInput);
+ // Test complex type
+ SimpleComplexType complexTypeInput;
+ SimpleComplexType* complexTypeResult;
+
+ complexTypeInput.setcomplexTypeElement(input);
+ complexTypeResult = ws->asComplexType(&complexTypeInput);
result = complexTypeResult->getcomplexTypeElement();
strftime(returnString, 50, "%a %b %d %H:%M:%S %Y", &result);
- cout << "within complex type=" << returnString << endl;
- delete complexTypeResult;
+ cout << "within complex type=" << returnString << endl;
+ delete complexTypeResult;
- // Tests now complete
+ // 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;
- }
+ 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;
Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_decimalClient.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_decimalClient.cpp?rev=405619&r1=405618&r2=405619&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_decimalClient.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_decimalClient.cpp Tue May 9 20:53:03 2006
@@ -14,6 +14,16 @@
// limitations under the License.
+/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
+/* NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE */
+/* ---------------------------------------------------------------- */
+/* CHANGES TO THIS FILE MAY ALSO REQUIRE CHANGES TO THE */
+/* C-EQUIVALENT FILE. PLEASE ENSURE THAT IT IS DONE. */
+/* ---------------------------------------------------------------- */
+/* NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE */
+/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
+
+
#include "XSD_decimal.hpp"
#include <axis/AxisException.hpp>
#include <ctype.h>
@@ -22,21 +32,27 @@
int main(int argc, char* argv[])
{
- char endpoint[256];
- const char* url="http://localhost:80/axis/XSD_decimal";
-
- if(argc>1)
- url = argv[1];
-
- // bool bSuccess = false;
-
- try
- {
- sprintf(endpoint, "%s", url);
- XSD_decimal* ws = new XSD_decimal(endpoint);
+ XSD_decimal* ws;
+
+ xsd__decimal result;
+ xsd__decimal input;
+ xsd__decimal* nillableResult;
+
+ char endpoint[256];
+ const char* url="http://localhost:80/axis/XSD_decimal";
+
+ if(argc>1)
+ url = argv[1];
+
+ // bool bSuccess = false;
+
+ try
+ {
+ sprintf(endpoint, "%s", url);
+ ws = new XSD_decimal(endpoint);
- xsd__decimal result = ws->asNonNillableElement((xsd__decimal)123456789);
- printf("non-nillable element=%.6f\n", result);
+ result = ws->asNonNillableElement((xsd__decimal)123456789);
+ printf("non-nillable element=%.6f\n", result);
fflush(stdout);
result = ws->asNonNillableElement((xsd__decimal)123456789.123456);
printf("non-nillable element=%.6f\n", result);
@@ -51,42 +67,38 @@
printf("non-nillable element=%.6f\n", result);
fflush(stdout);
- // Test nillable element, with a value
- xsd__decimal* nillableInput = new xsd__decimal();
- *(nillableInput) = (xsd__decimal)123456789;
- xsd__decimal* nillableResult = ws->asNillableElement(nillableInput);
- if (nillableResult)
- {
- printf("nillable element=%.6f\n", *(nillableResult));
+ // Test nillable element, with a value
+ input = (xsd__decimal)123456789;
+ nillableResult = ws->asNillableElement(&input);
+ if (nillableResult)
+ {
+ printf("nillable element=%.6f\n", *(nillableResult));
fflush(stdout);
- delete nillableResult;
- }
- else
- {
- cout << "nillable element=<nil>" << endl;
- }
- delete nillableInput;
+ delete nillableResult;
+ }
+ else
+ cout << "nillable element=<nil>" << endl;
- // Test nillable element, with nil
+ // Test nillable element, with nil
nillableResult = ws->asNillableElement(NULL);
- if (nillableResult)
- {
- printf("nil element=%.6f\n", *(nillableResult));
+ if (nillableResult)
+ {
+ printf("nil element=%.6f\n", *(nillableResult));
fflush(stdout);
- delete nillableResult;
- }
- else
- {
- cout << "nil element=<nil>" << endl;
- }
+ delete nillableResult;
+ }
+ else
+ cout << "nil element=<nil>" << endl;
- // Test required attribute
- RequiredAttributeElement requiredAttributeInput;
- requiredAttributeInput.setrequiredAttribute(123456789);
- RequiredAttributeElement* requiredAttributeResult = ws->asRequiredAttribute(&requiredAttributeInput);
- printf("required attribute=%.6f\n", requiredAttributeResult->getrequiredAttribute());
+ // Test required attribute
+ RequiredAttributeElement requiredAttributeInput;
+ RequiredAttributeElement* requiredAttributeResult;
+
+ requiredAttributeInput.setrequiredAttribute(123456789);
+ requiredAttributeResult = ws->asRequiredAttribute(&requiredAttributeInput);
+ printf("required attribute=%.6f\n", requiredAttributeResult->getrequiredAttribute());
fflush(stdout);
- delete requiredAttributeResult;
+ delete requiredAttributeResult;
/* Optional Attributes currently unsupported by WSDL2Ws
* Exact coding of this section may change depending on chosen implementation
@@ -120,59 +132,63 @@
delete optionalAttributeResult;
*/
- // Test array
- xsd__decimal_Array arrayInput;
- int arraySize=2;
- xsd__decimal **array = new xsd__decimal*[arraySize];
- for (int inputIndex=0 ; inputIndex < arraySize ; inputIndex++)
- {
- array[inputIndex] = new xsd__decimal(123456789);
-
- }
- arrayInput.set(array,arraySize);
- xsd__decimal_Array* arrayResult = ws->asArray(&arrayInput);
- int outputSize=0;
- const xsd__decimal ** output = arrayResult->get(outputSize);
+ // Test array
+#define ARRAY_SIZE 2
+ int i, outputSize=0;
+
+ xsd__decimal_Array arrayInput;
+ xsd__decimal_Array* arrayResult;
+ xsd__decimal *array[ARRAY_SIZE];
+ const xsd__decimal ** output;
+
+ for (i=0 ; i < ARRAY_SIZE ; i++)
+ array[i] = new xsd__decimal(123456789);
+ arrayInput.set(array,ARRAY_SIZE);
+
+ arrayResult = ws->asArray(&arrayInput);
+
+ if (arrayResult)
+ output = arrayResult->get(outputSize);
+
cout << "array of " << outputSize << " elements" << endl;
- for (int index = 0; index < outputSize ; index++)
- {
- printf(" element[%i]=%.6f\n", index, *((xsd__decimal*)output[index]));
- fflush(stdout);
- }
- // Clear up input array
- for (int deleteIndex = 0 ; deleteIndex < arraySize ; deleteIndex++ )
+ for (i = 0; i < outputSize ; i++)
{
- delete array[deleteIndex];
+ printf(" element[%i]=%.6f\n", i, *((xsd__decimal*)output[i]));
+ fflush(stdout);
}
- delete [] array;
+ // Clear up input array
+ for (i = 0 ; i < ARRAY_SIZE ; i++ )
+ delete array[i];
delete arrayResult;
- // Test complex type
- SimpleComplexType complexTypeInput;
- complexTypeInput.setcomplexTypeElement(123456789);
- SimpleComplexType* complexTypeResult = ws->asComplexType(&complexTypeInput);
- printf("within complex type=%.6f\n", complexTypeResult->getcomplexTypeElement());
- fflush(stdout);
- delete complexTypeResult;
-
- // Tests now complete
+ // Test complex type
+ SimpleComplexType complexTypeInput;
+ SimpleComplexType* complexTypeResult;
+
+ complexTypeInput.setcomplexTypeElement(123456789);
+ complexTypeResult = ws->asComplexType(&complexTypeInput);
+ printf("within complex type=%.6f\n", complexTypeResult->getcomplexTypeElement());
+ fflush(stdout);
+ 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;
+ }
- 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;
- cout<< "---------------------- TEST COMPLETE -----------------------------"<< endl;
-
- return 0;
+ return 0;
}
Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_doubleClient.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_doubleClient.cpp?rev=405619&r1=405618&r2=405619&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_doubleClient.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_doubleClient.cpp Tue May 9 20:53:03 2006
@@ -14,6 +14,16 @@
// limitations under the License.
+/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
+/* NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE */
+/* ---------------------------------------------------------------- */
+/* CHANGES TO THIS FILE MAY ALSO REQUIRE CHANGES TO THE */
+/* C-EQUIVALENT FILE. PLEASE ENSURE THAT IT IS DONE. */
+/* ---------------------------------------------------------------- */
+/* NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE */
+/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
+
+
#include "XSD_double.hpp"
#include <axis/AxisException.hpp>
#include <ctype.h>
@@ -22,58 +32,58 @@
int main(int argc, char* argv[])
{
- char endpoint[256];
- const char* url="http://localhost:80/axis/XSD_double";
+ XSD_double* ws ;
+
+ xsd__double result;
+ xsd__double input;
+ xsd__double* nillableResult;
+
+ char endpoint[256];
+ const char* url="http://localhost:80/axis/XSD_double";
- if(argc>1)
+ if(argc>1)
url = argv[1];
- // bool bSuccess = false;
-
- try
- {
- sprintf(endpoint, "%s", url);
- XSD_double* ws = new XSD_double(endpoint);
+ try
+ {
+ sprintf(endpoint, "%s", url);
+ ws = new XSD_double(endpoint);
// Test non-nillable element
- xsd__double result = ws->asNonNillableElement((xsd__double)70.7175888888);
- printf("non-nillable element=%.5f\n", result);
+ result = ws->asNonNillableElement((xsd__double)70.7175888888);
+ printf("non-nillable element=%.5f\n", result);
fflush(stdout);
- // Test nillable element, with a value
- xsd__double* nillableInput = new xsd__double();
- *(nillableInput) = (xsd__double)70.7175888888;
- xsd__double* nillableResult = ws->asNillableElement(nillableInput);
+ // Test nillable element, with a value
+ input = (xsd__double)70.7175888888;
+ nillableResult = ws->asNillableElement(&input);
if (nillableResult)
- {
- printf("nillable element=%.5f\n", *(nillableResult));
+ {
+ printf("nillable element=%.5f\n", *(nillableResult));
fflush(stdout);
delete nillableResult;
}
- else
- {
- cout << "nillable element=<nil>" << endl;
- }
- delete nillableInput;
+ else
+ cout << "nillable element=<nil>" << endl;
- // Test nillable element, with nil
+ // Test nillable element, with nil
nillableResult = ws->asNillableElement(NULL);
- if (nillableResult)
- {
- printf("nil element=%.5f\n", *(nillableResult));
+ if (nillableResult)
+ {
+ printf("nil element=%.5f\n", *(nillableResult));
fflush(stdout);
- delete nillableResult;
+ delete nillableResult;
}
- else
- {
- cout << "nil element=<nil>" << endl;
- }
+ else
+ cout << "nil element=<nil>" << endl;
- // Test required attribute
+ // Test required attribute
RequiredAttributeElement requiredAttributeInput;
- requiredAttributeInput.setrequiredAttribute((xsd__double)70.7175888888);
- RequiredAttributeElement* requiredAttributeResult = ws->asRequiredAttribute(&requiredAttributeInput);
- printf("required attribute=%.5f\n", requiredAttributeResult->getrequiredAttribute());
+ RequiredAttributeElement* requiredAttributeResult;
+
+ requiredAttributeInput.setrequiredAttribute((xsd__double)70.7175888888);
+ requiredAttributeResult = ws->asRequiredAttribute(&requiredAttributeInput);
+ printf("required attribute=%.5f\n", requiredAttributeResult->getrequiredAttribute());
fflush(stdout);
delete requiredAttributeResult;
@@ -109,58 +119,63 @@
delete optionalAttributeResult;
*/
- // Test array
+ // Test array
+#define ARRAY_SIZE 2
+ int i, outputSize=0;
+
xsd__double_Array arrayInput;
- int arraySize=2;
- xsd__double **array =new xsd__double*[arraySize];
- for (int inputIndex=0 ; inputIndex < 2 ; inputIndex++)
- {
- array[inputIndex] =new xsd__double(70.7175888888);
- }
- arrayInput.set(array,arraySize);
- xsd__double_Array* arrayResult = ws->asArray(&arrayInput);
- int outputSize=0;
- const xsd__double ** output=arrayResult->get(outputSize);
+ xsd__double_Array* arrayResult;
+ xsd__double *array[ARRAY_SIZE];
+ const xsd__double ** output;
+
+ for (i=0 ; i < 2 ; i++)
+ array[i] =new xsd__double(70.7175888888);
+ arrayInput.set(array,ARRAY_SIZE);
+
+ arrayResult = ws->asArray(&arrayInput);
+
+ if (arrayResult)
+ output = arrayResult->get(outputSize);
+
cout << "array of " << outputSize << " elements" << endl;
- for (int index = 0; index < outputSize ; index++)
- {
- printf(" element[%i]=%.5f\n", index, *(output[index]));
- fflush(stdout);
- }
- // Clear up input array
- for (int deleteIndex = 0 ; deleteIndex < arraySize ; deleteIndex++ )
+ for (i = 0; i < outputSize ; i++)
{
- delete array[deleteIndex];
+ printf(" element[%i]=%.5f\n", i, *(output[i]));
+ fflush(stdout);
}
- delete [] array;
+ // Clear up input array
+ for (i = 0 ; i < ARRAY_SIZE ; i++ )
+ delete array[i];
delete arrayResult;
- // Test complex type
- SimpleComplexType complexTypeInput;
- complexTypeInput.setcomplexTypeElement((xsd__double) 70.7175888888);
- SimpleComplexType* complexTypeResult = ws->asComplexType(&complexTypeInput);
- printf("within complex type=%.5f\n", complexTypeResult->getcomplexTypeElement());
+ // Test complex type
+ SimpleComplexType complexTypeInput;
+ SimpleComplexType* complexTypeResult;
+
+ complexTypeInput.setcomplexTypeElement((xsd__double) 70.7175888888);
+ complexTypeResult = ws->asComplexType(&complexTypeInput);
+ printf("within complex type=%.5f\n", complexTypeResult->getcomplexTypeElement());
fflush(stdout);
delete complexTypeResult;
- // Tests now complete
+ // Tests now complete
- delete ws;
+ delete ws;
+ }
+ catch(AxisException& e)
+ {
+ cout << "Exception : " << e.what() << endl;
}
- catch(AxisException& e)
- {
- cout << "Exception : " << e.what() << endl;
- }
- catch(exception& e)
- {
- cout << "Unknown exception has occured: " << e.what() << endl;
+ catch(exception& e)
+ {
+ cout << "Unknown exception has occured: " << e.what() << endl;
}
- catch(...)
+ catch(...)
{
- cout << "Unknown exception has occured" << endl;
- }
+ cout << "Unknown exception has occured" << endl;
+ }
+
+ cout<< "---------------------- TEST COMPLETE -----------------------------"<< endl;
- cout<< "---------------------- TEST COMPLETE -----------------------------"<< endl;
-
- return 0;
+ return 0;
}
Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_durationClient.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_durationClient.cpp?rev=405619&r1=405618&r2=405619&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_durationClient.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_durationClient.cpp Tue May 9 20:53:03 2006
@@ -14,6 +14,16 @@
// limitations under the License.
+/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
+/* NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE */
+/* ---------------------------------------------------------------- */
+/* CHANGES TO THIS FILE MAY ALSO REQUIRE CHANGES TO THE */
+/* C-EQUIVALENT FILE. PLEASE ENSURE THAT IT IS DONE. */
+/* ---------------------------------------------------------------- */
+/* NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE */
+/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
+
+
#include "XSD_duration.hpp"
#include <axis/AxisException.hpp>
#include <ctype.h>
@@ -22,140 +32,137 @@
int main(int argc, char* argv[])
{
- char endpoint[256];
- const char* url="http://localhost:80/axis/XSD_duration";
-
- if(argc>1)
- url = argv[1];
-
- // bool bSuccess = false;
-
- try
+ XSD_duration* ws;
+
+ xsd__duration result;
+ xsd__duration input;
+ xsd__duration* nillableResult;
+
+ char endpoint[256];
+ const char* url="http://localhost:80/axis/XSD_duration";
+
+ if(argc>1)
+ url = argv[1];
+
+ try
+ {
+ sprintf(endpoint, "%s", url);
+ ws = new XSD_duration(endpoint);
+
+ // Test non-nillable element
+ result = ws->asNonNillableElement((xsd__duration)123456789);
+ cout << "non-nillable element=" << result << endl;
+
+ // Test nillable element, with a value
+ input = (xsd__duration)123456789;
+ nillableResult = ws->asNillableElement(&input);
+ if (nillableResult)
{
- sprintf(endpoint, "%s", url);
- XSD_duration* ws = new XSD_duration(endpoint);
-
- // Test non-nillable element
- xsd__duration result = ws->asNonNillableElement((xsd__duration)123456789);
- cout << "non-nillable element=" << result << endl;
-
- // Test nillable element, with a value
- xsd__duration* nillableInput = new xsd__duration();
- *(nillableInput) = (xsd__duration)123456789;
- xsd__duration* nillableResult = ws->asNillableElement(nillableInput);
- if (nillableResult)
- {
- cout << "nillable element=" << *(nillableResult) << endl;
- delete nillableResult;
- }
- else
- {
- cout << "nillable element=<nil>" << endl;
- }
- delete nillableInput;
+ cout << "nillable element=" << *(nillableResult) << endl;
+ delete nillableResult;
+ }
+ else
+ cout << "nillable element=<nil>" << endl;
- // Test nillable element, with nil
+ // Test nillable element, with nil
nillableResult = ws->asNillableElement(NULL);
- if (nillableResult)
- {
- cout << "nil element=" << *(nillableResult) << endl;
- delete nillableResult;
- }
- else
- {
- cout << "nil element=<nil>" << endl;
- }
-
- // Test required attribute
- RequiredAttributeElement requiredAttributeInput;
- requiredAttributeInput.setrequiredAttribute(123456789);
- RequiredAttributeElement* requiredAttributeResult = ws->asRequiredAttribute(&requiredAttributeInput);
- cout << "required attribute=" << requiredAttributeResult->getrequiredAttribute() << endl;
- delete requiredAttributeResult;
+ if (nillableResult)
+ {
+ cout << "nil element=" << *(nillableResult) << endl;
+ delete nillableResult;
+ }
+ else
+ cout << "nil element=<nil>" << endl;
+
+ // Test required attribute
+ RequiredAttributeElement requiredAttributeInput;
+ RequiredAttributeElement* requiredAttributeResult;
+
+ requiredAttributeInput.setrequiredAttribute(123456789);
+ 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(123456789);
- OptionalAttributeElement* optionalAttributeResult = ws->asOptionalAttribute(&optionalAttributeInput);
- if (optionalAttributeResult->getoptionalAttribute())
- {
- cout << "optional attribute, with data=" << *(optionalAttributeResult->getoptionalAttribute()) << endl;
- }
- else
- {
- cout << "optional attribute, with data=<not present>" << 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=<not present>" << endl;
- }
- delete optionalAttributeResult;
+ // Test optional attribute, with a value
+ OptionalAttributeElement optionalAttributeInput;
+ optionalAttributeInput.setoptionalAttribute(123456789);
+ OptionalAttributeElement* optionalAttributeResult = ws->asOptionalAttribute(&optionalAttributeInput);
+ if (optionalAttributeResult->getoptionalAttribute())
+ cout << "optional attribute, with data=" << *(optionalAttributeResult->getoptionalAttribute()) << endl;
+ else
+ cout << "optional attribute, with data=<not present>" << 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=<not present>" << endl;
+
+ delete optionalAttributeResult;
*/
- // Test array
+ // Test array
+#define ARRAY_SIZE 2
+ int i, outputSize=0;
+
xsd__duration_Array arrayInput;
- int arraySize=2;
- xsd__duration ** array = new xsd__duration*[arraySize];
- for (int inputIndex=0 ; inputIndex < 2 ; inputIndex++)
- {
- array[inputIndex] = new xsd__duration(123456789);
-
- }
- arrayInput.set(array,arraySize);
- xsd__duration_Array* arrayResult = ws->asArray(&arrayInput);
- int outputSize=0;
- const xsd__duration **output = arrayResult->get(outputSize);
- cout << "array of " << outputSize << " elements" << endl;
- for (int index = 0; index < outputSize; index++)
- {
- cout << " element[" << index << "]=" << *((xsd__duration*)output[index]) << endl;
-
- }
-
- // Clear up input array
- for (int deleteIndex = 0 ; deleteIndex < arraySize ; deleteIndex++ )
- {
- delete array[deleteIndex];
- }
- delete [] array;
- delete arrayResult;
-
+ xsd__duration_Array* arrayResult;
+ xsd__duration * array[ARRAY_SIZE];
+ const xsd__duration **output;
+
+ for (i=0 ; i < 2 ; i++)
+ array[i] = new xsd__duration(123456789);
+
+ arrayInput.set(array,ARRAY_SIZE);
+
+ arrayResult = ws->asArray(&arrayInput);
+
+ if (arrayResult)
+ output = arrayResult->get(outputSize);
- // Test complex type
- SimpleComplexType complexTypeInput;
- complexTypeInput.setcomplexTypeElement(123456789);
- SimpleComplexType* complexTypeResult = ws->asComplexType(&complexTypeInput);
- cout << "within complex type=" << complexTypeResult->getcomplexTypeElement() << endl;
- delete complexTypeResult;
+ cout << "array of " << outputSize << " elements" << endl;
+ for (i = 0; i < outputSize; i++)
+ cout << " element[" << i << "]=" << *((xsd__duration*)output[i]) << endl;
+
+ // Clear up input array
+ for (i = 0 ; i < ARRAY_SIZE ; i++ )
+ delete array[i];
- // Tests now complete
+ delete arrayResult;
- 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;
+ // Test complex type
+ SimpleComplexType complexTypeInput;
+ SimpleComplexType* complexTypeResult;
- return 0;
+ complexTypeInput.setcomplexTypeElement(123456789);
+ 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;
}
Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_float1Client.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_float1Client.cpp?rev=405619&r1=405618&r2=405619&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_float1Client.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_float1Client.cpp Tue May 9 20:53:03 2006
@@ -14,6 +14,16 @@
// limitations under the License.
+/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
+/* NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE */
+/* ---------------------------------------------------------------- */
+/* CHANGES TO THIS FILE MAY ALSO REQUIRE CHANGES TO THE */
+/* C-EQUIVALENT FILE. PLEASE ENSURE THAT IT IS DONE. */
+/* ---------------------------------------------------------------- */
+/* NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE */
+/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
+
+
#include "XSD_float.hpp"
#include <axis/AxisException.hpp>
#include <ctype.h>
@@ -22,42 +32,44 @@
int main(int argc, char* argv[])
{
- char endpoint[256];
- const char* url="http://localhost:80/axis/XSD_float";
-
- if(argc>1)
- url = argv[1];
+ XSD_float* ws ;
+
+ xsd__float result;
+
+ char endpoint[256];
+ const char* url="http://localhost:80/axis/XSD_float";
+
+ if(argc>1)
+ url = argv[1];
+
+ try
+ {
+ sprintf(endpoint, "%s", url);
+ ws = new XSD_float(endpoint);
+
+ // Test non-nillable element
+ result = ws->asNonNillableElement((xsd__float)555.555);
+ printf("non-nillable element=%.6g\n", result);
+ fflush(stdout);
+
+ // 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;
+ }
- // bool bSuccess = false;
+ cout<< "---------------------- TEST COMPLETE -----------------------------"<< endl;
- try
- {
- sprintf(endpoint, "%s", url);
- XSD_float* ws = new XSD_float(endpoint);
-
- // Test non-nillable element
- xsd__float result = ws->asNonNillableElement((xsd__float)555.555);
- printf("non-nillable element=%.6g\n", result);
- fflush(stdout);
-
- // 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;
+ return 0;
}
Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_floatClient.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_floatClient.cpp?rev=405619&r1=405618&r2=405619&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_floatClient.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_floatClient.cpp Tue May 9 20:53:03 2006
@@ -14,6 +14,16 @@
// limitations under the License.
+/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
+/* NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE */
+/* ---------------------------------------------------------------- */
+/* CHANGES TO THIS FILE MAY ALSO REQUIRE CHANGES TO THE */
+/* C-EQUIVALENT FILE. PLEASE ENSURE THAT IT IS DONE. */
+/* ---------------------------------------------------------------- */
+/* NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE */
+/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
+
+
#include "XSD_float.hpp"
#include <axis/AxisException.hpp>
#include <ctype.h>
@@ -22,60 +32,62 @@
int main(int argc, char* argv[])
{
- char endpoint[256];
- const char* url="http://localhost:80/axis/XSD_float";
-
- if(argc>1)
- url = argv[1];
-
- // bool bSuccess = false;
-
- try
- {
- sprintf(endpoint, "%s", url);
- XSD_float* ws = new XSD_float(endpoint);
-
- // Test non-nillable element
- xsd__float result = ws->asNonNillableElement((xsd__float)35.353588);
- printf("non-nillable element=%.6g\n", result);
+ XSD_float* ws;
+
+ xsd__float result;
+ xsd__float input;
+ xsd__float* nillableResult;
+
+ char endpoint[256];
+ const char* url="http://localhost:80/axis/XSD_float";
+
+ if(argc>1)
+ url = argv[1];
+
+ // bool bSuccess = false;
+
+ try
+ {
+ sprintf(endpoint, "%s", url);
+ ws = new XSD_float(endpoint);
+
+ // Test non-nillable element
+ result = ws->asNonNillableElement((xsd__float)35.353588);
+ printf("non-nillable element=%.6g\n", result);
fflush(stdout);
- // Test nillable element, with a value
- xsd__float* nillableInput = new xsd__float();
- *(nillableInput) = (xsd__float)35.353588;
- xsd__float* nillableResult = ws->asNillableElement(nillableInput);
- if (nillableResult)
- {
- printf("nillable element=%.6g\n", *(nillableResult));
+ // Test nillable element, with a value
+ input = (xsd__float)35.353588;
+ nillableResult = ws->asNillableElement(&input);
+ if (nillableResult)
+ {
+ printf("nillable element=%.6g\n", *(nillableResult));
fflush(stdout);
- delete nillableResult;
- }
- else
- {
- cout << "nillable element=<nil>" << endl;
- }
- delete nillableInput;
+ delete nillableResult;
+ }
+ else
+ cout << "nillable element=<nil>" << endl;
- // Test nillable element, with nil
+ // Test nillable element, with nil
nillableResult = ws->asNillableElement(NULL);
- if (nillableResult)
- {
- printf("nil element=%.6g\n", *(nillableResult));
+ if (nillableResult)
+ {
+ printf("nil element=%.6g\n", *(nillableResult));
fflush(stdout);
- delete nillableResult;
- }
- else
- {
- cout << "nil element=<nil>" << endl;
- }
+ delete nillableResult;
+ }
+ else
+ cout << "nil element=<nil>" << endl;
- // Test required attribute
- RequiredAttributeElement requiredAttributeInput;
- requiredAttributeInput.setrequiredAttribute((xsd__float)35.353588);
- RequiredAttributeElement* requiredAttributeResult = ws->asRequiredAttribute(&requiredAttributeInput);
- printf("required attribute=%.6g\n", requiredAttributeResult->getrequiredAttribute());
+ // Test required attribute
+ RequiredAttributeElement requiredAttributeInput;
+ RequiredAttributeElement* requiredAttributeResult;
+
+ requiredAttributeInput.setrequiredAttribute((xsd__float)35.353588);
+ requiredAttributeResult = ws->asRequiredAttribute(&requiredAttributeInput);
+ printf("required attribute=%.6g\n", requiredAttributeResult->getrequiredAttribute());
fflush(stdout);
- delete requiredAttributeResult;
+ delete requiredAttributeResult;
/* Optional Attributes currently unsupported by WSDL2Ws
* Exact coding of this section may change depending on chosen implementation
@@ -109,60 +121,63 @@
delete optionalAttributeResult;
*/
- // Test array
+ // Test array
+#define ARRAY_SIZE 2
+ int i, outputSize=0;
+
xsd__float_Array arrayInput;
- int arraySize=2;
- xsd__float ** array = new xsd__float*[arraySize];
+ xsd__float_Array* arrayResult;
+ xsd__float * array[ARRAY_SIZE];
+ const xsd__float ** output;
+
+ for (i=0 ; i < ARRAY_SIZE ; i++)
+ array[i] = new xsd__float(35.353588);
+ arrayInput.set(array,ARRAY_SIZE);
- for (int inputIndex=0 ; inputIndex < arraySize ; inputIndex++)
- {
- array[inputIndex] = new xsd__float(35.353588);
- }
- arrayInput.set(array,arraySize);
- xsd__float_Array* arrayResult = ws->asArray(&arrayInput);
- int outputSize=0;
- const xsd__float ** output = arrayResult->get(outputSize);
+ arrayResult = ws->asArray(&arrayInput);
+
+ if (arrayResult)
+ output = arrayResult->get(outputSize);
+
cout << "array of " << outputSize << " elements" << endl;
- for (int index = 0; index < outputSize ; index++)
- {
- printf(" element[%i]=%.6g\n", index, *(output[index]));
- fflush(stdout);
-
- }
- // Clear up input array
- for (int deleteIndex = 0 ; deleteIndex < arraySize ; deleteIndex++ )
+ for (i = 0; i < outputSize ; i++)
{
- delete array[deleteIndex];
+ printf(" element[%i]=%.6g\n", i, *(output[i]));
+ fflush(stdout);
}
- delete [] array;
+ // Clear up input array
+ for (i = 0 ; i < ARRAY_SIZE ; i++ )
+ delete array[i];
delete arrayResult;
- // Test complex type
- SimpleComplexType complexTypeInput;
- complexTypeInput.setcomplexTypeElement((xsd__float) 35.353588);
- SimpleComplexType* complexTypeResult = ws->asComplexType(&complexTypeInput);
- printf("within complex type=%.6g\n", complexTypeResult->getcomplexTypeElement());
+ // Test complex type
+ SimpleComplexType complexTypeInput;
+ SimpleComplexType* complexTypeResult;
+
+ complexTypeInput.setcomplexTypeElement((xsd__float) 35.353588);
+ complexTypeResult = ws->asComplexType(&complexTypeInput);
+ printf("within complex type=%.6g\n", complexTypeResult->getcomplexTypeElement());
fflush(stdout);
- delete complexTypeResult;
+ delete complexTypeResult;
- // Tests now complete
+ // 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;
- }
+ 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;
+ cout<< "---------------------- TEST COMPLETE -----------------------------"<< endl;
+
+ return 0;
}