Author: antelder
Date: Wed Jul 28 11:07:50 2010
New Revision: 980019

URL: http://svn.apache.org/viewvc?rev=980019&view=rev
Log:
Update policy compliance tests in trunk to match the latest oasis code

Modified:
    tuscany/sca-java-2.x/trunk/compliance-tests/policy/pom.xml
    
tuscany/sca-java-2.x/trunk/compliance-tests/policy/src/test/java/org/apache/tuscany/sca/otest/TuscanyRuntimeBridge.java
    
tuscany/sca-java-2.x/trunk/compliance-tests/policy/src/test/resources/tuscany-oasis-sca-tests-errors.properties

Modified: tuscany/sca-java-2.x/trunk/compliance-tests/policy/pom.xml
URL: 
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/compliance-tests/policy/pom.xml?rev=980019&r1=980018&r2=980019&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/compliance-tests/policy/pom.xml (original)
+++ tuscany/sca-java-2.x/trunk/compliance-tests/policy/pom.xml Wed Jul 28 
11:07:50 2010
@@ -78,24 +78,13 @@
          <artifactId>maven-surefire-plugin</artifactId>
          <configuration>
            <excludes>
-              <exclude>**/POL_3001_TestCase.java</exclude><!--  see 
TUSCANY-3370 -->
-              <exclude>**/POL_3002_TestCase.java</exclude><!--  see 
TUSCANY-3370 -->
-              <exclude>**/POL_3012_TestCase.java</exclude>
-              <exclude>**/POL_3020_TestCase.java</exclude>
-              <exclude>**/POL_4003_TestCase.java</exclude><!--  see 
TUSCANY-3488 -->
-              <exclude>**/POL_4028_TestCase.java</exclude><!--  see 
TUSCANY-xxxx - Passes in otest module -->
-              <!-- transaction intents -->
-              <exclude>**/POL_9006_TestCase.java</exclude><!--  see 
TUSCANY-3487-->
-              <exclude>**/POL_9009_TestCase.java</exclude><!--  see 
TUSCANY-3487-->
-              <exclude>**/POL_9015_TestCase.java</exclude><!--  see 
TUSCANY-3487-->
-              <exclude>**/POL_9016_TestCase.java</exclude><!--  see 
TUSCANY-3487-->
-              <exclude>**/POL_9017_TestCase.java</exclude><!--  see 
TUSCANY-3487-->
-              <exclude>**/POL_9018_TestCase.java</exclude><!--  see 
TUSCANY-3487-->
-              <!-- noListener intents -->
-              <exclude>**/POL_10001_TestCase.java</exclude><!--  see 
TUSCANY-3491-->
-              <exclude>**/POL_10002_TestCase.java</exclude><!--  see 
TUSCANY-3491-->
-
-              <exclude>**/POL_11001_TestCase.java</exclude><!--  see 
TUSCANY-xxxx -->
+              <!-- 3002 is no longer part of the suite and 4015/4016 are tests 
for no optional support -->
+              <exclude>**/POL_3002_TestCase.java</exclude>
+              <exclude>**/POL_4015_TestCase.java</exclude>
+              <exclude>**/POL_4016_TestCase.java</exclude>
+              
+              <!-- 3001 fails due to a Tuscany bug in the RI based WS binding 
-->
+              <exclude>**/POL_3001_TestCase.java</exclude>
            </excludes>
          </configuration>
       </plugin>

Modified: 
tuscany/sca-java-2.x/trunk/compliance-tests/policy/src/test/java/org/apache/tuscany/sca/otest/TuscanyRuntimeBridge.java
URL: 
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/compliance-tests/policy/src/test/java/org/apache/tuscany/sca/otest/TuscanyRuntimeBridge.java?rev=980019&r1=980018&r2=980019&view=diff
==============================================================================
--- 
tuscany/sca-java-2.x/trunk/compliance-tests/policy/src/test/java/org/apache/tuscany/sca/otest/TuscanyRuntimeBridge.java
 (original)
+++ 
tuscany/sca-java-2.x/trunk/compliance-tests/policy/src/test/java/org/apache/tuscany/sca/otest/TuscanyRuntimeBridge.java
 Wed Jul 28 11:07:50 2010
@@ -29,12 +29,11 @@ import java.io.InputStream;
 import java.util.Properties;
 
 import org.apache.tuscany.sca.node.Contribution;
-import org.apache.tuscany.sca.node.ContributionLocationHelper;
 import org.apache.tuscany.sca.node.Node;
 import org.apache.tuscany.sca.node.NodeFactory;
 
+import testClient.TestException_Exception;
 import client.RuntimeBridge;
