From 3588cf33cd2ea312077bf7ad122a6aa1af19209b Mon Sep 17 00:00:00 2001 From: antelder Date: Thu, 4 Mar 2010 19:48:08 +0000 Subject: Tidy up dependencies, update all err message so row/column is *** as it moves around with different XML parsers git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@919145 13f79535-47bb-0310-9956-ffa450edef68 --- .../trunk/compliance-tests/assembly/pom.xml | 57 ++----- .../sca/otest/TuscanyOSGiRuntimeBridge.java | 163 -------------------- .../tuscany-oasis-sca-tests-errors.properties | 19 +-- .../trunk/compliance-tests/java-caa/pom.xml | 55 ++----- .../sca/otest/TuscanyOSGiRuntimeBridge.java | 170 --------------------- .../tuscany-oasis-sca-tests-errors.properties | 2 +- .../trunk/compliance-tests/java-ci/pom.xml | 59 ++----- .../sca/otest/TuscanyOSGiRuntimeBridge.java | 170 --------------------- .../tuscany-oasis-sca-tests-errors.properties | 6 +- 9 files changed, 48 insertions(+), 653 deletions(-) delete mode 100644 sca-java-2.x/trunk/compliance-tests/assembly/src/test/java/org/apache/tuscany/sca/otest/TuscanyOSGiRuntimeBridge.java delete mode 100644 sca-java-2.x/trunk/compliance-tests/java-caa/src/test/java/org/apache/tuscany/sca/otest/TuscanyOSGiRuntimeBridge.java delete mode 100644 sca-java-2.x/trunk/compliance-tests/java-ci/src/test/java/org/apache/tuscany/sca/otest/TuscanyOSGiRuntimeBridge.java (limited to 'sca-java-2.x') diff --git a/sca-java-2.x/trunk/compliance-tests/assembly/pom.xml b/sca-java-2.x/trunk/compliance-tests/assembly/pom.xml index 6b71dc10c7..5572960643 100644 --- a/sca-java-2.x/trunk/compliance-tests/assembly/pom.xml +++ b/sca-java-2.x/trunk/compliance-tests/assembly/pom.xml @@ -31,62 +31,29 @@ + + org.apache.tuscany.sca - tuscany-node-impl - 2.0-SNAPSHOT + oasis-assembly-test-runner + 1.0-SNAPSHOT - - org.apache.tuscany.sca - tuscany-deployment - 2.0-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-node-impl-osgi - 2.0-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-node-launcher - 2.0-SNAPSHOT - - org.apache.tuscany.sca - tuscany-node-launcher-equinox - 2.0-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-implementation-java-runtime + org.apache.tuscany.sca.shades + tuscany-base 2.0-SNAPSHOT - org.apache.tuscany.sca - tuscany-binding-ws-runtime-axis2 + org.apache.tuscany.sca.shades + tuscany-webservices 2.0-SNAPSHOT - - - org.apache.tuscany.sca - tuscany-host-jetty - 2.0-SNAPSHOT - - - - javax.servlet - servlet-api - 2.5 - - com.sun.xml.ws - jaxws-rt - 2.1.7 + org.mortbay.jetty + jetty + 6.1.19 @@ -98,8 +65,6 @@ - - ${artifactId} diff --git a/sca-java-2.x/trunk/compliance-tests/assembly/src/test/java/org/apache/tuscany/sca/otest/TuscanyOSGiRuntimeBridge.java b/sca-java-2.x/trunk/compliance-tests/assembly/src/test/java/org/apache/tuscany/sca/otest/TuscanyOSGiRuntimeBridge.java deleted file mode 100644 index f3972783bd..0000000000 --- a/sca-java-2.x/trunk/compliance-tests/assembly/src/test/java/org/apache/tuscany/sca/otest/TuscanyOSGiRuntimeBridge.java +++ /dev/null @@ -1,163 +0,0 @@ -/* - * 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. - */ -package org.apache.tuscany.sca.otest; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.fail; - -import java.io.IOException; -import java.io.InputStream; -import java.util.Properties; - -import org.apache.tuscany.sca.node.Node; -import org.apache.tuscany.sca.node.equinox.launcher.Contribution; -import org.apache.tuscany.sca.node.equinox.launcher.ContributionLocationHelper; -import org.apache.tuscany.sca.node.equinox.launcher.NodeLauncher; - -import client.RuntimeBridge; -import client.TestConfiguration; - - -/** - * An implementation of the Runtime Bridge for the Apache Tuscany SCA runtime (version 2.x) - * - */ -public class TuscanyOSGiRuntimeBridge implements RuntimeBridge { - - static final String CONTRIBUTION_LOCATION_PROPKEY = "OASIS_TESTENV_CONTRIBUTION_LOCATION"; - - protected NodeLauncher launcher; - protected Node node; - TestConfiguration testConfiguration = null; - protected Properties expectedErrorMessages; - - public TuscanyOSGiRuntimeBridge() { - // read test error mapping - expectedErrorMessages = new Properties(); - try { - InputStream propertiesStream = this.getClass().getResourceAsStream("/tuscany-oasis-sca-tests-errors.properties"); - expectedErrorMessages.load(propertiesStream); - } catch (IOException e) { - System.out.println("Unable to read oasis-sca-tests-errors.properties file"); - } - } - - public TestConfiguration getTestConfiguration() { - return testConfiguration; - } - - public void setTestConfiguration(TestConfiguration testConfiguration) { - this.testConfiguration = testConfiguration; - } - - public boolean startContribution(String contributionLocation, String[] contributionNames) throws Exception { - try { - // Tuscany specific code which starts the contribution(s) holding the test - launcher = NodeLauncher.newInstance(); - - Contribution[] contributions = new Contribution[contributionNames.length]; - String[] contributionURIs = getContributionURIs(contributionLocation); - for (int i = 0; i < contributions.length; i++) { - contributions[i] = new Contribution(contributionNames[i], contributionURIs[i]); - } // end for - - node = launcher.createNode(testConfiguration.getComposite(), contributions); - System.out.println("SCA Node API ClassLoader: " + node.getClass().getClassLoader()); - // Start the node - node.start(); - } catch (Exception e) { - System.out.println(e.getMessage()); - e.printStackTrace(); - throw e; - } // end try - - return true; - } // end method startContribution - - /** - * Gets the location of the Contributions as URIs - * @param contributionLocation - a location pattern URI, which contains one or more "%1" - * substrings, which are substituted with the name of the contribution to get the URI of - * the contribution - * @return the contribution locations as an array of Strings - */ - protected String[] getContributionURIs(String contributionLocation) throws Exception { - String[] locations; - locations = testConfiguration.getContributionNames(); - - if (locations != null && contributionLocation != null) { - - for (int i = 0; i < locations.length; i++) { - String aLocation = contributionLocation.replaceAll("%1", locations[i]); - - locations[i] = aLocation; - } // end for - } else { - if (locations == null) { - // No contribution specified - throw an Exception - throw new Exception("Unable to start SCA runtime - no contribution supplied - error"); - } else { - // No contribution location supplied - throw an Exception - throw new Exception("Unable to start SCA runtime - no contribution location supplied - error"); - } // end if - } // end if - - return locations; - } // end getContributionURI - - public void stopContribution() { - if (node != null) { - node.stop(); - } // end if - if (launcher != null) { - 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(); - - if (expectedMessage == null){ - fail("Null expected error message for test " + testName + - "Please add message to oasis-sca-tests-errors.properties"); - } - - if (receivedMessage == null){ - fail("Null received error message for test " + testName); - } - - int messageStart = receivedMessage.indexOf("] - "); - - if (messageStart < 0){ - fail("Message separator not found for test " + testName); - } - - receivedMessage = receivedMessage.substring(messageStart + 4); - - assertEquals( expectedMessage, receivedMessage ); - - return; - } - -} // end class TuscanyRuntimeBridge diff --git a/sca-java-2.x/trunk/compliance-tests/assembly/src/test/resources/tuscany-oasis-sca-tests-errors.properties b/sca-java-2.x/trunk/compliance-tests/assembly/src/test/resources/tuscany-oasis-sca-tests-errors.properties index 5da29309aa..38b1de2b3e 100644 --- a/sca-java-2.x/trunk/compliance-tests/assembly/src/test/resources/tuscany-oasis-sca-tests-errors.properties +++ b/sca-java-2.x/trunk/compliance-tests/assembly/src/test/resources/tuscany-oasis-sca-tests-errors.properties @@ -77,12 +77,13 @@ ASM_12003=org.apache.tuscany.sca.contribution.processor.ContributionResolveExcep ASM_12007=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestComponent1, Composite: {http://docs.oasis-open.org/ns/opencsa/scatests/2009032}TestComposite5, Component: TestComposite5TestComponent1] - Component type service not found for component service (missing @Remotable annotation?): Component = TestComposite5TestComponent1 Service = Service2 ASM_12008=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_ASM_12008TestComponent1, Composite: {http://docs.oasis-open.org/ns/opencsa/scatests/2009032}TestComposite5, Component: TestComposite5TestComponent1] - Component type service not found for component service (missing @Remotable annotation?): Component = TestComposite5TestComponent1 Service = Service2 ASM_12011=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestComponent1] - [ASM60030] Component implementation not resolved: Component = TestComponent1 Uri = TestComponent1 -ASM_12012=org.oasisopen.sca.ServiceRuntimeException: [Contribution: ASM_12012, Artifact: META-INF/sca-contribution.xml] - XMLSchema validation error occured in: jar:file:***ASM_12012***.zip!/META-INF/sca-contribution.xml ,line = 16, column = ***, 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/200912":documentation, "http://docs.oasis-open.org/ns/opencsa/sca/200912":deployable, "http://docs.oasis-open.org/ns/opencsa/sca/200912":importBase, "http://docs.oasis-open.org/ns/opencsa/sca/200912":exportBase, WC[##other:"http://docs.oasis-open.org/ns/opencsa/sca/200912"]}' is expected. -ASM_13001=org.oasisopen.sca.ServiceRuntimeException: [Contribution: ASM_13001, Artifact: Test_ASM_13001.composite] - XMLSchema validation error occured in: Test_ASM_13001.composite ,line = 25, column = ***, Message = cvc-complex-type.2.4.a: Invalid content was found starting with element 'sevrice'. One of '{"http://docs.oasis-open.org/ns/opencsa/sca/200912":service, "http://docs.oasis-open.org/ns/opencsa/sca/200912":reference, "http://docs.oasis-open.org/ns/opencsa/sca/200912":property, WC[##other:"http://docs.oasis-open.org/ns/opencsa/sca/200912"]}' is expected. -ASM_13002=org.oasisopen.sca.ServiceRuntimeException: [Contribution: ASM_13002, Artifact: Test_ASM_13002.composite] - XMLSchema validation error occured in: Test_ASM_13002.composite ,line = 28, column = ***, Message = cvc-complex-type.2.4.a: Invalid content was found starting with element 'operation'. One of '{"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. -ASM_13003=org.oasisopen.sca.ServiceRuntimeException: [Contribution: ASM_13003, Artifact: Test_ASM_13003.composite] - XMLSchema validation error occured in: Test_ASM_13003.composite ,line = 23, column = ***, Message = cvc-complex-type.2.4.a: Invalid content was found starting with element 'binding.ws'. One of '{"http://docs.oasis-open.org/ns/opencsa/sca/200912":documentation, "http://docs.oasis-open.org/ns/opencsa/sca/200912":include, "http://docs.oasis-open.org/ns/opencsa/sca/200912":service, "http://docs.oasis-open.org/ns/opencsa/sca/200912":property, "http://docs.oasis-open.org/ns/opencsa/sca/200912":component, "http://docs.oasis-open.org/ns/opencsa/sca/200912":reference, "http://docs.oasis-open.org/ns/opencsa/sca/200912":wire, WC[##other:"http://docs.oasis-open.org/ns/opencsa/sca/200912"]}' is expected. -ASM_13004=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestClient, Composite: {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TestClient_0002, Component: TestClient_0002TestClient] - [ASM40011,ASM60034] No value configured on a mustSupply property -ASM_13005=org.oasisopen.sca.ServiceRuntimeException: [Contribution: ASM_13005, Artifact: Test_ASM_13005.composite] - XMLSchema validation error occured in: Test_ASM_13005.composite ,line = 25, column = ***, Message = cvc-elt.2: The value of {abstract} in the element declaration for 'implementation' must be false. -ASM_13006=org.oasisopen.sca.ServiceRuntimeException: [Contribution: ASM_13006, Artifact: Test_ASM_13006.composite] - XMLSchema validation error occured in: Test_ASM_13006.composite ,line = 28, column = ***, Message = cvc-complex-type.3.2.2: Attribute 'callback' is not allowed to appear in element 'interface.java'. -ASM_13007=org.oasisopen.sca.ServiceRuntimeException: [Contribution: ASM_13007, Artifact: Test_ASM_13007.composite] - XMLSchema validation error occured in: Test_ASM_13007.composite ,line = 29, column = ***, Message = cvc-complex-type.3.2.2: Attribute 'mulplicity' is not allowed to appear in element 'reference'. -ASM_13008=org.oasisopen.sca.ServiceRuntimeException: [Contribution: ASM_13008, Artifact: Test_ASM_13008.composite] - XMLSchema validation error occured in: Test_ASM_13008.composite ,line = 40, column = ***, Message = cvc-complex-type.2.4.a: Invalid content was found starting with element 'operation'. One of '{"http://docs.oasis-open.org/ns/opencsa/sca/200912":documentation, "http://docs.oasis-open.org/ns/opencsa/sca/200912":wireFormat, "http://docs.oasis-open.org/ns/opencsa/sca/200912":operationSelector}' is expected. \ No newline at end of file +ASM_12012=org.oasisopen.sca.ServiceRuntimeException: [Contribution: ASM_12012, Artifact: META-INF/sca-contribution.xml] - XMLSchema validation error occured in: jar:file:***ASM_12012***.zip!/META-INF/sca-contribution.xml ,line = ***, column = ***, 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/200912":documentation, "http://docs.oasis-open.org/ns/opencsa/sca/200912":deployable, "http://docs.oasis-open.org/ns/opencsa/sca/200912":importBase, "http://docs.oasis-open.org/ns/opencsa/sca/200912":exportBase, WC[##other:"http://docs.oasis-open.org/ns/opencsa/sca/200912"]}' is expected. +ASM_13001=org.oasisopen.sca.ServiceRuntimeException: [Contribution: ASM_13001, Artifact: Test_ASM_13001.composite] - XMLSchema validation error occured in: Test_ASM_13001.composite ,line = ***, column = ***, Message = cvc-complex-type.2.4.a: Invalid content was found starting with element 'sevrice'. One of '{"http://docs.oasis-open.org/ns/opencsa/sca/200912":service, "http://docs.oasis-open.org/ns/opencsa/sca/200912":reference, "http://docs.oasis-open.org/ns/opencsa/sca/200912":property, WC[##other:"http://docs.oasis-open.org/ns/opencsa/sca/200912"]}' is expected. +ASM_13002=org.oasisopen.sca.ServiceRuntimeException: [Contribution: ASM_13002, Artifact: Test_ASM_13002.composite] - XMLSchema validation error occured in: Test_ASM_13002.composite ,line = ***, column = ***, Message = cvc-complex-type.2.4.a: Invalid content was found starting with element 'operation'. One of '{"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. +ASM_13003=org.oasisopen.sca.ServiceRuntimeException: [Contribution: ASM_13003, Artifact: Test_ASM_13003.composite] - XMLSchema validation error occured in: Test_ASM_13003.composite ,line = ***, column = ***, Message = cvc-complex-type.2.4.a: Invalid content was found starting with element 'binding.ws'. One of '{"http://docs.oasis-open.org/ns/opencsa/sca/200912":documentation, "http://docs.oasis-open.org/ns/opencsa/sca/200912":include, "http://docs.oasis-open.org/ns/opencsa/sca/200912":service, "http://docs.oasis-open.org/ns/opencsa/sca/200912":property, "http://docs.oasis-open.org/ns/opencsa/sca/200912":component, "http://docs.oasis-open.org/ns/opencsa/sca/200912":reference, "http://docs.oasis-open.org/ns/opencsa/sca/200912":wire, WC[##other:"http://docs.oasis-open.org/ns/opencsa/sca/200912"]}' is expected. +ASM_13004_1=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestClient, Composite: {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TestClient_0002, Component: TestClient_0002TestClient] - [ASM40011,ASM60034] No value configured on a mustSupply property +ASM_13004=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestClient] - PropertySourceXpathInvalid +ASM_13005=org.oasisopen.sca.ServiceRuntimeException: [Contribution: ASM_13005, Artifact: Test_ASM_13005.composite] - XMLSchema validation error occured in: Test_ASM_13005.composite ,line = ***, column = ***, Message = cvc-elt.2: The value of {abstract} in the element declaration for 'implementation' must be false. +ASM_13006=org.oasisopen.sca.ServiceRuntimeException: [Contribution: ASM_13006, Artifact: Test_ASM_13006.composite] - XMLSchema validation error occured in: Test_ASM_13006.composite ,line = ***, column = ***, Message = cvc-complex-type.3.2.2: Attribute 'callback' is not allowed to appear in element 'interface.java'. +ASM_13007=org.oasisopen.sca.ServiceRuntimeException: [Contribution: ASM_13007, Artifact: Test_ASM_13007.composite] - XMLSchema validation error occured in: Test_ASM_13007.composite ,line = ***, column = ***, Message = cvc-complex-type.3.2.2: Attribute 'mulplicity' is not allowed to appear in element 'reference'. +ASM_13008=org.oasisopen.sca.ServiceRuntimeException: [Contribution: ASM_13008, Artifact: Test_ASM_13008.composite] - XMLSchema validation error occured in: Test_ASM_13008.composite ,line = ***, column = ***, Message = cvc-complex-type.2.4.a: Invalid content was found starting with element 'operation'. One of '{"http://docs.oasis-open.org/ns/opencsa/sca/200912":documentation, "http://docs.oasis-open.org/ns/opencsa/sca/200912":wireFormat, "http://docs.oasis-open.org/ns/opencsa/sca/200912":operationSelector}' is expected. \ No newline at end of file diff --git a/sca-java-2.x/trunk/compliance-tests/java-caa/pom.xml b/sca-java-2.x/trunk/compliance-tests/java-caa/pom.xml index a2136f2aa1..21b3a42d0f 100644 --- a/sca-java-2.x/trunk/compliance-tests/java-caa/pom.xml +++ b/sca-java-2.x/trunk/compliance-tests/java-caa/pom.xml @@ -31,62 +31,29 @@ + + org.apache.tuscany.sca - tuscany-node-impl - 2.0-SNAPSHOT - - - org.apache.tuscany.sca - tuscany-deployment - 2.0-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-node-impl-osgi - 2.0-SNAPSHOT + oasis-javacaa-test-runner + 1.0-SNAPSHOT - - - org.apache.tuscany.sca - tuscany-node-launcher - 2.0-SNAPSHOT - - org.apache.tuscany.sca - tuscany-node-launcher-equinox - 2.0-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-implementation-java-runtime + org.apache.tuscany.sca.shades + tuscany-base 2.0-SNAPSHOT - org.apache.tuscany.sca - tuscany-binding-ws-runtime-axis2 + org.apache.tuscany.sca.shades + tuscany-webservices 2.0-SNAPSHOT - - - org.apache.tuscany.sca - tuscany-host-jetty - 2.0-SNAPSHOT - - - - javax.servlet - servlet-api - 2.5 - - com.sun.xml.ws - jaxws-rt - 2.1.7 + org.mortbay.jetty + jetty + 6.1.19 diff --git a/sca-java-2.x/trunk/compliance-tests/java-caa/src/test/java/org/apache/tuscany/sca/otest/TuscanyOSGiRuntimeBridge.java b/sca-java-2.x/trunk/compliance-tests/java-caa/src/test/java/org/apache/tuscany/sca/otest/TuscanyOSGiRuntimeBridge.java deleted file mode 100644 index 606d120951..0000000000 --- a/sca-java-2.x/trunk/compliance-tests/java-caa/src/test/java/org/apache/tuscany/sca/otest/TuscanyOSGiRuntimeBridge.java +++ /dev/null @@ -1,170 +0,0 @@ -/* - * 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. - */ -package org.apache.tuscany.sca.otest; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.fail; - -import java.io.IOException; -import java.io.InputStream; -import java.util.Properties; - -import org.apache.tuscany.sca.node.Node; -import org.apache.tuscany.sca.node.equinox.launcher.Contribution; -import org.apache.tuscany.sca.node.equinox.launcher.ContributionLocationHelper; -import org.apache.tuscany.sca.node.equinox.launcher.NodeLauncher; - -import client.RuntimeBridge; -import client.TestConfiguration; - - -/** - * An implementation of the Runtime Bridge for the Apache Tuscany SCA runtime (version 2.x) - * - */ -public class TuscanyOSGiRuntimeBridge implements RuntimeBridge { - - static final String CONTRIBUTION_LOCATION_PROPKEY = "OASIS_TESTENV_CONTRIBUTION_LOCATION"; - - protected NodeLauncher launcher; - protected Node node; - TestConfiguration testConfiguration = null; - protected Properties expectedErrorMessages; - - public TuscanyOSGiRuntimeBridge() { - // read test error mapping - expectedErrorMessages = new Properties(); - try { - InputStream propertiesStream = this.getClass().getResourceAsStream("/tuscany-oasis-sca-tests-errors.properties"); - expectedErrorMessages.load(propertiesStream); - } catch (IOException e) { - System.out.println("Unable to read oasis-sca-tests-errors.properties file"); - } - } - - public TestConfiguration getTestConfiguration() { - return testConfiguration; - } - - public void setTestConfiguration(TestConfiguration testConfiguration) { - this.testConfiguration = testConfiguration; - } - - public boolean startContribution(String contributionLocation, String[] contributionNames) throws Exception { - try { - // Tuscany specific code which starts the contribution(s) holding the test - launcher = NodeLauncher.newInstance(); - - Contribution[] contributions = new Contribution[contributionNames.length]; - String[] contributionURIs = getContributionURIs(contributionLocation); - for (int i = 0; i < contributions.length; i++) { - contributions[i] = new Contribution(contributionNames[i], contributionURIs[i]); - } // end for - - node = launcher.createNode(testConfiguration.getComposite(), contributions); - System.out.println("SCA Node API ClassLoader: " + node.getClass().getClassLoader()); - // Start the node - node.start(); - } catch (Exception e) { - System.out.println(e.getMessage()); - e.printStackTrace(); - throw e; - } // end try - - return true; - } // end method startContribution - - /** - * Gets the location of the Contributions as URIs - * @param contributionLocation - a location pattern URI, which contains one or more "%1" - * substrings, which are substituted with the name of the contribution to get the URI of - * the contribution - * @return the contribution locations as an array of Strings - */ - protected String[] getContributionURIs(String contributionLocation) throws Exception { - String[] locations; - locations = testConfiguration.getContributionNames(); - - if (locations != null && contributionLocation != null) { - - for (int i = 0; i < locations.length; i++) { - String aLocation = contributionLocation.replaceAll("%1", locations[i]); - - locations[i] = aLocation; - } // end for - } else { - if (locations == null) { - // No contribution specified - throw an Exception - throw new Exception("Unable to start SCA runtime - no contribution supplied - error"); - } else { - // No contribution location supplied - throw an Exception - throw new Exception("Unable to start SCA runtime - no contribution location supplied - error"); - } // end if - } // end if - - return locations; - } // end getContributionURI - - public void stopContribution() { - if (node != null) { - node.stop(); - } // end if - if (launcher != null) { - 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(); - - if (expectedMessage == null){ - fail("Null expected error message for test " + testName + - "Please add message to oasis-sca-tests-errors.properties"); - } - - if (receivedMessage == null){ - fail("Null received error message for test " + testName); - } - - int messageStart = receivedMessage.indexOf("] - "); - - if (messageStart < 0){ - fail("Message separator not found for test " + testName); - } - - receivedMessage = receivedMessage.substring(messageStart + 4); - - assertEquals( expectedMessage, receivedMessage ); - - return; - } - - public boolean startContribution(String compositeName, - String contributionLocation, String[] contributionNames) - throws Exception { - // TODO Auto-generated method stub - return false; - } - -} // end class TuscanyRuntimeBridge diff --git a/sca-java-2.x/trunk/compliance-tests/java-caa/src/test/resources/tuscany-oasis-sca-tests-errors.properties b/sca-java-2.x/trunk/compliance-tests/java-caa/src/test/resources/tuscany-oasis-sca-tests-errors.properties index 8ed2b2cd24..2d97cf0053 100644 --- a/sca-java-2.x/trunk/compliance-tests/java-caa/src/test/resources/tuscany-oasis-sca-tests-errors.properties +++ b/sca-java-2.x/trunk/compliance-tests/java-caa/src/test/resources/tuscany-oasis-sca-tests-errors.properties @@ -21,7 +21,7 @@ JCA_3003=org.oasisopen.sca.ServiceRuntimeException: [Contribution: JCA_3003, Com JCA_3004=org.oasisopen.sca.ServiceRuntimeException: [Contribution: JCA_3004, Composite: {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TEST_JCA_3004] - Class Not Found Exception: Service3Callback JCA_3006=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_JCA_3006Component2] - [ASM50004] Component service interface incompatible with implementation service interface: Component = TEST_JCA_3006Component2 Service = Service3WithCallback Callback operation not found on target JCA_3007=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_JCA_3007Component1] - Component reference interface incompatible with implementation reference interface: Component = TEST_JCA_3007Component1 Reference = reference1 Callback operation not found on target -JCA_3008=org.oasisopen.sca.ServiceRuntimeException: [Contribution: JCA_3008, Artifact: Test_JCA_3008.composite] - XMLSchema validation error occured in: Test_JCA_3008.composite ,line = 30, column = 13, Message = cvc-complex-type.3.2.2: Attribute 'oops' is not allowed to appear in element 'interface.java'. +JCA_3008=org.oasisopen.sca.ServiceRuntimeException: [Contribution: JCA_3008, Artifact: Test_JCA_3008.composite] - XMLSchema validation error occured in: Test_JCA_3008.composite ,line = ***, column = ***, Message = cvc-complex-type.3.2.2: Attribute 'oops' is not allowed to appear in element 'interface.java'. JCA_3009=org.apache.tuscany.sca.interfacedef.InvalidAnnotationException: @Remotable annotation present in a interface marked as not remotable in the SCDL JCA_3011=org.oasisopen.sca.ServiceRuntimeException: [Contribution: JCA_3011, Composite: {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TEST_JCA_3011] - JCA30006 Forbidden annotation interface org.oasisopen.sca.annotation.Property found in class org.oasisopen.sca.test.JCA3011Service JCA_3012=org.oasisopen.sca.ServiceRuntimeException: [Contribution: JCA_3012, Composite: {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TEST_JCA_3012] - JCA30007 Forbidden annotation interface org.oasisopen.sca.annotation.Property found in class org.oasisopen.sca.test.JCA3012Service3Callback diff --git a/sca-java-2.x/trunk/compliance-tests/java-ci/pom.xml b/sca-java-2.x/trunk/compliance-tests/java-ci/pom.xml index 6916af7860..c39fea6b2e 100644 --- a/sca-java-2.x/trunk/compliance-tests/java-ci/pom.xml +++ b/sca-java-2.x/trunk/compliance-tests/java-ci/pom.xml @@ -26,67 +26,34 @@ ../pom.xml tuscany-compliance-test-java-ci - Apache Tuscany SCA Specification Compliance Tests Java Client Implementation + Apache Tuscany SCA Specification Compliance Tests Java CI + + org.apache.tuscany.sca - tuscany-node-impl - 2.0-SNAPSHOT + oasis-javaci-test-runner + 1.0-SNAPSHOT - - org.apache.tuscany.sca - tuscany-deployment - 2.0-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-node-impl-osgi - 2.0-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-node-launcher - 2.0-SNAPSHOT - - org.apache.tuscany.sca - tuscany-node-launcher-equinox - 2.0-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-implementation-java-runtime + org.apache.tuscany.sca.shades + tuscany-base 2.0-SNAPSHOT - org.apache.tuscany.sca - tuscany-binding-ws-runtime-axis2 + org.apache.tuscany.sca.shades + tuscany-webservices 2.0-SNAPSHOT - - - org.apache.tuscany.sca - tuscany-host-jetty - 2.0-SNAPSHOT - - - - javax.servlet - servlet-api - 2.5 - - com.sun.xml.ws - jaxws-rt - 2.1.7 + org.mortbay.jetty + jetty + 6.1.19 @@ -98,8 +65,6 @@ - - ${artifactId} diff --git a/sca-java-2.x/trunk/compliance-tests/java-ci/src/test/java/org/apache/tuscany/sca/otest/TuscanyOSGiRuntimeBridge.java b/sca-java-2.x/trunk/compliance-tests/java-ci/src/test/java/org/apache/tuscany/sca/otest/TuscanyOSGiRuntimeBridge.java deleted file mode 100644 index 606d120951..0000000000 --- a/sca-java-2.x/trunk/compliance-tests/java-ci/src/test/java/org/apache/tuscany/sca/otest/TuscanyOSGiRuntimeBridge.java +++ /dev/null @@ -1,170 +0,0 @@ -/* - * 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. - */ -package org.apache.tuscany.sca.otest; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.fail; - -import java.io.IOException; -import java.io.InputStream; -import java.util.Properties; - -import org.apache.tuscany.sca.node.Node; -import org.apache.tuscany.sca.node.equinox.launcher.Contribution; -import org.apache.tuscany.sca.node.equinox.launcher.ContributionLocationHelper; -import org.apache.tuscany.sca.node.equinox.launcher.NodeLauncher; - -import client.RuntimeBridge; -import client.TestConfiguration; - - -/** - * An implementation of the Runtime Bridge for the Apache Tuscany SCA runtime (version 2.x) - * - */ -public class TuscanyOSGiRuntimeBridge implements RuntimeBridge { - - static final String CONTRIBUTION_LOCATION_PROPKEY = "OASIS_TESTENV_CONTRIBUTION_LOCATION"; - - protected NodeLauncher launcher; - protected Node node; - TestConfiguration testConfiguration = null; - protected Properties expectedErrorMessages; - - public TuscanyOSGiRuntimeBridge() { - // read test error mapping - expectedErrorMessages = new Properties(); - try { - InputStream propertiesStream = this.getClass().getResourceAsStream("/tuscany-oasis-sca-tests-errors.properties"); - expectedErrorMessages.load(propertiesStream); - } catch (IOException e) { - System.out.println("Unable to read oasis-sca-tests-errors.properties file"); - } - } - - public TestConfiguration getTestConfiguration() { - return testConfiguration; - } - - public void setTestConfiguration(TestConfiguration testConfiguration) { - this.testConfiguration = testConfiguration; - } - - public boolean startContribution(String contributionLocation, String[] contributionNames) throws Exception { - try { - // Tuscany specific code which starts the contribution(s) holding the test - launcher = NodeLauncher.newInstance(); - - Contribution[] contributions = new Contribution[contributionNames.length]; - String[] contributionURIs = getContributionURIs(contributionLocation); - for (int i = 0; i < contributions.length; i++) { - contributions[i] = new Contribution(contributionNames[i], contributionURIs[i]); - } // end for - - node = launcher.createNode(testConfiguration.getComposite(), contributions); - System.out.println("SCA Node API ClassLoader: " + node.getClass().getClassLoader()); - // Start the node - node.start(); - } catch (Exception e) { - System.out.println(e.getMessage()); - e.printStackTrace(); - throw e; - } // end try - - return true; - } // end method startContribution - - /** - * Gets the location of the Contributions as URIs - * @param contributionLocation - a location pattern URI, which contains one or more "%1" - * substrings, which are substituted with the name of the contribution to get the URI of - * the contribution - * @return the contribution locations as an array of Strings - */ - protected String[] getContributionURIs(String contributionLocation) throws Exception { - String[] locations; - locations = testConfiguration.getContributionNames(); - - if (locations != null && contributionLocation != null) { - - for (int i = 0; i < locations.length; i++) { - String aLocation = contributionLocation.replaceAll("%1", locations[i]); - - locations[i] = aLocation; - } // end for - } else { - if (locations == null) { - // No contribution specified - throw an Exception - throw new Exception("Unable to start SCA runtime - no contribution supplied - error"); - } else { - // No contribution location supplied - throw an Exception - throw new Exception("Unable to start SCA runtime - no contribution location supplied - error"); - } // end if - } // end if - - return locations; - } // end getContributionURI - - public void stopContribution() { - if (node != null) { - node.stop(); - } // end if - if (launcher != null) { - 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(); - - if (expectedMessage == null){ - fail("Null expected error message for test " + testName + - "Please add message to oasis-sca-tests-errors.properties"); - } - - if (receivedMessage == null){ - fail("Null received error message for test " + testName); - } - - int messageStart = receivedMessage.indexOf("] - "); - - if (messageStart < 0){ - fail("Message separator not found for test " + testName); - } - - receivedMessage = receivedMessage.substring(messageStart + 4); - - assertEquals( expectedMessage, receivedMessage ); - - return; - } - - public boolean startContribution(String compositeName, - String contributionLocation, String[] contributionNames) - throws Exception { - // TODO Auto-generated method stub - return false; - } - -} // end class TuscanyRuntimeBridge diff --git a/sca-java-2.x/trunk/compliance-tests/java-ci/src/test/resources/tuscany-oasis-sca-tests-errors.properties b/sca-java-2.x/trunk/compliance-tests/java-ci/src/test/resources/tuscany-oasis-sca-tests-errors.properties index f7c29a83f8..f4bb253219 100644 --- a/sca-java-2.x/trunk/compliance-tests/java-ci/src/test/resources/tuscany-oasis-sca-tests-errors.properties +++ b/sca-java-2.x/trunk/compliance-tests/java-ci/src/test/resources/tuscany-oasis-sca-tests-errors.properties @@ -18,12 +18,12 @@ POJO_2003=org.apache.tuscany.sca.contribution.processor.ContributionResolveExcep POJO_5001=org.apache.tuscany.sca.contribution.processor.ContributionResolveException: org.apache.tuscany.sca.implementation.java.introspect.impl.NoConstructorException: No public constructor for class POJO_5005=org.apache.tuscany.sca.contribution.processor.ContributionResolveException: org.apache.tuscany.sca.implementation.java.introspect.impl.AmbiguousConstructorException: POJO_5006=org.apache.tuscany.sca.contribution.processor.ContributionResolveException: org.apache.tuscany.sca.implementation.java.introspect.impl.DuplicateConstructorException: Multiple constructors marked with @Constructor -POJO_5007=org.apache.tuscany.sca.implementation.java.introspect.impl.InvalidConstructorException: Multiple annotated constrictors -POJO_8002=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_POJO_8002Component1] - Component service interface incompatible with implementation service interface: Component = TEST_POJO_8002Component1 Service = Service1Superset Operation not found on target +POJO_5007=org.apache.tuscany.sca.contribution.processor.ContributionResolveException: org.apache.tuscany.sca.implementation.java.introspect.impl.InvalidConstructorException: Multiple annotated constructors +POJO_8002=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_POJO_8002Component1] - [ASM50004] Component service interface incompatible with implementation service interface: Component = TEST_POJO_8002Component1 Service = Service1Superset Operation not found on target POJO_8008=* unknown POJO_8013=org.apache.tuscany.sca.contribution.processor.ContributionResolveException: org.apache.tuscany.sca.implementation.java.introspect.impl.DuplicatePropertyException: duplicateProperty POJO_8014=org.apache.tuscany.sca.contribution.processor.ContributionResolveException: org.apache.tuscany.sca.implementation.java.introspect.impl.DuplicateReferenceException: duplicateReference -POJO_9001=org.oasisopen.sca.ServiceRuntimeException: [Contribution: POJO_9001, Artifact: Test_POJO_9001.composite] - XMLSchema validation error occured in: Test_POJO_9001.composite ,line = 30, column = 9, Message = cvc-complex-type.3.2.2: Attribute 'interface' is not allowed to appear in element 'implementation.java'. +POJO_9001=org.oasisopen.sca.ServiceRuntimeException: [Contribution: POJO_9001, Artifact: Test_POJO_9001.composite] - XMLSchema validation error occured in: Test_POJO_9001.composite ,line = ***, column = ***, Message = cvc-complex-type.3.2.2: Attribute 'interface' is not allowed to appear in element 'implementation.java'. POJO_10001=org.oasisopen.sca.ServiceRuntimeException: [Contribution: POJO_10001, Artifact: META-INF/sca-contribution.xml] - The value of the @package attribute on the element is not unique across all other elements within the contribution. POJO_10004=org.apache.tuscany.sca.contribution.processor.ContributionResolveException: [JCI100007] A Java package org.oasisopen.sca.test;version=1.0.0 that is specified on an export element MUST be contained within the contribution containing the export element. POJO_10005=org.oasisopen.sca.ServiceRuntimeException: [Contribution: POJO_10005, Artifact: META-INF/sca-contribution.xml] - The value of the @package attribute on the element is not unique across all other elements within the contribution. -- cgit v1.2.3