Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 25268 invoked from network); 15 May 2006 22:56:21 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 15 May 2006 22:56:21 -0000 Received: (qmail 60509 invoked by uid 500); 15 May 2006 22:56:19 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 60411 invoked by uid 500); 15 May 2006 22:56:19 -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 60400 invoked by uid 99); 15 May 2006 22:56:18 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 May 2006 15:56:18 -0700 X-ASF-Spam-Status: No, hits=-8.2 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME,WEIRD_QUOTING 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; Mon, 15 May 2006 15:56:17 -0700 Received: (qmail 25162 invoked by uid 65534); 15 May 2006 22:55:57 -0000 Message-ID: <20060515225557.25154.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r406763 - in /webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp: IAttributeTest1Client.cpp IAttributeTest2Client.cpp IAttributeTest3Client.cpp IAttributeTest4Client.cpp Date: Mon, 15 May 2006 22:55:55 -0000 To: axis-cvs@ws.apache.org From: nadiramra@apache.org X-Mailer: svnmailer-1.0.8 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: nadiramra Date: Mon May 15 15:55:54 2006 New Revision: 406763 URL: http://svn.apache.org/viewcvs?rev=406763&view=rev Log: C support fixes/enhancements. Cleanup C++ testcase for porting to C. Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/IAttributeTest1Client.cpp webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/IAttributeTest2Client.cpp webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/IAttributeTest3Client.cpp webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/IAttributeTest4Client.cpp Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/IAttributeTest1Client.cpp URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/IAttributeTest1Client.cpp?rev=406763&r1=406762&r2=406763&view=diff ============================================================================== --- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/IAttributeTest1Client.cpp (original) +++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/IAttributeTest1Client.cpp Mon May 15 15:55:54 2006 @@ -17,6 +17,16 @@ @Author : James Jose */ +/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */ +/* 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 "Calculator.hpp" #include #include @@ -24,73 +34,79 @@ int main(int argc, char* argv[]) { - char endpoint[256]; - const char* url="http://localhost:80/axis/Calculator"; - const char* op = 0; - int i1=0, i2=0; - int iResult; - url = argv[1]; - bool bSuccess = false; - int iRetryIterationCount = 3; + char endpoint[256]; + const char* url="http://localhost:80/axis/Calculator"; + const char* op = 0; + int i1=0, i2=0; + int iResult; + url = argv[1]; + bool bSuccess = false; + int iRetryIterationCount = 3; + + const char *name="Name"; + + IHeaderBlock *phb; + IAttribute *attr, *attr1; + BasicNode *bn; + - do - { + do + { try { - sprintf(endpoint, "%s", url); - Calculator ws(endpoint); - const char *name="Name"; - IHeaderBlock *phb = ws.createSOAPHeaderBlock("TestHeader","http://ws.apache.org/","ns"); - IAttribute *attr=phb->createAttribute("NAME","ns","AXIS"); - cout << attr->setLocalName(NULL)<setLocalName(name)<createImmediateChild(ELEMENT_NODE,"Project","","",""); - IAttribute *attr1=bn->createAttribute("TYPE","Open Source"); - attr1->setLocalName("Type"); - cout << "Header Attribute Name = " << attr->getLocalName()<< endl ; - cout << "Child Node Attribute Name = " << attr1->getLocalName() << endl; - op = "add"; - i1 = 2; - i2 = 3; - if (strcmp(op, "add") == 0) - { - iResult = ws.add(i1, i2); - cout << iResult << endl; - bSuccess = true; - } + if (argc > 1) + url = argv[1]; + sprintf(endpoint, "%s", url); + Calculator ws(endpoint); + + phb = ws.createSOAPHeaderBlock("TestHeader","http://ws.apache.org/","ns"); + attr=phb->createAttribute("NAME","ns","AXIS"); + cout << attr->setLocalName(NULL)<setLocalName(name)<createImmediateChild(ELEMENT_NODE,"Project","","",""); + attr1=bn->createAttribute("TYPE","Open Source"); + attr1->setLocalName("Type"); + cout << "Header Attribute Name = " << attr->getLocalName()<< endl ; + cout << "Child Node Attribute Name = " << attr1->getLocalName() << endl; + op = "add"; + i1 = 2; + i2 = 3; + if (strcmp(op, "add") == 0) + { + iResult = ws.add(i1, i2); + cout << iResult << endl; + bSuccess = true; + } } catch(AxisException& e) { - bool bSilent = false; + bool bSilent = false; - if( e.getExceptionCode() == CLIENT_TRANSPORT_OPEN_CONNECTION_FAILED) - { - if( iRetryIterationCount > 0) - { - bSilent = true; - } - } - else - { - iRetryIterationCount = 0; - } + if( e.getExceptionCode() == CLIENT_TRANSPORT_OPEN_CONNECTION_FAILED) + { + if( iRetryIterationCount > 0) + bSilent = true; + } + else + iRetryIterationCount = 0; if( !bSilent) - { - cout << "Exception : " << e.what() << endl; - } + cout << "Exception : " << e.what() << endl; } catch(exception& e) { - cout << "Unknown exception has occured" << endl; + cout << "Unknown exception has occured" << endl; } catch(...) { - cout << "Unspecified exception has occured" << endl; + cout << "Unspecified exception has occured" << endl; } - iRetryIterationCount--; - } while( iRetryIterationCount > 0 && !bSuccess); - cout<< "---------------------- TEST COMPLETE -----------------------------" << endl; - return 0; + iRetryIterationCount--; + } + while( iRetryIterationCount > 0 && !bSuccess); + + cout<< "---------------------- TEST COMPLETE -----------------------------" << endl; + + return 0; } Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/IAttributeTest2Client.cpp URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/IAttributeTest2Client.cpp?rev=406763&r1=406762&r2=406763&view=diff ============================================================================== --- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/IAttributeTest2Client.cpp (original) +++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/IAttributeTest2Client.cpp Mon May 15 15:55:54 2006 @@ -18,6 +18,16 @@ @ Author : James Jose */ +/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */ +/* 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 "Calculator.hpp" #include #include @@ -25,75 +35,81 @@ int main(int argc, char* argv[]) { - char endpoint[256]; - const char* url="http://localhost:80/axis/Calculator"; - const char* op = 0; - int i1=0, i2=0; - int iResult; - url = argv[1]; - bool bSuccess = false; - int iRetryIterationCount = 3; + char endpoint[256]; + const char* url="http://localhost:80/axis/Calculator"; + const char* op = 0; + int i1=0, i2=0; + int iResult; + bool bSuccess = false; + int iRetryIterationCount = 3; + + const char *prefix="nsp"; + + IHeaderBlock *phb; + IAttribute *attr1, *attr2; + BasicNode *bn; - do - { + do + { try { - sprintf(endpoint, "%s", url); - Calculator ws(endpoint); - const char *prefix="nsp"; - IHeaderBlock *phb = ws.createSOAPHeaderBlock("TestHeader","http://ws.apache.org/","nsp"); - IAttribute *attr1=phb->createAttribute("Name","ns","AXIS"); - /* Tests for NULL Value */ - cout<setPrefix(NULL)<setPrefix(prefix)<createImmediateChild(ELEMENT_NODE,"Project","","",""); - IAttribute *attr2=bn->createAttribute("TYPE","Open Source"); - /* Tests for non declared namespace prefix */ - cout<setPrefix("nd")< 1) + url = argv[1]; + sprintf(endpoint, "%s", url); + Calculator ws(endpoint); + + phb = ws.createSOAPHeaderBlock("TestHeader","http://ws.apache.org/","nsp"); + attr1=phb->createAttribute("Name","ns","AXIS"); + + /* Tests for NULL Value */ + cout<setPrefix(NULL)<setPrefix(prefix)<createImmediateChild(ELEMENT_NODE,"Project","","",""); + attr2=bn->createAttribute("TYPE","Open Source"); + + /* Tests for non declared namespace prefix */ + cout<setPrefix("nd")< 0) - { - bSilent = true; - } - } - else - { - iRetryIterationCount = 0; - } + if( e.getExceptionCode() == CLIENT_TRANSPORT_OPEN_CONNECTION_FAILED) + { + if( iRetryIterationCount > 0) + bSilent = true; + } + else + iRetryIterationCount = 0; if( !bSilent) - { - cout << "Exception : " << e.what() << endl; - } + cout << "Exception : " << e.what() << endl; } catch(exception& e) { - cout << "Unknown exception has occured" << endl; + cout << "Unknown exception has occured" << endl; } catch(...) { - cout << "Unspecified exception has occured" << endl; + cout << "Unspecified exception has occured" << endl; } - iRetryIterationCount--; - } while( iRetryIterationCount > 0 && !bSuccess); - cout<< "---------------------- TEST COMPLETE -----------------------------"<< endl; - return 0; + iRetryIterationCount--; + } + while( iRetryIterationCount > 0 && !bSuccess); + + cout<< "---------------------- TEST COMPLETE -----------------------------"<< endl; + + return 0; } Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/IAttributeTest3Client.cpp URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/IAttributeTest3Client.cpp?rev=406763&r1=406762&r2=406763&view=diff ============================================================================== --- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/IAttributeTest3Client.cpp (original) +++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/IAttributeTest3Client.cpp Mon May 15 15:55:54 2006 @@ -18,6 +18,14 @@ @ Author : James Jose */ +/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */ +/* 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 "Calculator.hpp" #include @@ -26,75 +34,82 @@ int main(int argc, char* argv[]) { - char endpoint[256]; - const char* url="http://localhost:80/axis/Calculator"; - const char* op = 0; - int i1=0, i2=0; - int iResult; - url = argv[1]; - bool bSuccess = false; - int iRetryIterationCount = 3; + char endpoint[256]; + const char* url="http://localhost:80/axis/Calculator"; + const char* op = 0; + int i1=0, i2=0; + int iResult; + + bool bSuccess = false; + int iRetryIterationCount = 3; + + const char *Value="AXIS"; + + IHeaderBlock *phb; + IAttribute *attr1, *attr2; + BasicNode *bn; - do - { + do + { try { - sprintf(endpoint, "%s", url); - Calculator ws(endpoint); - const char *Value="AXIS"; - IHeaderBlock *phb = ws.createSOAPHeaderBlock("TestHeader","http://ws.apache.org/","ns"); - IAttribute *attr1=phb->createAttribute("Name","ns","axis"); - /*Tests for NULL Value */ - cout << attr1->setValue(NULL) << endl; - cout << attr1->setValue(Value)<< endl; - BasicNode *bn=phb->createImmediateChild(ELEMENT_NODE,"Project","","",""); - IAttribute *attr2=bn->createAttribute("TYPE","OPEN SOURCE"); - attr2->setValue("Open Source"); - cout << "Header Attribute Value = " << attr1->getValue()<< endl; - cout << "Child Node Attribute Value = " << attr2->getValue()< 1) + url = argv[1]; + sprintf(endpoint, "%s", url); + Calculator ws(endpoint); + + phb = ws.createSOAPHeaderBlock("TestHeader","http://ws.apache.org/","ns"); + attr1=phb->createAttribute("Name","ns","axis"); + + /*Tests for NULL Value */ + cout << attr1->setValue(NULL) << endl; + cout << attr1->setValue(Value)<< endl; + + bn=phb->createImmediateChild(ELEMENT_NODE,"Project","","",""); + attr2=bn->createAttribute("TYPE","OPEN SOURCE"); + attr2->setValue("Open Source"); + cout << "Header Attribute Value = " << attr1->getValue()<< endl; + cout << "Child Node Attribute Value = " << attr2->getValue()< 0) - { - bSilent = true; - } - } - else - { - iRetryIterationCount = 0; - } + if( e.getExceptionCode() == CLIENT_TRANSPORT_OPEN_CONNECTION_FAILED) + { + if( iRetryIterationCount > 0) + bSilent = true; + } + else + iRetryIterationCount = 0; if( !bSilent) - { - cout << "Exception : " << e.what() << endl; - } + cout << "Exception : " << e.what() << endl; } catch(exception& e) { - cout << "Unknown exception has occured" << endl; + cout << "Unknown exception has occured" << endl; } catch(...) { - cout << "Unspecified exception has occured" << endl; + cout << "Unspecified exception has occured" << endl; } - iRetryIterationCount--; - } while( iRetryIterationCount > 0 && !bSuccess); - cout<< "---------------------- TEST COMPLETE -----------------------------"<< endl; - return 0; + + iRetryIterationCount--; + } + while( iRetryIterationCount > 0 && !bSuccess); + + cout<< "---------------------- TEST COMPLETE -----------------------------"<< endl; + return 0; } Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/IAttributeTest4Client.cpp URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/IAttributeTest4Client.cpp?rev=406763&r1=406762&r2=406763&view=diff ============================================================================== --- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/IAttributeTest4Client.cpp (original) +++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/IAttributeTest4Client.cpp Mon May 15 15:55:54 2006 @@ -18,6 +18,14 @@ @ Author : James Jose */ +/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */ +/* 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 "Calculator.hpp" #include @@ -26,77 +34,83 @@ int main(int argc, char* argv[]) { - char endpoint[256]; - const char* url="http://localhost:80/axis/Calculator"; - const char* op = 0; - int i1=0, i2=0; - int iResult; - url = argv[1]; - bool bSuccess = false; - int iRetryIterationCount = 3; + char endpoint[256]; + const char* url="http://localhost:80/axis/Calculator"; + const char* op = 0; + int i1=0, i2=0; + int iResult; + const char *uri="http://axis.apache.com"; + + bool bSuccess = false; + int iRetryIterationCount = 3; + + IHeaderBlock *phb; + INamespace *nsp; + IAttribute *attr1, *attr2; + BasicNode *bn; - do - { + do + { try { - sprintf(endpoint, "%s", url); - Calculator ws(endpoint); - const char *uri="http://axis.apache.com"; - IHeaderBlock *phb = ws.createSOAPHeaderBlock("TestHeader","http://ws.apache.org/","ns"); - INamespace *nsp=phb->createNamespaceDecl("nsp","http://apache.com"); - IAttribute *attr1=phb->createAttribute("Name","nsp","axis"); - cout<setURI(NULL)<setURI("http://axis.apache.com")<createImmediateChild(ELEMENT_NODE,"Project","","",""); - IAttribute *attr2=bn->createAttribute("TYPE","OPEN SOURCE"); - attr2->setURI(uri); - cout << "Header Attribute Uri = " << attr1->getURI()< 1) + url = argv[1]; + sprintf(endpoint, "%s", url); + Calculator ws(endpoint); + + phb = ws.createSOAPHeaderBlock("TestHeader","http://ws.apache.org/","ns"); + nsp=phb->createNamespaceDecl("nsp","http://apache.com"); + attr1=phb->createAttribute("Name","nsp","axis"); + cout<setURI(NULL)<setURI("http://axis.apache.com")<createImmediateChild(ELEMENT_NODE,"Project","","",""); + attr2=bn->createAttribute("TYPE","OPEN SOURCE"); + attr2->setURI(uri); + + cout << "Header Attribute Uri = " << attr1->getURI()< 0) - { - bSilent = true; - } - } - else - { - iRetryIterationCount = 0; - } + if( e.getExceptionCode() == CLIENT_TRANSPORT_OPEN_CONNECTION_FAILED) + { + if( iRetryIterationCount > 0) + bSilent = true; + } + else + iRetryIterationCount = 0; if( !bSilent) - { - cout << "Exception : " << e.what() << endl; - } + cout << "Exception : " << e.what() << endl; } catch(exception& e) { - cout << "Unknown exception has occured" << endl; + cout << "Unknown exception has occured" << endl; } catch(...) { - cout << "Unspecified exception has occured" << endl; + cout << "Unspecified exception has occured" << endl; } - iRetryIterationCount--; - } while( iRetryIterationCount > 0 && !bSuccess); - cout<< "---------------------- TEST COMPLETE -----------------------------"<< endl; - return 0; + iRetryIterationCount--; + } + while( iRetryIterationCount > 0 && !bSuccess); + + cout<< "---------------------- TEST COMPLETE -----------------------------"<< endl; + + return 0; }