Author: bjohnson
Date: Wed Nov  7 16:22:22 2007
New Revision: 592969

URL: http://svn.apache.org/viewvc?rev=592969&view=rev
Log:
Added wsdl processing changes to check for duplicate messages, portTypes, 
bindings, and services. Also added unit tests for this feature.

Added:
    
incubator/tuscany/cpp/sca/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_portTypes.wsdl
   (with props)
Modified:
    
incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/WSDLDefinition.cpp
    
incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/WSDLDefinition.h
    incubator/tuscany/cpp/sca/runtime/core/test/main.cpp
    incubator/tuscany/cpp/sca/runtime/core/test/wsdlTests/WSDLErrorsTest.cpp
    incubator/tuscany/cpp/sca/runtime/core/test/wsdlTests/WSDLErrorsTest.h

Modified: 
incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/WSDLDefinition.cpp
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/WSDLDefinition.cpp?rev=592969&r1=592968&r2=592969&view=diff
==============================================================================
--- 
incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/WSDLDefinition.cpp 
(original)
+++ 
incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/WSDLDefinition.cpp 
Wed Nov  7 16:22:22 2007
@@ -20,6 +20,7 @@
 /* $Rev$ $Date$ */
 
 #include <sstream>
+#include <set>
 
 #include "tuscany/sca/model/WSDLDefinition.h"
 #include "tuscany/sca/model/WSDLOperation.h"
@@ -314,6 +315,11 @@
             {
                 logentry(); 
 
+                // check for duplicate message/binding/PortType/Service
+                // with equal name attributes. This cant be enforced by
+                // the schema, so it has to be enforced at the app level
+                checkForDuplicates( wsdlModel );
+
                 DataObjectList& serviceList = wsdlModel->getList("service");
 
                 // Iterate through the WSDL services
@@ -326,9 +332,26 @@
                     for (unsigned int j=0; j < portList.size();j++)
                     {
                         string portName( portList[j]->getCString("name") );
-                        string 
targetAddress(portList[j]->getCString("address/location"));
                         string 
wsBindingName(portList[j]->getCString("binding"));
 
+                        // There can only be one soap address and the check 
must be made
+                        // at the application level since it cant be specified 
in the xsd
+/*
+                        DataObjectList& soapAddressList = 
portList[j]->getList("address");
+                        if( soapAddressList.size() != 1 )
+                        {
+                            // Invalid WSDL
+                            stringstream errMessage;
+                            errMessage
+                              << "service/port/address cannot be duplicated"
+                              << portName
+                              << " in the WSDL definition";
+                            throwException(SystemConfigurationException, 
errMessage.str().c_str());
+                        }
+*/
+
+                        string 
targetAddress(portList[j]->getCString("address/location"));
+
                         // get the binding specified in the WSDL service port
                         DataObjectPtr wsBinding = findBinding(wsBindingName);
                         if (!wsBinding)
@@ -514,6 +537,96 @@
                     } // end portTypeList
                 } // end serviceList
             } // end method mapOperations
