diff options
author | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2010-09-17 09:55:22 +0000 |
---|---|---|
committer | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2010-09-17 09:55:22 +0000 |
commit | c6209248a7c730286c17cbacfccba1246a2976fa (patch) | |
tree | 41814d599e4618be0c3e8d7fa42964b3a8ea9258 /sca-java-2.x/trunk/compliance-tests/binding-ws/src/test | |
parent | ea1b353c39a02445c84c63d9adb4ba85d0e77701 (diff) |
Switch to using the latest WS otests (r217).
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@998044 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/compliance-tests/binding-ws/src/test')
3 files changed, 27 insertions, 48 deletions
diff --git a/sca-java-2.x/trunk/compliance-tests/binding-ws/src/test/java/org/apache/tuscany/sca/otest/TuscanyRuntimeBridge.java b/sca-java-2.x/trunk/compliance-tests/binding-ws/src/test/java/org/apache/tuscany/sca/otest/TuscanyRuntimeBridge.java index 6f4aa8e86a..139e8b31fd 100644 --- a/sca-java-2.x/trunk/compliance-tests/binding-ws/src/test/java/org/apache/tuscany/sca/otest/TuscanyRuntimeBridge.java +++ b/sca-java-2.x/trunk/compliance-tests/binding-ws/src/test/java/org/apache/tuscany/sca/otest/TuscanyRuntimeBridge.java @@ -22,19 +22,17 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; import java.io.BufferedWriter; -import java.io.File; import java.io.FileWriter; import java.io.IOException; 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 +45,6 @@ public class TuscanyRuntimeBridge implements RuntimeBridge { protected NodeFactory launcher; protected Node node; protected Properties expectedErrorMessages; - - TestConfiguration testConfiguration = null; public TuscanyRuntimeBridge() { // read test error mapping @@ -61,36 +57,18 @@ public class TuscanyRuntimeBridge implements RuntimeBridge { } } - 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(); - ps.setProperty("defaultScheme", "vm"); - ps.setProperty("org.apache.tuscany.sca.binding.ws.jaxws.ri.JAXWSBindingProviderFactory.defaultPort", "8080"); - launcher = NodeFactory.newInstance(ps); + launcher = NodeFactory.newInstance(); 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 +91,14 @@ public class TuscanyRuntimeBridge implements RuntimeBridge { * 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"; - } - if (!(new File(aLocation)).exists()) { - aLocation = aLocation.replace(".zip", ".jar"); - } + String aLocation = contributionLocation.replaceAll("%1", contributionNames[i]); + locations[i] = aLocation; } // end for } else { @@ -151,15 +122,11 @@ public class TuscanyRuntimeBridge implements RuntimeBridge { 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 +145,7 @@ public class TuscanyRuntimeBridge implements RuntimeBridge { } // 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("\\*\\*\\*"); @@ -235,4 +202,16 @@ public class TuscanyRuntimeBridge implements RuntimeBridge { } } + 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 diff --git a/sca-java-2.x/trunk/compliance-tests/binding-ws/src/test/resources/oasis-sca-tests.properties b/sca-java-2.x/trunk/compliance-tests/binding-ws/src/test/resources/oasis-sca-tests.properties index 33192c49e5..dc3296ae8c 100644 --- a/sca-java-2.x/trunk/compliance-tests/binding-ws/src/test/resources/oasis-sca-tests.properties +++ b/sca-java-2.x/trunk/compliance-tests/binding-ws/src/test/resources/oasis-sca-tests.properties @@ -26,5 +26,5 @@ org.oasis.sca.tests.assembly.runtime_bridge=org.apache.tuscany.sca.otest.Tuscany # The location of the contributions for the test suite # %1 represents the placement of the name of each contribution into the location URI -org.oasis.sca.tests.assembly.contribution.location=target/oasis-contributions/%1.zip +org.oasis.sca.tests.assembly.contribution.location=target/oasis-contributions/%1/target/%1.zip diff --git a/sca-java-2.x/trunk/compliance-tests/binding-ws/src/test/resources/tuscany-oasis-sca-tests-errors.properties b/sca-java-2.x/trunk/compliance-tests/binding-ws/src/test/resources/tuscany-oasis-sca-tests-errors.properties index 292486c446..572a5f1841 100644 --- a/sca-java-2.x/trunk/compliance-tests/binding-ws/src/test/resources/tuscany-oasis-sca-tests-errors.properties +++ b/sca-java-2.x/trunk/compliance-tests/binding-ws/src/test/resources/tuscany-oasis-sca-tests-errors.properties @@ -14,11 +14,12 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. + BWS_2001=org.oasisopen.sca.ServiceRuntimeException: [Contribution: BWS_2001, Artifact: Test_BWS_2001.composite] - [BWS20001] The URI value for binding.ws on an SCA reference must be absolute. Non-absolute value found /TEST_BWS_2001Component2/Service1 BWS_2002=org.oasisopen.sca.ServiceRuntimeException: [Contribution: BWS_2002, Artifact: Test_BWS_2002.composite] - Invalid WebService binding wsdlElement attribute: http://test.sca.oasisopen.org/#wsdl.port(NonExistentPortName) BWS_2003=org.oasisopen.sca.ServiceRuntimeException: [Contribution: BWS_2003, Artifact: Test_BWS_2003.composite] - [BWS20003] The wsdlElement attribute of a binding.ws on an SCA service must not specify the wsdl.service form of URI. The following URI was found http://test.sca.oasisopen.org/#wsdl.service(Service1Service) BWS_2005=org.oasisopen.sca.ServiceRuntimeException: [Contribution: BWS_2005, Composite: {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TEST_BWS_2005] - [BWS20005][BWS20010] The WSDL binding transport http://example.com/foo/bar is not supported by Tuscany -BWS_2007=org.apache.tuscany.sca.runtime.ActivationException: org.apache.tuscany.sca.runtime.ActivationException: org.oasisopen.sca.ServiceRuntimeException: Component TEST_BWS_2007Component2 Service Service1 interface is incompatible with the interface of the reference binding - Service1 - Operations called operation1 are not compatible Operation argument types source = {http://www.w3.org/2001/XMLSchema}float target = {http://www.w3.org/2001/XMLSchema}string don't match for output types||| - [(***)Endpoint: URI = TEST_BWS_2007Component2#service-binding(Service1/Service1)] +BWS_2007=org.apache.tuscany.sca.runtime.ActivationException: org.apache.tuscany.sca.runtime.ActivationException: org.oasisopen.sca.ServiceRuntimeException: Component TEST_BWS_2007Component2 Service Service1 interface is incompatible with the interface of the reference binding - Service1 - Operations called operation1 are not compatible Operation argument types source = {http://www.w3.org/2001/XMLSchema}float target = {http://www.w3.org/2001/XMLSchema}string don't match for output types|||Operations called operation1 are not compatible||| - [(***)Endpoint: URI = TEST_BWS_2007Component2#service-binding(Service1/Service1)] BWS_2011=org.oasisopen.sca.ServiceRuntimeException: [Contribution: BWS_2011, Composite: {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TEST_BWS_2011] - [BWS20005][BWS20010] The WSDL binding transport http://example.com/foo/bar is not supported by Tuscany BWS_2013=org.oasisopen.sca.ServiceRuntimeException: [Contribution: BWS_2013, Composite: {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TEST_BWS_2013] - [BWS20005][BWS20010] The WSDL binding transport http://example.com/foo/bar is not supported by Tuscany BWS_2015=org.oasisopen.sca.ServiceRuntimeException: [Contribution: BWS_2015, Artifact: Test_BWS_2015.composite] - [BWS20017] binding.ws has a @wsdli:wsdlLocation attribute but no @wsdlElement attribute @@ -29,5 +30,4 @@ BWS_2019=org.oasisopen.sca.ServiceRuntimeException: [Contribution: BWS_2019, Art BWS_2020=org.oasisopen.sca.ServiceRuntimeException [BWS20025] Unable to determine destination endpoint for endpoint reference (***)EndpointReference: URI = TEST_BWS_2020Component1#reference-binding(reference1/Reference1) RESOLVED_BINDING Target = (***)Endpoint: BWS_2022=org.apache.tuscany.sca.runtime.ActivationException: org.apache.tuscany.sca.runtime.ActivationException: org.apache.tuscany.sca.runtime.ActivationException: org.apache.tuscany.sca.runtime.ActivationException: org.oasisopen.sca.ServiceRuntimeException: Component TEST_BWS_2022Component1 Reference reference1 interface is incompatible with the interface of the reference binding Reference1 - Callback interface doesn't match as one of the callback interfaces is null - [(***)EndpointReference: URI = TEST_BWS_2022Component1#reference-binding(reference1/Reference1) RESOLVED_BINDING Target = (***)Endpoint: ] BWS_4008=org.apache.tuscany.sca.runtime.ActivationException: org.apache.tuscany.sca.runtime.ActivationException: org.apache.tuscany.sca.runtime.ActivationException: org.apache.tuscany.sca.runtime.ActivationException: org.oasisopen.sca.ServiceRuntimeException: rpc/encoded WSDL style not supported. Component TEST_BWS_4008Component1 Reference reference1 Binding Reference1 -BWS_5003=A header representing a Message Addressing Property is not valid and the message cannot be processed - +BWS_5003=A header representing a Message Addressing Property is not valid and the message cannot be processed
\ No newline at end of file |