-import client.TestConfiguration;
 
 /**
  * An implementation of the Runtime Bridge for the Apache Tuscany SCA runtime 
(version 2.x)
@@ -47,8 +46,6 @@ public class TuscanyRuntimeBridge implem
     protected NodeFactory launcher;
     protected Node node;
     protected Properties expectedErrorMessages;
-    
-    TestConfiguration testConfiguration = null;
 
     public TuscanyRuntimeBridge() {
         // read test error mapping
@@ -61,22 +58,7 @@ public class TuscanyRuntimeBridge implem
         } 
     }
 
-    public TestConfiguration getTestConfiguration() {
-        return testConfiguration;
-    }
-
-    public void setTestConfiguration(TestConfiguration testConfiguration) {
-        this.testConfiguration = testConfiguration;
-    }
-
-       public boolean startContribution(String compositeName,
-                       String contributionLocation, String[] contributionNames)
-                       throws Exception {
-               //TODO:
-               return startContribution(contributionLocation, 
contributionNames);
-       }
-       
-    public boolean startContribution(String contributionLocation, String[] 
contributionNames) throws Exception {
+    public boolean startContribution(String compositeName, String 
contributionLocation, String[] contributionNames) throws Exception {
         try {
             // Tuscany specific code which starts the contribution(s) holding 
the test
             Properties ps = new Properties();
@@ -85,12 +67,12 @@ public class TuscanyRuntimeBridge implem
             launcher = NodeFactory.newInstance(ps);
 
             Contribution[] contributions = new 
Contribution[contributionNames.length];
-            String[] contributionURIs = 
getContributionURIs(contributionLocation);
+            String[] contributionURIs = 
getContributionURIs(contributionLocation, contributionNames);
             for (int i = 0; i < contributions.length; i++) {
                 contributions[i] = new Contribution(contributionNames[i], 
contributionURIs[i]);
             } // end for
 
-            node = launcher.createNode(testConfiguration.getComposite(), 
contributions);
+            node = launcher.createNode(compositeName, contributions);
             // Start the node
             node.start();
             
@@ -113,21 +95,18 @@ public class TuscanyRuntimeBridge implem
      * the contribution
      * @return the contribution locations as an array of Strings
      */
-    protected String[] getContributionURIs(String contributionLocation) throws 
Exception {
-        String[] locations;
-        locations = testConfiguration.getContributionNames();
+    protected String[] getContributionURIs(String contributionLocation, 
String[] contributionNames) throws Exception {
+        String[] locations = new String[contributionNames.length];
 
         if (locations != null && contributionLocation != null) {
 
             for (int i = 0; i < locations.length; i++) {
-                String aLocation = contributionLocation.replaceAll("%1", 
locations[i]);
-                // Looks like bugs in the oasis code that sometimes still uses 
jars for some
-                if (aLocation.endsWith("_POJO.zip") && 
!aLocation.endsWith("ASM_8005_Java-1.0.zip")) {
-                    aLocation = aLocation.substring(0, aLocation.length()-3) + 
"jar";                  
-                }
+                String aLocation = contributionLocation.replaceAll("%1", 
contributionNames[i]);
+
                 if (!(new File(aLocation)).exists()) {
-                       aLocation = aLocation.replace(".zip", ".jar");
+                    aLocation = aLocation.replace(".zip", ".jar");
                 }
+
                 locations[i] = aLocation;
             } // end for               
         } else {
@@ -151,15 +130,11 @@ public class TuscanyRuntimeBridge implem
             launcher.destroy();
         } // end if
     } // end method stopContribution
-
-    public String getContributionLocation(Class<?> testClass) {
-        return 
ContributionLocationHelper.getContributionLocation(testConfiguration.getTestClass());
-    } // end method getContributionLocation
     
     public void checkError(String testName, Throwable ex) throws Throwable { 
               
         String expectedMessage = expectedErrorMessages.getProperty(testName);
-        String receivedMessage = ex.getMessage();
+        String receivedMessage = getErrorMessage(ex);//ex.getMessage();
         
         if (expectedMessage == null){
             writeMissingMessage(testName, ex);
@@ -178,7 +153,7 @@ public class TuscanyRuntimeBridge implem
         }
         
         // Deal with the case where the message has variable parts within it
-        // marked with the characters ***. Here we tokenize the epected string 
+        // marked with the characters ***. Here we tokenize the expected 
string 
         // and make sure all the individual parts are present in the results 
string
         String expectedMessageParts[] = expectedMessage.split("\\*\\*\\*");
         
@@ -234,5 +209,18 @@ public class TuscanyRuntimeBridge implem
         } catch (IOException e) {
         } 
     }
