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 pe...@apache.org on 2004/11/14 21:03:49 UTC

cvs commit: ws-axis/c/tests/auto_build/testcases/output FaultMappingDoc.cpp.out

perryan     2004/11/14 12:03:49

  Modified:    c/tests/auto_build/testcases/client/cpp
                        FaultMappingDocClient.cpp
               c/tests/auto_build/testcases/output FaultMappingDoc.cpp.out
  Log:
  Updated FaultMapping to extract the Fault detail. Updated the expected output file to match
  CVS: ----------------------------------------------------------------------
  CVS: PR:
  CVS:   If this change addresses a PR in the problem report tracking
  CVS:   database, then enter the PR number(s) here.
  CVS: Obtained from:
  CVS:   If this change has been taken from another system, such as NCSA,
  CVS:   then name the system in this line, otherwise delete it.
  CVS: Submitted by:
  CVS:   If this code has been contributed to Apache by someone else; i.e.,
  CVS:   they sent us a patch or a new module, then include their name/email
  CVS:   address here. If this is your work then delete this line.
  CVS: Reviewed by:
  CVS:   If we are doing pre-commit code reviews and someone else has
  CVS:   reviewed your changes, include their name(s) here.
  CVS:   If you have not had it reviewed then delete this line.
  
  Revision  Changes    Path
  1.5       +25 -6     ws-axis/c/tests/auto_build/testcases/client/cpp/FaultMappingDocClient.cpp
  
  Index: FaultMappingDocClient.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/tests/auto_build/testcases/client/cpp/FaultMappingDocClient.cpp,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- FaultMappingDocClient.cpp	9 Nov 2004 10:26:21 -0000	1.4
  +++ FaultMappingDocClient.cpp	14 Nov 2004 20:03:49 -0000	1.5
  @@ -1,6 +1,7 @@
   #include "MathOps.hpp"
   #include <axis/server/AxisException.hpp>
   #include <ctype.h>
  +#include <iostream>
   
   void PrintUsage();
   bool IsNumber(const char* p);
  @@ -39,24 +40,42 @@
   			}
   			try
   			{
  +				cout << "Trying to " << op << " " << i1 << " by " << i2 << endl;
   				iResult = ws.div(i1, i2);		
  -				printf("Result is:%d\n", iResult);
  +				cout << "Result is " << iResult << endl;
   			}
  -			catch(MathOpsService_AxisClientException& e)
  +			catch(MathOpsService_AxisClientException &me)
   			{
  -				printf("MathOpsService Exception: %s\n", e.what());
  +				cout << "MathOpsService_AxisClientException: ";
  +				ISoapFault *fault = (ISoapFault *)me.getFault();
  +				const char* pcCmplxFaultName = fault->getCmplxFaultObjectName().c_str();
  +				if(0 == strcmp("DivByZeroStruct", pcCmplxFaultName))
  +				{
  +					DivByZeroStruct* p = (DivByZeroStruct *)fault->getCmplxFaultObject();
  +					cout << "DivByZeroStruct Fault: \"" << p->varString << "\", " << p->varInt << ", " << p->varFloat << endl;
  +            	}
  +				else if(0 == strcmp("SpecialDetailStruct", pcCmplxFaultName))
  +				{
  +					SpecialDetailStruct* p = (SpecialDetailStruct *)fault->getCmplxFaultObject();
  +					cout << "SpecialDetailStruct Fault: \"" << p->varString << "\"" << endl;
  +				}
  +				else if(0 == strcmp("OutOfBoundStruct", pcCmplxFaultName))
  +				{
  +					OutOfBoundStruct* p = (OutOfBoundStruct *)fault->getCmplxFaultObject();
  +					cout << "OutOfBoundStruct Fault: \"" << p->varString << "\", " << p->varInt << ", \"" << p->specialDetail->varString << "\"" << endl;
  +				}
   			}
   			catch(AxisException& e)
   			{
  -				printf("AxisException : %s\n", e.what());
  +				printf("AxisException: %s\n", e.what());
   			}
   			catch(exception& e)
   			{
  -				printf("Unknown Exception : \n");
  +				printf("Unknown Exception: \n");
   			}
   			catch(...)
   			{
  -				printf("Unspecified Exception : \n");
  +				printf("Unspecified Exception: \n");
   			}
   	    }
   	}
  
  
  
  1.2       +8 -4      ws-axis/c/tests/auto_build/testcases/output/FaultMappingDoc.cpp.out
  
  Index: FaultMappingDoc.cpp.out
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/tests/auto_build/testcases/output/FaultMappingDoc.cpp.out,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- FaultMappingDoc.cpp.out	5 Oct 2004 15:50:42 -0000	1.1
  +++ FaultMappingDoc.cpp.out	14 Nov 2004 20:03:49 -0000	1.2
  @@ -1,8 +1,12 @@
   0
  -Result is:2
  +Trying to div 10 by 5
  +Result is 2
   1
  -
  +Trying to div 10 by 0
  +MathOpsService_AxisClientException: DivByZeroStruct Fault: "Division by zero exception", 1, 10.52
   2
  -
  +Trying to div 1000 by 5
  +MathOpsService_AxisClientException: SpecialDetailStruct Fault: "You have entered 1000 for the first parameter. 1000 is reserved. Please do not use it"
   3
  -
  +Trying to div 10 by -5
  +MathOpsService_AxisClientException: OutOfBoundStruct Fault: "Out of bounds exception", 2, "This bounds exception is a forced exception"