+
+            void WSDLDefinition::checkForDuplicates( DataObjectPtr wsdlModel )
+            {
+                logentry(); 
+
+                // check for duplicate message/binding/PortType/service
+                // with equal name attributes. This cant be enforced by
+                // the schema, so it has to be enforced at the app level
+
+                std::set<string> namesSet;
+
+                DataObjectList &messageList = wsdlModel->getList("message");
+                for( unsigned int i = 0; i < messageList.size(); i++ )
+                {
+                  if( namesSet.find( messageList[i]->getCString("name") ) == 
namesSet.end() )
+                  {
+                    namesSet.insert( messageList[i]->getCString("name") );
+                  }
+                  else
+                  {
+                    // Invalid WSDL
+                    stringstream errMessage;
+                    errMessage
+                      << "message/name: "
+                      << messageList[i]->getCString("name")
+                      << " cannot be duplicated in the WSDL definition";
+                    throwException(SystemConfigurationException, 
errMessage.str().c_str());
+                  }
+                }
+
+                namesSet.clear();
+                DataObjectList &bindingList = wsdlModel->getList("binding");
+                for( unsigned int i = 0; i < bindingList.size(); i++ )
+                {
+                  if( namesSet.find( bindingList[i]->getCString("name") ) == 
namesSet.end() )
+                  {
+                    namesSet.insert( bindingList[i]->getCString("name") );
+                  }
+                  else
+                  {
+                    // Invalid WSDL
+                    stringstream errMessage;
+                    errMessage
+                      << "binding/name: "
+                      << bindingList[i]->getCString("name")
+                      << " cannot be duplicated in the WSDL definition";
+                    throwException(SystemConfigurationException, 
errMessage.str().c_str());
+                  }
+                }
+
+                namesSet.clear();
+                DataObjectList &portTypeList = wsdlModel->getList("portType");
+                for( unsigned int i = 0; i < portTypeList.size(); i++ )
+                {
+                  if( namesSet.find( portTypeList[i]->getCString("name") ) == 
namesSet.end() )
+                  {
+                    namesSet.insert( portTypeList[i]->getCString("name") );
+                  }
+                  else
+                  {
+                    // Invalid WSDL
+                    stringstream errMessage;
+                    errMessage
+                      << "portType/name: "
+                      << portTypeList[i]->getCString("name")
+                      << " cannot be duplicated in the WSDL definition";
+                    throwException(SystemConfigurationException, 
errMessage.str().c_str());
+                  }
+                }
+
+                namesSet.clear();
+                DataObjectList &serviceList = wsdlModel->getList("service");
+                for( unsigned int i = 0; i < serviceList.size(); i++ )
+                {
+                  if( namesSet.find( serviceList[i]->getCString("name") ) == 
namesSet.end() )
+                  {
+                    namesSet.insert( serviceList[i]->getCString("name") );
+                  }
+                  else
+                  {
+                    // Invalid WSDL
+                    stringstream errMessage;
+                    errMessage
+                      << "service/name: "
+                      << serviceList[i]->getCString("name")
+                      << " cannot be duplicated in the WSDL definition";
+                    throwException(SystemConfigurationException, 
errMessage.str().c_str());
+                  }
+                }
+            }
 
         } // end namespace model
     } // end namespace sca

Modified: 
incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/WSDLDefinition.h
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/WSDLDefinition.h?rev=592969&r1=592968&r2=592969&view=diff
==============================================================================
--- 
incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/WSDLDefinition.h 
(original)
+++ 
incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/WSDLDefinition.h 
Wed Nov  7 16:22:22 2007
@@ -151,6 +151,16 @@
                 void mapOperations( commonj::sdo::DataObjectPtr wsdlModel );
 
                 /**
+                 * Given a wsdl represented by an SDO, check for duplicate
+                 * message/binding/PortType/service with equal name attributes.
+                 * This cant be enforced by the schema, so it has to be 
enforced
+                 * at the app level. If a duplicate is found, a
+                 * SystemConfigurationException exception is thrown.
+                 * @param wsdlModel A wsdl represented by an SDO
+                 */
+                void checkForDuplicates( commonj::sdo::DataObjectPtr wsdlModel 
);
+
+                /**
                  * The data object representation of the WSDL document.
                  */
                 typedef std::vector<commonj::sdo::DataObjectPtr> MODEL_VECTOR;

