You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by sl...@apache.org on 2009/10/21 15:12:16 UTC

svn commit: r828004 - in /tuscany/java/sca/otest/newlayout/tuscany-test-runner/src/test: resources/tuscany-oasis-sca-tests-errors.properties tjava/org/apache/tuscany/sca/otest/TuscanyRuntimeBridge.java

Author: slaws
Date: Wed Oct 21 13:12:16 2009
New Revision: 828004

URL: http://svn.apache.org/viewvc?rev=828004&view=rev
Log:
Add in the ability to include the string "***" in an expected message to indicate that some text at the marked point should not be compared.

Modified:
    tuscany/java/sca/otest/newlayout/tuscany-test-runner/src/test/resources/tuscany-oasis-sca-tests-errors.properties
    tuscany/java/sca/otest/newlayout/tuscany-test-runner/src/test/tjava/org/apache/tuscany/sca/otest/TuscanyRuntimeBridge.java

Modified: tuscany/java/sca/otest/newlayout/tuscany-test-runner/src/test/resources/tuscany-oasis-sca-tests-errors.properties
URL: http://svn.apache.org/viewvc/tuscany/java/sca/otest/newlayout/tuscany-test-runner/src/test/resources/tuscany-oasis-sca-tests-errors.properties?rev=828004&r1=828003&r2=828004&view=diff
==============================================================================
--- tuscany/java/sca/otest/newlayout/tuscany-test-runner/src/test/resources/tuscany-oasis-sca-tests-errors.properties (original)
+++ tuscany/java/sca/otest/newlayout/tuscany-test-runner/src/test/resources/tuscany-oasis-sca-tests-errors.properties Wed Oct 21 13:12:16 2009
@@ -70,8 +70,8 @@
 ASM_8018=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200903}, Component: TestClient] - Component service interface incompatible with implementation service interface: Component = TestClient Service = TestInvocation
 ASM_8019=org.oasisopen.sca.ServiceRuntimeException: [Contribution: ASM_8019, Artifact: Test_ASM_8019.composite] - The interface.wsdl interface {http://test.sca.oasisopen.org/}Service1 element can only have a remotable attribute with the value "true" as WSDL interface are assumed to be remotable by default. The value that was found is: false.
 ASM_9002=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200903}, Component: TestComponent1] - Multiple bindings with the same name for a service: Service = Service1 Binding name = Fred
-ASM_10001=org.oasisopen.sca.ServiceRuntimeException: [Contribution: General, Definitions: jar:file:/C:/Tuscany/2.x-daily/otest/newlayout/tuscany-test-runner/../sca-assembly/General/target/General.zip!/META-INF/definitions.xml] - Duplicate intent {http://docs.oasis-open.org/ns/opencsa/scatests/200903}Fred found in domain
-ASM_10003=org.oasisopen.sca.ServiceRuntimeException: [Contribution: ASM_10003, Artifact: META-INF/definitions.xml, Definitions: jar:file:/C:/Tuscany/2.x-daily/otest/newlayout/tuscany-test-runner/../sca-assembly/ASM_10003/target/ASM_10003.zip!/META-INF/definitions.xml] - XMLSchema validation error occured in: null ,line = 17, column = 2, Message = cvc-complex-type.2.4.a: Invalid content was found starting with element 'component'. One of '{"http://docs.oasis-open.org/ns/opencsa/sca/200903":documentation, "http://docs.oasis-open.org/ns/opencsa/sca/200903":intent, "http://docs.oasis-open.org/ns/opencsa/sca/200903":policySet, "http://docs.oasis-open.org/ns/opencsa/sca/200903":binding, "http://docs.oasis-open.org/ns/opencsa/sca/200903":bindingType, "http://docs.oasis-open.org/ns/opencsa/sca/200903":implementationType, WC[##other:"http://docs.oasis-open.org/ns/opencsa/sca/200903"]}' is expected.
+ASM_10001=org.oasisopen.sca.ServiceRuntimeException: [Contribution: General, Definitions: jar:file:***/General/target/General.zip!/META-INF/definitions.xml] - Duplicate intent {http://docs.oasis-open.org/ns/opencsa/scatests/200903}Fred found in domain
+ASM_10003=org.oasisopen.sca.ServiceRuntimeException: [Contribution: ASM_10003, Artifact: META-INF/definitions.xml, Definitions: jar:file:***ASM_10003.zip!/META-INF/definitions.xml] - XMLSchema validation error occured in: Test_ASM_10003.composite ,line = 17, column = 2, Message = cvc-complex-type.2.4.a: Invalid content was found starting with element 'component'. One of '{"http://docs.oasis-open.org/ns/opencsa/sca/200903":documentation, "http://docs.oasis-open.org/ns/opencsa/sca/200903":intent, "http://docs.oasis-open.org/ns/opencsa/sca/200903":policySet, "http://docs.oasis-open.org/ns/opencsa/sca/200903":binding, "http://docs.oasis-open.org/ns/opencsa/sca/200903":bindingType, "http://docs.oasis-open.org/ns/opencsa/sca/200903":implementationType, WC[##other:"http://docs.oasis-open.org/ns/opencsa/sca/200903"]}' is expected.
 ASM_12007=TODO
 ASM_12008=TODO
 ASM_12011=TODO

Modified: tuscany/java/sca/otest/newlayout/tuscany-test-runner/src/test/tjava/org/apache/tuscany/sca/otest/TuscanyRuntimeBridge.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/otest/newlayout/tuscany-test-runner/src/test/tjava/org/apache/tuscany/sca/otest/TuscanyRuntimeBridge.java?rev=828004&r1=828003&r2=828004&view=diff
==============================================================================
--- tuscany/java/sca/otest/newlayout/tuscany-test-runner/src/test/tjava/org/apache/tuscany/sca/otest/TuscanyRuntimeBridge.java (original)
+++ tuscany/java/sca/otest/newlayout/tuscany-test-runner/src/test/tjava/org/apache/tuscany/sca/otest/TuscanyRuntimeBridge.java Wed Oct 21 13:12:16 2009
@@ -26,6 +26,7 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.util.Properties;
+import java.util.StringTokenizer;
 
 import org.apache.tuscany.sca.node.Contribution;
 import org.apache.tuscany.sca.node.ContributionLocationHelper;
@@ -161,6 +162,25 @@
             return;
         }
         
+        // Deal with the case where the message has variable parts within it
+        // marked with the characters ***. Here we tokenize the epected string 
+        // and make sure all the individual parts are present in the results string
+        String expectedMessageParts[] = expectedMessage.split("\\*\\*\\*");
+        
+        if (expectedMessageParts.length > 1){
+            int foundParts = 0;
+            for(int i = 0; i < expectedMessageParts.length; i++){
+                if (receivedMessage.indexOf(expectedMessageParts[i]) > -1 ){
+                    foundParts++;
+                }
+            }
+            
+            if (foundParts == expectedMessageParts.length){
+                return;
+            }
+        }
+
+        
         // Deal with the case where the end of the message is variable (eg contains absolute filenames) 
         // and where the only relevant part is the start of the message - in this case the expected
         // message only contains the stem section which is unchanging...