+    
+    protected String getErrorMessage(Throwable ex) {
+        String errorMessage = null;
+        
+        if (ex instanceof TestException_Exception) {
+            TestException_Exception te = (TestException_Exception) ex;
+            errorMessage = te.getFaultInfo().getMessage();
+        } else {
+            errorMessage = ex.getMessage();
+        }
+        
+        return errorMessage;
+    }
 
 } // end class TuscanyRuntimeBridge

Modified: 
tuscany/sca-java-2.x/trunk/compliance-tests/policy/src/test/resources/tuscany-oasis-sca-tests-errors.properties
URL: 
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/compliance-tests/policy/src/test/resources/tuscany-oasis-sca-tests-errors.properties?rev=980019&r1=980018&r2=980019&view=diff
==============================================================================
--- 
tuscany/sca-java-2.x/trunk/compliance-tests/policy/src/test/resources/tuscany-oasis-sca-tests-errors.properties
 (original)
+++ 
tuscany/sca-java-2.x/trunk/compliance-tests/policy/src/test/resources/tuscany-oasis-sca-tests-errors.properties
 Wed Jul 28 11:07:50 2010
@@ -15,7 +15,7 @@
 # specific language governing permissions and limitations
 # under the License. 
 
-POL_3001=TUSCANY-3370
+POL_3001=Test service got an exception during execution: 
org.oasisopen.sca.ServiceRuntimeException WSDL document is using SOAP v1.2 but 
SOAP v1.1 is required by the specified policy intents
 POL_3002=TUSCANY-3370
 POL_3003=org.oasisopen.sca.ServiceRuntimeException: [Contribution: POL_3003, 
Artifact: META-INF/definitions.xml, Definitions: 
jar:file:***/POL_3003.zip!/META-INF/definitions.xml] - [ASM10001,POL30002] 
Duplicate intent 
{http://docs.oasis-open.org/ns/opencsa/scatests/200903}dupIntent found in domain
 POL_3004=org.oasisopen.sca.ServiceRuntimeException: [Contribution: POL_3004, 
Artifact: META-INF/definitions.xml, Definitions: 
jar:file:***/POL_3004.zip!/META-INF/definitions.xml] - [POL30004] Intent 
twoDefaults has more than one qualifier marked as the default qualifier
@@ -30,15 +30,28 @@ POL_3016=org.apache.tuscany.sca.contribu
 POL_3017=org.oasisopen.sca.ServiceRuntimeException: [Contribution: 
http://tuscany.apache.org/SystemContribution] - [POL30020] The policy set 
{http://docs.oasis-open.org/ns/opencsa/scatests/200903}BadIntentMapPolicySet 
intent map testIntent6 has missing qualifiers: testIntent6.qual2  The intent 
map qualifiers must match the provided intent qualifiers.
 POL_3018=org.oasisopen.sca.ServiceRuntimeException: [Contribution: POL_3018, 
Artifact: META-INF/definitions.xml, Definitions: 
jar:file:***/POL_3018.zip!/META-INF/definitions.xml] - [POL30021] Intent Map 
provides for Intent not specified as provided by parent PolicySet - 
BadIntentMapPolicySet
 POL_3020=TUSCANY-3371
-POL_4012=org.oasisopen.sca.ServiceRuntimeException: [Composite: 
{http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestClient, 
Service: TestInvocation] - [POL40009,ASM60009,ASM60010,JCA70001,JCA70003] 
Intent {http://docs.oasis-open.org/ns/opencsa/scatests/200903}testIntent3 and 
{http://docs.oasis-open.org/ns/opencsa/scatests/200903}testIntent4 are mutually 
exclusive
-POL_4027=org.oasisopen.sca.ServiceRuntimeException: [Contribution: POL_4027, 
Artifact: META-INF/definitions.xml, Definitions: 
jar:file:***/POL_4027.zip!/META-INF/definitions.xml] - [POL40020] Duplicate 
binding type {http://docs.oasis-open.org/ns/opencsa/sca/200912}dupBinding.type 
found in domain
+POL_4001=org.oasisopen.sca.ServiceRuntimeException: [Composite: 
{http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestClient, 
Service: TestInvocation] - The intent 
{http://docs.oasis-open.org/ns/opencsa/scatests/200903}testIntentExt2 
associated with policy subject ***Endpoint:  URI = 
TestClient#service-binding(TestInvocation/TestInvocation) has no matching 
policy set
+POL_4004=org.oasisopen.sca.ServiceRuntimeException: [Composite: 
{http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: 
TEST_POL_4004Component1, Composite: 
{http://docs.oasis-open.org/ns/opencsa/scatests/200903}TestCompositeImplIntent, 
Component: TestComposite0Component1, Composite: 
{http://docs.oasis-open.org/ns/opencsa/scatests/200903}TestComposite0, 
Component: TestComposite0Component1] - The intent 
{http://docs.oasis-open.org/ns/opencsa/scatests/200903}testImplIntent.qual2 
associated with policy subject 
{http://docs.oasis-open.org/ns/opencsa/sca/200912}implementation.java 
(class=org.oasisopen.sca.test.service1Impl) has no matching policy set
+POL_4005=org.oasisopen.sca.ServiceRuntimeException: [Composite: 
{http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: 
TEST_POL_4005Component1, Service: Service1] - The intent 
{http://docs.oasis-open.org/ns/opencsa/scatests/200903}testImplIntent.qual2 
associated with policy subject ***Endpoint:  URI = 
TEST_POL_4005Component1#service-binding(Service1/Service1) has no matching 
policy set
+POL_4006=org.oasisopen.sca.ServiceRuntimeException: [Composite: 
{http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestClient, 
Service: TestInvocation] - The intent 
{http://docs.oasis-open.org/ns/opencsa/scatests/200903}HighIntent associated 
with policy subject ***Endpoint:  URI = 
TestClient#service-binding(TestInvocation/TestInvocation) has no matching 
policy set
+POL_4009=org.oasisopen.sca.ServiceRuntimeException: [Composite: 
{http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: 
TEST_POL_4009Component1, Composite: 
{http://docs.oasis-open.org/ns/opencsa/scatests/200903}TestCompositeImplPolicySet,
 Component: TestComposite0Component1, Composite: 
{http://docs.oasis-open.org/ns/opencsa/scatests/200903}TestComposite0, 
Component: TestComposite0Component1] - The intent 
{http://docs.oasis-open.org/ns/opencsa/scatests/200903}testImplIntent2 
associated with policy subject 
{http://docs.oasis-open.org/ns/opencsa/sca/200912}implementation.java 
(class=org.oasisopen.sca.test.service1Impl) has no matching policy set
+POL_4010=org.oasisopen.sca.ServiceRuntimeException: [Composite: 
{http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestClient, 
Service: TestInvocation] - The intent 
{http://docs.oasis-open.org/ns/opencsa/scatests/200903}DirectIntent associated 
with policy subject ***Endpoint:  URI = 
TestClient#service-binding(TestInvocation/TestInvocation) has no matching 
policy set
+POL_4012=org.oasisopen.sca.ServiceRuntimeException: [Composite: 
{http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestClient, 
Service: TestInvocation] - [POL40009,ASM60009,ASM60010,JCA70001,JCA70003] 
Intent {http://docs.oasis-open.org/ns/opencsa/scatests/200903}testIntent*** and 
{http://docs.oasis-open.org/ns/opencsa/scatests/200903}testIntent*** are 
mutually exclusive
+POL_4018=org.oasisopen.sca.ServiceRuntimeException: [Composite: 
{http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestClient, 
Service: TestInvocation] - The intent 
{http://docs.oasis-open.org/ns/opencsa/scatests/200903}DirectIntent associated 
with policy subject ***Endpoint:  URI = 
TestClient#service-binding(TestInvocation/TestInvocation) has no matching 
policy set
+POL_4027=org.oasisopen.sca.ServiceRuntimeException: [Contribution: POL_4027, 
Artifact: META-INF/definitions.xml, Definitions:*** - [POL40020] Duplicate 
binding type {http://docs.oasis-open.org/ns/opencsa/sca/200912}dupBinding.type 
found in domain
 POL_4028=org.oasisopen.sca.ServiceRuntimeException: [Composite: 
{http://docs.oasis-open.org/ns/opencsa/sca/200912}] - [POL40002] The policy 
{http://docs.oasis-open.org/ns/opencsa/scatests/200903}PolicySetExtAttachProp 
has been attached to a property or one of its children. This is not allowed.
+POL_4033=org.oasisopen.sca.ServiceRuntimeException: [Contribution: POL_4033, 
Artifact: META-INF/definitions.xml, Definitions:*** - ContributionReadException 
occurred due to: 
org.apache.tuscany.sca.contribution.processor.ContributionReadException: 
javax.xml.xpath.XPathExpressionException
 POL_5001=org.oasisopen.sca.ServiceRuntimeException: [Contribution: 
http://tuscany.apache.org/SystemContribution] - [POL50001] An extension to 
support the implementation type 
{http://docs.oasis-open.org/ns/opencsa/sca/200912}unknown.type cant be found in 
the domain
-POL_9006=TUSCANY-1649
-POL_9009=TUSCANY-1649
-POL_9015=TUSCANY-1649
-POL_9016=TUSCANY-1649
-POL_9017=TUSCANY-1649
-POL_9018=TUSCANY-1649
-POL_10001=TUSCANY-3381
-POL_11001=org.oasisopen.sca.ServiceRuntimeException: [Contribution: POL_11001, 
Artifact: Test_POL_11001.composite] - XMLSchema validation error occured in: 
Test_POL_11001.composite ,line = ***, column = ***, Message = 
cvc-complex-type.2.4.a: Invalid content was found starting with element 
'policySetAttachment'. One of 
'{"http://docs.oasis-open.org/ns/opencsa/sca/200912":documentation, 
"http://docs.oasis-open.org/ns/opencsa/sca/200912":interface, 
"http://docs.oasis-open.org/ns/opencsa/sca/200912":binding, 
"http://docs.oasis-open.org/ns/opencsa/sca/200912":callback, 
WC[##other:"http://docs.oasis-open.org/ns/opencsa/sca/200912"]}' is expected
\ No newline at end of file
+POL_9006=org.oasisopen.sca.ServiceRuntimeException: [] - The Component 
reference reference1 can not require transactedOneWay because the 
implementation for Component TEST_POL_9006Component1 requires 
managedTransaction.local
+POL_9009=org.oasisopen.sca.ServiceRuntimeException: [] - The Component service 
Service1 can not require transactedOneWay because the implementation for 
Component TEST_POL_9009Component2 requires managedTransaction.local
+POL_9015=org.oasisopen.sca.ServiceRuntimeException: [] - The component service 
Service1 can not require propagatesTransaction because the implementation for 
component TEST_POL_9015Component1 requires managedTransaction.local
+POL_9016=org.oasisopen.sca.ServiceRuntimeException: [] - The component service 
Service1 can not require propagatesTransaction because the implementation for 
component TEST_POL_9016Component1 requires noManagedTransaction
+POL_9017=org.oasisopen.sca.ServiceRuntimeException: [] - The component 
reference reference1 can not require propagatesTransaction because the 
implementation for component TEST_POL_9017Component1 requires 
managedTransaction.local
+POL_9018=org.oasisopen.sca.ServiceRuntimeException: [] - The component 
reference reference1 can not require propagatesTransaction because the 
implementation for component TEST_POL_9018Component1 requires 
noManagedTransaction
+POL_9019=org.oasisopen.sca.ServiceRuntimeException: [***] - The Component 
reference reference1 can not require transactedOneWay because the 
implementation for Component TEST_POL_9019Component1 requires 
managedTransaction.local
+POL_9020=org.oasisopen.sca.ServiceRuntimeException: [] - The component 
reference reference1 can not require transactedOneWay because the operation 
operation1 is a two way operation
+POL_9021=org.oasisopen.sca.ServiceRuntimeException: [] - The component 
reference reference1 can not require immediateOneWay because the operation 
operation1 is a two way operation
+POL_9022=org.oasisopen.sca.ServiceRuntimeException: [Composite: 
{http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: 
TEST_POL_9022Component1, Reference: reference1] - 
[POL40009,ASM60009,ASM60010,JCA70001,JCA70003] Intent 
{http://docs.oasis-open.org/ns/opencsa/sca/200912}*** and 
{http://docs.oasis-open.org/ns/opencsa/sca/200912}*** are mutually exclusive
+POL_9023=org.oasisopen.sca.ServiceRuntimeException: [Composite: 
{http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: 
TEST_POL_9023Component2, Service: Service1] - 
[POL40009,ASM60009,ASM60010,JCA70001,JCA70003] Intent 
{http://docs.oasis-open.org/ns/opencsa/sca/200912}*** and 
{http://docs.oasis-open.org/ns/opencsa/sca/200912}*** are mutually exclusive
+POL_10001=org.oasisopen.sca.ServiceRuntimeException: [Composite: 
{http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestClient, 
Service: TestInvocation] - The noListener intent may only be specified on a 
reference.
+POL_11001=org.oasisopen.sca.ServiceRuntimeException: [Contribution: POL_11001, 
Artifact: Test_POL_11001.composite] - XMLSchema validation error occured in: 
Test_POL_11001.composite ,line = 21, column = 4, Message = 
cvc-complex-type.3.2.2: Attribute 'badAttribute' is not allowed to appear in 
element 'policySetAttachment'.
\ No newline at end of file


Reply via email to