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 pr...@apache.org on 2006/02/22 11:39:56 UTC

svn commit: r379742 - in /webservices/axis/trunk/c/tests/auto_build/testcases: client/cpp/OtherFaultExceptionTest.cpp output/OtherFaultExceptionTest.cpp.out

Author: prestonf
Date: Wed Feb 22 02:39:49 2006
New Revision: 379742

URL: http://svn.apache.org/viewcvs?rev=379742&view=rev
Log:
The OtherFaultException test produced different outputs when run against different servers.  Sometimes the tags have namespaces and sometimes they don't.  The first attempt to standardise this was to change all namespaces to p717.  But, of course, when there where no namespaces, this still produced the incorrect result (because the expected output was different).  So, now I have removed all references to namespaces and changed the expected output file to match.

Modified:
    webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/OtherFaultExceptionTest.cpp
    webservices/axis/trunk/c/tests/auto_build/testcases/output/OtherFaultExceptionTest.cpp.out

Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/OtherFaultExceptionTest.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/OtherFaultExceptionTest.cpp?rev=379742&r1=379741&r2=379742&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/OtherFaultExceptionTest.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/OtherFaultExceptionTest.cpp Wed Feb 22 02:39:49 2006
@@ -125,16 +125,34 @@
 						int	iNSEnd = (int) (pNSEnd - pszDetail) - iNSStart;
 
 						string	sNamespace = ((string) pszDetail).substr( iNSStart, iNSEnd);
-						int		iNSPos = (int) sDetail.find( sNamespace);
 
-						while( iNSPos != std::string::npos)
+						if( sExpectedNS.compare( sNamespace))
 						{
-							sDetail.replace( iNSPos, sNamespace.length(), sExpectedNS);
+							int		iNSPos = (int) sDetail.find( sNamespace);
 
-							iNSPos = (int) sDetail.find( sNamespace);
+							while( iNSPos != std::string::npos)
+							{
+								sDetail.replace( iNSPos, sNamespace.length(), sExpectedNS);
+
+								iNSPos = (int) sDetail.find( sNamespace);
+							}
 						}
 					}
 
+// Because there is not always a namespace used (depends on server) I have now
+// had to remove any namespace from the Detail string.
+
+					sExpectedNS += ":";
+
+					int		iNSPos = (int) sDetail.find( sExpectedNS);
+
+					while( iNSPos != std::string::npos)
+					{
+						sDetail.replace( iNSPos, sExpectedNS.length(), "");
+
+						iNSPos = (int) sDetail.find( sExpectedNS);
+					}
+
 // This is the expected 'Fault code'.  But, the namespace is not necessarily 717 so the test fails...  Need to replace the given namespace with the expected one.
 // p717:DivByZeroStruct
 // p717:SpecialDetailStruct
@@ -146,6 +164,16 @@
 					if( iNSEnd > 0)
 					{
 						sCode.replace( 0, iNSEnd, sExpectedNS);
+					}
+
+// Because there is not always a namespace used (depends on server) I have now
+// had to remove any namespace from the Code string.
+
+					char * pEndOfNamespace = strchr( pszCode, ':');
+
+					if( pEndOfNamespace != NULL)
+					{
+						sCode = pEndOfNamespace + 1;
 					}
 
 					cout << "Fault Detail - "<< sDetail << endl;

Modified: webservices/axis/trunk/c/tests/auto_build/testcases/output/OtherFaultExceptionTest.cpp.out
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/output/OtherFaultExceptionTest.cpp.out?rev=379742&r1=379741&r2=379742&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/output/OtherFaultExceptionTest.cpp.out (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/output/OtherFaultExceptionTest.cpp.out Wed Feb 22 02:39:49 2006
@@ -1,20 +1,20 @@
 
 
 Trying to div 10 by 0
-Fault Detail - <p717:DivByZeroStruct><p717:varString>Division by zero exception</p717:varString><p717:varInt>1</p717:varInt><p717:varFloat>10.52</p717:varFloat></p717:DivByZeroStruct>
+Fault Detail - <DivByZeroStruct><varString>Division by zero exception</varString><varInt>1</varInt><varFloat>10.52</varFloat></DivByZeroStruct>
 Fault String - org.soapinterop.DivByZeroStruct
-Fault code   - p717:DivByZeroStruct
+Fault code   - DivByZeroStruct
 
 
 Trying to div 1000 by 5
-Fault Detail - <p717:SpecialDetailStruct><p717:varString>You have entered 1000 for the first parameter. 1000 is reserved. Please do not use it</p717:varString></p717:SpecialDetailStruct>
+Fault Detail - <SpecialDetailStruct><varString>You have entered 1000 for the first parameter. 1000 is reserved. Please do not use it</varString></SpecialDetailStruct>
 Fault String - org.soapinterop.SpecialDetailStruct
-Fault code   - p717:SpecialDetailStruct
+Fault code   - SpecialDetailStruct
 
 
 Trying to div 10 by -5
-Fault Detail - <p717:OutOfBoundStruct><p717:varString>Out of bounds exception</p717:varString><p717:varInt>2</p717:varInt><p717:specialDetail><p717:varString>This bounds exception is a forced exception</p717:varString></p717:specialDetail></p717:OutOfBoundStruct>
+Fault Detail - <OutOfBoundStruct><varString>Out of bounds exception</varString><varInt>2</varInt><specialDetail><varString>This bounds exception is a forced exception</varString></specialDetail></OutOfBoundStruct>
 Fault String - org.soapinterop.OutOfBoundStruct
-Fault code   - p717:OutOfBoundStruct
+Fault code   - OutOfBoundStruct
 ---------------------- TEST COMPLETE -----------------------------