diff options
Diffstat (limited to 'sca-java-2.x/trunk/compliance-tests/java-ci')
4 files changed, 39 insertions, 54 deletions
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 34161f0cf3..878a6b140f 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 @@ -34,13 +34,14 @@ <!-- This is only needed to get the module working in Eclipse which doesn't pick it up from the dependency plugin unpack -->
<!-- The dependency plugin unpack is needed as presently the surefire plugin wont run tests in a dependency jar -->
<groupId>org.apache.tuscany.sca</groupId>
- <artifactId>oasis-javaci-test-runner</artifactId>
- <version>1.0-SNAPSHOT</version>
+ <artifactId>tuscany-otests-sca-j-ci-tests</artifactId>
+ <version>2.0-SNAPSHOT</version>
</dependency>
<dependency>
- <groupId>org.apache.tuscany.sca.shades</groupId>
- <artifactId>tuscany-base</artifactId>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-feature-base</artifactId>
+ <type>pom</type>
<version>2.0-SNAPSHOT</version>
</dependency>
@@ -98,15 +99,15 @@ <artifactItems>
<artifactItem>
<groupId>org.apache.tuscany.sca</groupId>
- <artifactId>oasis-javaci-contributions</artifactId>
- <version>1.0-SNAPSHOT</version>
+ <artifactId>oasis-jci-contributions</artifactId>
+ <version>2.0-SNAPSHOT</version>
<type>zip</type>
<outputDirectory>${project.build.directory}/oasis-contributions</outputDirectory>
</artifactItem>
<artifactItem>
<groupId>org.apache.tuscany.sca</groupId>
- <artifactId>oasis-javaci-test-runner</artifactId>
- <version>1.0-SNAPSHOT</version>
+ <artifactId>tuscany-otests-sca-j-ci-tests</artifactId>
+ <version>2.0-SNAPSHOT</version>
<type>jar</type>
<excludes>commons-logging.properties,oasis-sca-tests.properties,tuscany-oasis-sca-tests-errors.properties</excludes>
<outputDirectory>${project.build.directory}/test-classes</outputDirectory>
diff --git a/sca-java-2.x/trunk/compliance-tests/java-ci/src/test/java/org/apache/tuscany/sca/otest/TuscanyRuntimeBridge.java b/sca-java-2.x/trunk/compliance-tests/java-ci/src/test/java/org/apache/tuscany/sca/otest/TuscanyRuntimeBridge.java index 136e5668c0..e7a161ae13 100644 --- a/sca-java-2.x/trunk/compliance-tests/java-ci/src/test/java/org/apache/tuscany/sca/otest/TuscanyRuntimeBridge.java +++ b/sca-java-2.x/trunk/compliance-tests/java-ci/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/java-ci/src/test/resources/oasis-sca-tests.properties b/sca-java-2.x/trunk/compliance-tests/java-ci/src/test/resources/oasis-sca-tests.properties index 38e1e013dc..d1ef56cc4b 100644 --- a/sca-java-2.x/trunk/compliance-tests/java-ci/src/test/resources/oasis-sca-tests.properties +++ b/sca-java-2.x/trunk/compliance-tests/java-ci/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/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 4de2d6e98b..8d8c93a80e 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 @@ -22,9 +22,14 @@ POJO_5007=org.apache.tuscany.sca.contribution.processor.ContributionResolveExcep POJO_8002=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_POJO_8002Component1] - [ASM50004,JCA30002,JCI80001] Component service interface incompatible with implementation service interface: Component = TEST_POJO_8002Component1 Service = Service1Superset Operation operationb not found on target
POJO_8003=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_POJO_8003Component1, Service: Service1] - [POL40009,ASM60009,ASM60010,JCA70001,JCA70003] Intent {http://docs.oasis-open.org/ns/opencsa/sca/200912}suspendsTransaction and {http://docs.oasis-open.org/ns/opencsa/sca/200912}propagatesTransaction are mutually exclusive
POJO_8008=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_POJO_8008Component1, Service: Service1] - [POL40009,ASM60009,ASM60010,JCA70001,JCA70003] Intent {http://docs.oasis-open.org/ns/opencsa/sca/200912}suspendsTransaction and {http://docs.oasis-open.org/ns/opencsa/sca/200912}propagatesTransaction are mutually exclusive
-POJO_8012=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_POJO_8012Component1, Service: Service1] - [POL40009,ASM60009,ASM60010,JCA70001,JCA70003] Intent {http://docs.oasis-open.org/ns/opencsa/sca/200912}noManagedTransaction and {http://docs.oasis-open.org/ns/opencsa/sca/200912}managedTransaction are mutually exclusive
+POJO_8012=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_POJO_8012Component1, Service: Service1] - [POL40009,ASM60009,ASM60010,JCA70001,JCA70003] Intent {http://docs.oasis-open.org/ns/opencsa/sca/200912}***anagedTransaction and {http://docs.oasis-open.org/ns/opencsa/sca/200912}***anagedTransaction are mutually exclusive
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_8030=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_POJO_8030Component1, Service: Service1] - [POL40009,ASM60009,ASM60010,JCA70001,JCA70003] Intent {http://docs.oasis-open.org/ns/opencsa/sca/200912}SOAP.v1_1 and {http://docs.oasis-open.org/ns/opencsa/sca/200912}SOAP.v1_2 are mutually exclusive
+POJO_8031=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_POJO_8031Component1, Service: Service1] - [POL40009,ASM60009,ASM60010,JCA70001,JCA70003] Intent {http://docs.oasis-open.org/ns/opencsa/scatests/200903}antiSoap and {http://docs.oasis-open.org/ns/opencsa/sca/200912}SOAP are mutually exclusive
+POJO_8032=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_POJO_8032Component1, Service: Service1] - [POL40009,ASM60009,ASM60010,JCA70001,JCA70003] Intent {http://docs.oasis-open.org/ns/opencsa/scatests/200903}antiSoap and {http://docs.oasis-open.org/ns/opencsa/sca/200912}SOAP are mutually exclusive
+POJO_8033=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_POJO_8033Component1, Service: Service1] - [POL40009,ASM60009,ASM60010,JCA70001,JCA70003] Intent {http://docs.oasis-open.org/ns/opencsa/scatests/200903}antiSoap and {http://docs.oasis-open.org/ns/opencsa/sca/200912}SOAP are mutually exclusive
+POJO_8035=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_POJO_8035Component1, Service: Service1] - [POL40009,ASM60009,ASM60010,JCA70001,JCA70003] Intent {http://docs.oasis-open.org/ns/opencsa/sca/200912}SOAP.v1_1 and {http://docs.oasis-open.org/ns/opencsa/sca/200912}SOAP.v1_2 are mutually exclusive
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] - [JCI10001] The value of the @package attribute on the <import.java/> element is not unique across all other <import.java/> 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.
|