axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nadira...@apache.org
Subject svn commit: r407960 - /webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/FaultMappingDocClient.cpp
Date Sat, 20 May 2006 06:49:31 GMT
Author: nadiramra
Date: Fri May 19 23:49:30 2006
New Revision: 407960

URL: http://svn.apache.org/viewvc?rev=407960&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/FaultMappingDocClient.cpp

Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/FaultMappingDocClient.cpp
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/FaultMappingDocClient.cpp?rev=407960&r1=407959&r2=407960&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/FaultMappingDocClient.cpp
(original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/FaultMappingDocClient.cpp
Fri May 19 23:49:30 2006
@@ -13,6 +13,15 @@
 // See the License for the specific language governing permissions and
 // 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 "MathOps.hpp"
 #include <axis/AxisException.hpp>
 #include <ctype.h>
@@ -24,132 +33,132 @@
 
 int main(int argc, char* argv[])
 {
-        char endpoint[256];
-        const char* server="localhost";
-        const char* url="http://localhost:80/axis/MathOps";
-        const char* port="80";
-        const char* op = 0;
-        const char* p1 = 0;
-        const char* p2 = 0;
-        int i1=0, i2=0;
-        int iResult;
-        char* pcDetail;
-
-        signal(SIGILL, sig_handler);
-        signal(SIGABRT, sig_handler);
-        signal(SIGSEGV, sig_handler);
-        //signal(SIGQUIT, sig_handler);
-        //signal(SIGBUS, sig_handler);
-        signal(SIGFPE, sig_handler);
-
-        url = argv[1];
-
-        sprintf(endpoint, "%s", url);
-
-        op = "div";
-
-        if (strcmp(op, "div") == 0)
+    char endpoint[256];
+    const char* server="localhost";
+    const char* url="http://localhost:80/axis/MathOps";
+    const char* port="80";
+    const char* op = 0;
+    const char* p1 = 0;
+    const char* p2 = 0;
+    int i1=0, i2=0;
+    int iResult;
+    char* pcDetail;
+
+    signal(SIGILL, sig_handler);
+    signal(SIGABRT, sig_handler);
+    signal(SIGSEGV, sig_handler);
+    //signal(SIGQUIT, sig_handler);
+    //signal(SIGBUS, sig_handler);
+    signal(SIGFPE, sig_handler);
+
+    url = argv[1];
+
+    sprintf(endpoint, "%s", url);
+
+    op = "div";
+
+    if (strcmp(op, "div") == 0)
+    {
+        for(int i = 0; i < 4; i++)
         {
-            for(int i = 0; i < 4; i++)
-            {
             cout << i << endl;
 
-                        switch(i)
-                        {
-                                case 0: i1 = 10; i2 = 5; break;
-                                case 1: i1 = 10; i2 = 0; break;
-                                case 2: i1 = 1000; i2 = 5; break;
-                                case 3: i1 = 10; i2 = -5; break;
-                        }
-                bool bSuccess = false;
-                int     iRetryIterationCount = 3;
+            switch(i)
+            {
+                case 0: i1 = 10; i2 = 5; break;
+                case 1: i1 = 10; i2 = 0; break;
+                case 2: i1 = 1000; i2 = 5; break;
+                case 3: i1 = 10; i2 = -5; break;
+            }
+            bool bSuccess = false;
+            int     iRetryIterationCount = 3;
 
-                do
+            do
+            {
+                try
                 {
-                        try
-                        {
-                                MathOps ws(endpoint);
-                                if( iRetryIterationCount == 3)
-                                        cout << "Trying to " << op << "
" << i1 << " by " << i2 << endl;
-                                iResult = ws.div(i1, i2);               
-                                cout << "Result is " << iResult << endl;
-                                bSuccess = true;
-                        }
-                        catch(DivByZeroStruct& dbzs)
-                        {
-                                cout << "DivByZeroStruct Fault: \"" 
-                                        << dbzs.varString 
-                                        << "\", " 
-                                        << dbzs.varInt 
-                                        << ", " 
-                                        << dbzs.varFloat 
-                                        << endl; 
-                                bSuccess = true;
-                        }
-                        catch(SpecialDetailStruct& sds)
-                        {
-                                cout << "SpecialDetailStruct Fault: \"" 
-                                        << sds.varString 
-                                        << "\"" 
-                                        << endl;
-                                bSuccess = true;
-                        }
-                        catch(OutOfBoundStruct& oobs)
-                        {
-                                cout << "OutOfBoundStruct Fault: \"" 
-                                        << oobs.varString 
-                                        << "\", " 
-                                        << oobs.varInt 
-                                        << ", \"" 
-                                        << oobs.specialDetail->varString 
-                                        << "\"" 
-                                        << endl;
-                                bSuccess = true;
-                        }
-                        catch(SoapFaultException& sfe)
-                        {
-                                cout << "SoapFaultException: " << sfe.what()
<< endl;
-                        }
-                        catch(AxisException& e)
-                        {
-                        bool bSilent = false;
-
-                        if( e.getExceptionCode() == CLIENT_TRANSPORT_OPEN_CONNECTION_FAILED)
-                        {
-                                if( iRetryIterationCount > 0)
-                                {
-                                        bSilent = true;
-                                }
-                        }
-                        else
-                        {
-                                iRetryIterationCount = 0;
-                        }
+                    MathOps ws(endpoint);
+                    if( iRetryIterationCount == 3)
+                        cout << "Trying to " << op << " " << i1 <<
" by " << i2 << endl;
+                    iResult = ws.div(i1, i2);
+                    cout << "Result is " << iResult << endl;
+                    bSuccess = true;
+                }
+                catch(DivByZeroStruct& dbzs)
+                {
+                    cout << "DivByZeroStruct Fault: \""
+                      << dbzs.varString
+                      << "\", "
+                      << dbzs.varInt
+                      << ", "
+                      << dbzs.varFloat
+                      << endl;
+                    bSuccess = true;
+                }
+                catch(SpecialDetailStruct& sds)
+                {
+                    cout << "SpecialDetailStruct Fault: \""
+                      << sds.varString
+                      << "\""
+                      << endl;
+                    bSuccess = true;
+                }
+                catch(OutOfBoundStruct& oobs)
+                {
+                    cout << "OutOfBoundStruct Fault: \""
+                      << oobs.varString
+                      << "\", "
+                      << oobs.varInt
+                      << ", \""
+                      << oobs.specialDetail->varString
+                      << "\""
+                      << endl;
+                    bSuccess = true;
+                }
+                catch(SoapFaultException& sfe)
+                {
+                    cout << "SoapFaultException: " << sfe.what() << endl;
+                }
+                catch(AxisException& e)
+                {
+                    bool bSilent = false;
 
-            if( !bSilent)
-                        {
-                                cout << "Exception : " << e.what() << endl;
-                        }
-                        }
-                        catch(exception& e)
-                        {
-                cout << "Unknown Exception: " << endl;
-                        }
-                        catch(...)
-                        {
-                cout << "Unspecified Exception: " << endl;
-                        }
+                    if( e.getExceptionCode() == CLIENT_TRANSPORT_OPEN_CONNECTION_FAILED)
+                    {
+                        if( iRetryIterationCount > 0)
+                        {
+                            bSilent = true;
+                        }
+                    }
+                    else
+                    {
+                        iRetryIterationCount = 0;
+                    }
+
+                    if( !bSilent)
+                    {
+                        cout << "Exception : " << e.what() << endl;
+                    }
+                }
+                catch(exception& e)
+                {
+                    cout << "Unknown Exception: " << endl;
+                }
+                catch(...)
+                {
+                    cout << "Unspecified Exception: " << endl;
+                }
                 iRetryIterationCount--;
-                } while( iRetryIterationCount > 0 && !bSuccess);
-            }
+            } while( iRetryIterationCount > 0 && !bSuccess);
         }
-        else 
-        {
-                cout << "Invalid operation " << op << endl;
-        }
-        cout << "---------------------- TEST COMPLETE -----------------------------"<<
endl;
-        
-        return 0;
+    }
+    else
+    {
+        cout << "Invalid operation " << op << endl;
+    }
+    cout << "---------------------- TEST COMPLETE -----------------------------"<<
endl;
+
+    return 0;
 }
 
 void sig_handler(int sig) {



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message