Modified: incubator/tuscany/cpp/sca/runtime/core/test/main.cpp
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/test/main.cpp?rev=592969&r1=592968&r2=592969&view=diff
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/test/main.cpp (original)
+++ incubator/tuscany/cpp/sca/runtime/core/test/main.cpp Wed Nov  7 16:22:22 
2007
@@ -43,34 +43,36 @@
     try
     {
       WSDLDefinitionTest wsdlTest;
-      TEST ( wsdlTest.testSimple() );
+      TEST( wsdlTest.testSimple() );
 
       WSDLErrorsTest wsdlErrorsTest;
-//      TEST ( wsdlErrorsTest.testDuplicateWSDLInputOutputBinding() ); // 
fails, JIRA 1900 maxOccurs error
-//      TEST ( wsdlErrorsTest.testDuplicateWSDLMessagePartNames() );  // 
fails, JIRA 1900 maxOccurs error
-//      TEST ( wsdlErrorsTest.testDuplicateWSDLBindings() ); // fails, need to 
fix WSDLDefinition.cpp
-//      TEST ( wsdlErrorsTest.testDuplicateWSDLMessages() ); // fails, need to 
fix WSDLDefinition.cpp
-//      TEST ( wsdlErrorsTest.testDuplicateWSDLServices() ); // fails, need to 
fix WSDLDefinition.cpp
+//      TEST( wsdlErrorsTest.testDuplicateWSDLInputOutputBinding() ); // 
fails, JIRA 1900
+//      TEST( wsdlErrorsTest.testDuplicateWSDLMessagePartNames() );   // 
fails, JIRA 1900
 
-      // The following 4 fail due to an SDO SPEC limitation:
-      //   If xsd:any has maxOccurs > 1, and you use a global element 
-      //   for the any, you only have a single valued property
+      TEST( wsdlErrorsTest.testDuplicateWSDLBindings() );
+      TEST( wsdlErrorsTest.testDuplicateWSDLMessages() );
+      TEST( wsdlErrorsTest.testDuplicateWSDLServices() );
+      TEST( wsdlErrorsTest.testDuplicateWSDLPortTypes() );
+
+      // The following 4 tests fail due to an SDO SPEC limitation:
+      //   According to XSD rules, if a global element xsd:any has
+      //   maxOccurs > 1 you can only have a single valued property
       // The multiple SOAP addresses/bindings/bodies/operations should load
       // and I should be able to get the list and throw if list.size() > 1
       // but I cant because SDO says its a single value element
-//      TEST ( wsdlErrorsTest.testDuplicateSOAPAddress() );
-//      TEST ( wsdlErrorsTest.testDuplicateSOAPBinding() );
-//      TEST ( wsdlErrorsTest.testDuplicateSOAPBody() );
-//      TEST ( wsdlErrorsTest.testDuplicateSOAPOperation() );
+//      TEST( wsdlErrorsTest.testDuplicateSOAPAddress() );
+//      TEST( wsdlErrorsTest.testDuplicateSOAPBinding() );
+//      TEST( wsdlErrorsTest.testDuplicateSOAPBody() );
+//      TEST( wsdlErrorsTest.testDuplicateSOAPOperation() );
 
-      TEST ( wsdlErrorsTest.testMissingPortBinding() );
-      TEST ( wsdlErrorsTest.testMissingOperation() );
-      TEST ( wsdlErrorsTest.testMissingPortType() );
-      TEST ( wsdlErrorsTest.testMissingMessage() );
+      TEST( wsdlErrorsTest.testMissingPortBinding() );
+      TEST( wsdlErrorsTest.testMissingOperation() );
+      TEST( wsdlErrorsTest.testMissingPortType() );
+      TEST( wsdlErrorsTest.testMissingMessage() );
 
-//      TEST ( wsdlErrorsTest.testMissingMessagePartName() ); // fails, JIRA 
1901
-//      TEST ( wsdlErrorsTest.testMissingPortName() );        // fails, JIRA 
1901
-//      TEST ( wsdlErrorsTest.testMissingMessagePartType() ); // fails, JIRA 
1901
+//      TEST( wsdlErrorsTest.testMissingMessagePartName() ); // fails, JIRA 
1901
+//      TEST( wsdlErrorsTest.testMissingPortName() );        // fails, JIRA 
1901
+//      TEST( wsdlErrorsTest.testMissingMessagePartType() ); // fails, JIRA 
1901
     }
     catch(...)
     {

Modified: 
incubator/tuscany/cpp/sca/runtime/core/test/wsdlTests/WSDLErrorsTest.cpp
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/test/wsdlTests/WSDLErrorsTest.cpp?rev=592969&r1=592968&r2=592969&view=diff
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/test/wsdlTests/WSDLErrorsTest.cpp 
(original)
+++ incubator/tuscany/cpp/sca/runtime/core/test/wsdlTests/WSDLErrorsTest.cpp 
Wed Nov  7 16:22:22 2007
@@ -25,6 +25,8 @@
 {
   TEST_TRACE( "Testing erroneous wsdl: duplicate_binding_input.wsdl" );
 
+  // This test fails because of JIRA 1900
+
   try
   {
     tuscany::sca::model::WSDLDefinition *wsdl =
@@ -33,7 +35,7 @@
   }
   catch( const tuscany::sca::TuscanyRuntimeException &scaE )
   {
-    std::cout << "Caught SCA Exception: " << scaE.getMessageText() << 
std::endl;
+    TEST_FAIL( std::string( "Caught unexpected SCA Exception: " ) + 
scaE.getMessageText() );
   }
   catch( const commonj::sdo::SDORuntimeException &sdoE )
   {
@@ -54,7 +56,7 @@
   }
   catch( const tuscany::sca::TuscanyRuntimeException &scaE )
   {
-    std::cout << "Caught SCA Exception: " << scaE.getMessageText() << 
std::endl;
+    TEST_FAIL( std::string( "Caught unexpected SCA Exception: " ) + 
scaE.getMessageText() );
   }
   catch( const commonj::sdo::SDORuntimeException &sdoE )
   {
@@ -69,19 +71,21 @@
 }
 
 
-bool WSDLErrorsTest::testDuplicateWSDLBindings()
+bool WSDLErrorsTest::testDuplicateWSDLMessagePartNames()
 {
-  TEST_TRACE( "Testing erroneous wsdl: duplicate_bindings.wsdl" );
+  TEST_TRACE( "Testing erroneous wsdl: duplicate_partNames.wsdl" );
+
+  // This test fails because of JIRA 1900
 
   try
   {
     tuscany::sca::model::WSDLDefinition *wsdl =
-      loadWsdl( "wsdlTests/wsdls_erroneous/duplicate_bindings.wsdl" );
+      loadWsdl( "wsdlTests/wsdls_erroneous/duplicate_partNames.wsdl" );
     TEST_FAIL( "Wsdl should have thrown an exception" );
   }
   catch( const tuscany::sca::TuscanyRuntimeException &scaE )
   {
-    std::cout << "Caught SCA Exception: " << scaE.getMessageText() << 
std::endl;
+    TEST_FAIL( std::string( "Caught unexpected SCA Exception: " ) + 
scaE.getMessageText() );
   }
   catch( const commonj::sdo::SDORuntimeException &sdoE )
   {
@@ -107,7 +111,10 @@
   }
   catch( const tuscany::sca::TuscanyRuntimeException &scaE )
   {
-    std::cout << "Caught SCA Exception: " << scaE.getMessageText() << 
std::endl;
+    TEST_TRACE( std::string( "Caught expected SCA Exception: " ) + 
scaE.getMessageText() );
+    std::string errorText( scaE.getMessageText() );
+    TEST_ASSERT_NOT_EQUALS( errorText.find( "message/name" ), 
std::string::npos );
+    TEST_ASSERT_NOT_EQUALS( errorText.find( "cannot be duplicated" ), 
std::string::npos );
   }
   catch( const commonj::sdo::SDORuntimeException &sdoE )
   {
@@ -121,19 +128,51 @@
   return true;
 }
 
-bool WSDLErrorsTest::testDuplicateWSDLMessagePartNames()
+bool WSDLErrorsTest::testDuplicateWSDLPortTypes()
 {
-  TEST_TRACE( "Testing erroneous wsdl: duplicate_partNames.wsdl" );
+  TEST_TRACE( "Testing erroneous wsdl: duplicate_portTypes.wsdl" );
 
   try
   {
     tuscany::sca::model::WSDLDefinition *wsdl =
-      loadWsdl( "wsdlTests/wsdls_erroneous/duplicate_partNames.wsdl" );
+      loadWsdl( "wsdlTests/wsdls_erroneous/duplicate_portTypes.wsdl" );
     TEST_FAIL( "Wsdl should have thrown an exception" );
   }
   catch( const tuscany::sca::TuscanyRuntimeException &scaE )
   {
-    std::cout << "Caught SCA Exception: " << scaE.getMessageText() << 
std::endl;
+    TEST_TRACE( std::string( "Caught expected SCA Exception: " ) + 
scaE.getMessageText() );
+    std::string errorText( scaE.getMessageText() );
+    TEST_ASSERT_NOT_EQUALS( errorText.find( "portType/name" ), 
std::string::npos );
+    TEST_ASSERT_NOT_EQUALS( errorText.find( "cannot be duplicated" ), 
std::string::npos );
+  }
+  catch( const commonj::sdo::SDORuntimeException &sdoE )
+  {
+    TEST_FAIL( std::string( "Caught unexpected SDO Exception: " ) + 
sdoE.getMessageText() );
+  }
+  catch( ... )
+  {
+    TEST_FAIL( "Caught unexpected unknown Exception: " );
+  }
+
+  return true;
+}
+
+bool WSDLErrorsTest::testDuplicateWSDLBindings()
+{
+  TEST_TRACE( "Testing erroneous wsdl: duplicate_bindings.wsdl" );
+
+  try
+  {
+    tuscany::sca::model::WSDLDefinition *wsdl =
+      loadWsdl( "wsdlTests/wsdls_erroneous/duplicate_bindings.wsdl" );
+    TEST_FAIL( "Wsdl should have thrown an exception" );
+  }
+  catch( const tuscany::sca::TuscanyRuntimeException &scaE )
+  {
+    TEST_TRACE( std::string( "Caught expected SCA Exception: " ) + 
scaE.getMessageText() );
+    std::string errorText( scaE.getMessageText() );
+    TEST_ASSERT_NOT_EQUALS( errorText.find( "binding/name" ), 
std::string::npos );
+    TEST_ASSERT_NOT_EQUALS( errorText.find( "cannot be duplicated" ), 
std::string::npos );
   }
   catch( const commonj::sdo::SDORuntimeException &sdoE )
   {
@@ -159,7 +198,10 @@
   }
   catch( const tuscany::sca::TuscanyRuntimeException &scaE )
   {
-    std::cout << "Caught SCA Exception: " << scaE.getMessageText() << 
std::endl;
+    TEST_TRACE( std::string( "Caught expected SCA Exception: " ) + 
scaE.getMessageText() );
+    std::string errorText( scaE.getMessageText() );
+    TEST_ASSERT_NOT_EQUALS( errorText.find( "service/name" ), 
std::string::npos );
+    TEST_ASSERT_NOT_EQUALS( errorText.find( "cannot be duplicated" ), 
std::string::npos );
   }
   catch( const commonj::sdo::SDORuntimeException &sdoE )
   {
@@ -177,6 +219,13 @@
 {
   TEST_TRACE( "Testing erroneous wsdl: duplicate_soap_address.wsdl" );
 
+  // This test fails due to an SDO SPEC limitation:
+  //   According to XSD rules, if a global element xsd:any has
+  //   maxOccurs > 1 you can only have a single valued property
+  // The multiple SOAP addresses/bindings/bodies/operations should load
+  // and I should be able to get the list and throw if list.size() > 1
+  // but I cant because SDO says its a single value element
+
   try
   {
     tuscany::sca::model::WSDLDefinition *wsdl =
@@ -185,7 +234,7 @@
   }
   catch( const tuscany::sca::TuscanyRuntimeException &scaE )
   {
-    std::cout << "Caught SCA Exception: " << scaE.getMessageText() << 
std::endl;
+    TEST_FAIL( std::string( "Caught unexpected SCA Exception: " ) + 
scaE.getMessageText() );
   }
   catch( const commonj::sdo::SDORuntimeException &sdoE )
   {
@@ -203,6 +252,13 @@
 {
   TEST_TRACE( "Testing erroneous wsdl: duplicate_soap_binding.wsdl" );
 
+  // This test fails due to an SDO SPEC limitation:
+  //   According to XSD rules, if a global element xsd:any has
+  //   maxOccurs > 1 you can only have a single valued property
+  // The multiple SOAP addresses/bindings/bodies/operations should load
+  // and I should be able to get the list and throw if list.size() > 1
+  // but I cant because SDO says its a single value element
+
   try
   {
     tuscany::sca::model::WSDLDefinition *wsdl =
@@ -211,7 +267,7 @@
   }
   catch( const tuscany::sca::TuscanyRuntimeException &scaE )
   {
-    std::cout << "Caught SCA Exception: " << scaE.getMessageText() << 
std::endl;
+    TEST_FAIL( std::string( "Caught unexpected SCA Exception: " ) + 
scaE.getMessageText() );
   }
   catch( const commonj::sdo::SDORuntimeException &sdoE )
   {
@@ -229,6 +285,13 @@
 {
   TEST_TRACE( "Testing erroneous wsdl: duplicate_soap_body.wsdl" );
 
+  // This test fails due to an SDO SPEC limitation:
+  //   According to XSD rules, if a global element xsd:any has
+  //   maxOccurs > 1 you can only have a single valued property
+  // The multiple SOAP addresses/bindings/bodies/operations should load
+  // and I should be able to get the list and throw if list.size() > 1
+  // but I cant because SDO says its a single value element
+
   try
   {
     tuscany::sca::model::WSDLDefinition *wsdl =
@@ -237,7 +300,7 @@
   }
   catch( const tuscany::sca::TuscanyRuntimeException &scaE )
   {
-    std::cout << "Caught SCA Exception: " << scaE.getMessageText() << 
std::endl;
+    TEST_FAIL( std::string( "Caught unexpected SCA Exception: " ) + 
scaE.getMessageText() );
   }
   catch( const commonj::sdo::SDORuntimeException &sdoE )
   {
@@ -255,6 +318,13 @@
 {
   TEST_TRACE( "Testing erroneous wsdl: duplicate_soap_operation.wsdl" );
 
+  // This test fails due to an SDO SPEC limitation:
+  //   According to XSD rules, if a global element xsd:any has
+  //   maxOccurs > 1 you can only have a single valued property
+  // The multiple SOAP addresses/bindings/bodies/operations should load
+  // and I should be able to get the list and throw if list.size() > 1
+  // but I cant because SDO says its a single value element
+
   try
   {
     tuscany::sca::model::WSDLDefinition *wsdl =
@@ -263,7 +333,7 @@
   }
   catch( const tuscany::sca::TuscanyRuntimeException &scaE )
   {
-    std::cout << "Caught SCA Exception: " << scaE.getMessageText() << 
std::endl;
+    TEST_FAIL( std::string( "Caught unexpected SCA Exception: " ) + 
scaE.getMessageText() );
   }
   catch( const commonj::sdo::SDORuntimeException &sdoE )
   {
@@ -393,6 +463,8 @@
 {
   TEST_TRACE( "Testing erroneous wsdl: missing_name_for_part.wsdl" );
 
+  // This test fails because of JIRA 1901
+
   try
   {
     tuscany::sca::model::WSDLDefinition *wsdl =
@@ -401,7 +473,7 @@
   }
   catch( const tuscany::sca::TuscanyRuntimeException &scaE )
   {
-    std::cout << "Caught SCA Exception: " << scaE.getMessageText() << 
std::endl;
+    TEST_FAIL( std::string( "Caught unexpected SCA Exception: " ) + 
scaE.getMessageText() );
   }
   catch( const commonj::sdo::SDORuntimeException &sdoE )
   {
@@ -419,6 +491,8 @@
 {
   TEST_TRACE( "Testing erroneous wsdl: missing_name_for_port.wsdl" );
 
+  // This test fails because of JIRA 1901
+
   try
   {
     tuscany::sca::model::WSDLDefinition *wsdl =
@@ -427,7 +501,7 @@
   }
   catch( const tuscany::sca::TuscanyRuntimeException &scaE )
   {
-    std::cout << "Caught SCA Exception: " << scaE.getMessageText() << 
std::endl;
+    TEST_FAIL( std::string( "Caught unexpected SCA Exception: " ) + 
scaE.getMessageText() );
   }
   catch( const commonj::sdo::SDORuntimeException &sdoE )
   {
@@ -445,6 +519,8 @@
 {
   TEST_TRACE( "Testing erroneous wsdl: missing_type_for_part.wsdl" );
 
+  // This test fails because of JIRA 1901
+
   try
   {
     tuscany::sca::model::WSDLDefinition *wsdl =
@@ -453,7 +529,7 @@
   }
   catch( const tuscany::sca::TuscanyRuntimeException &scaE )
   {
-    std::cout << "Caught SCA Exception: " << scaE.getMessageText() << 
std::endl;
+    TEST_FAIL( std::string( "Caught unexpected SCA Exception: " ) + 
scaE.getMessageText() );
   }
   catch( const commonj::sdo::SDORuntimeException &sdoE )
   {

Modified: incubator/tuscany/cpp/sca/runtime/core/test/wsdlTests/WSDLErrorsTest.h
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/test/wsdlTests/WSDLErrorsTest.h?rev=592969&r1=592968&r2=592969&view=diff
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/test/wsdlTests/WSDLErrorsTest.h 
(original)
+++ incubator/tuscany/cpp/sca/runtime/core/test/wsdlTests/WSDLErrorsTest.h Wed 
Nov  7 16:22:22 2007
@@ -11,9 +11,10 @@
     ~WSDLErrorsTest();
 
     bool testDuplicateWSDLInputOutputBinding();
-    bool testDuplicateWSDLBindings();
-    bool testDuplicateWSDLMessages();
     bool testDuplicateWSDLMessagePartNames();
+    bool testDuplicateWSDLMessages();
+    bool testDuplicateWSDLPortTypes();
+    bool testDuplicateWSDLBindings();
     bool testDuplicateWSDLServices();
     bool testDuplicateSOAPAddress();
     bool testDuplicateSOAPBinding();

Added: 
incubator/tuscany/cpp/sca/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_portTypes.wsdl
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_portTypes.wsdl?rev=592969&view=auto
==============================================================================
--- 
incubator/tuscany/cpp/sca/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_portTypes.wsdl
 (added)
+++ 
incubator/tuscany/cpp/sca/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_portTypes.wsdl
 Wed Nov  7 16:22:22 2007
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+   
+     http://www.apache.org/licenses/LICENSE-2.0
+     
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.
+-->
+
+<definitions
+    xmlns="http://schemas.xmlsoap.org/wsdl/";
+    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";
+    xmlns:tns="http://www.tuscany.com/tests/duplicate_services.wsdl";
+    xmlns:xsd="http://www.w3.org/2001/XMLSchema";
+    targetNamespace="http://www.tuscany.com/tests/duplicate_services.wsdl";
+    name="duplicate_services">
+
+  <message name="request">
+    <part name="zipcode" type="xsd:string"/>
+  </message>
+  <message name="response">
+    <part name="host" type="xsd:string"/>
+    <part name="port" type="xsd:string"/>
+  </message>
+
+  <portType name="portType">
+    <!-- Request/response -->
+    <operation name="test">
+      <input message="tns:request"/>
+      <output message="tns:response"/>
+    </operation>
+  </portType>
+
+  <portType name="portType">
+    <!-- Request/response -->
+    <operation name="test">
+      <input message="tns:request"/>
+      <output message="tns:response"/>
+    </operation>
+  </portType>
+
+  <binding name="binding" type="tns:portType">
+    <soap:binding style="document" 
transport="http://schemas.xmlsoap.org/soap/http"/>
+    <operation name="test">
+      <soap:operation 
soapAction="http://www.tuscany.com/test/duplicate_services"/>
+      <input>
+        <soap:body use="literal"/>
+      </input>
+      <output>
+        <soap:body use="literal"/>
+      </output>
+    </operation>
+  </binding>
+
+  <service name="service">
+    <port name="port" binding="tns:binding">
+      <soap:address location="http://localhost/sca/tests"/>
+    </port>
+  </service>
+
+</definitions>

Propchange: 
incubator/tuscany/cpp/sca/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_portTypes.wsdl
------------------------------------------------------------------------------
    svn:executable = *



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to