summaryrefslogtreecommitdiffstats
path: root/otest/newlayout/tuscany-java-caa-test-runner
diff options
context:
space:
mode:
authorslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2010-03-04 14:41:08 +0000
committerslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2010-03-04 14:41:08 +0000
commit9dfe74de98e094596123e2b951c6f934e0b453e9 (patch)
tree0726ca46d37a63ebba9b4a17034f4cd1bd3e710a /otest/newlayout/tuscany-java-caa-test-runner
parent49668061453ae65d71f2ba37cbf0e2a10cbafbd6 (diff)
Fix up the JCAA osgi bridge to match OASIS
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@919002 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'otest/newlayout/tuscany-java-caa-test-runner')
-rw-r--r--otest/newlayout/tuscany-java-caa-test-runner/src/test/tjava/org/apache/tuscany/sca/otest/TuscanyOSGiRuntimeBridge.java27
1 files changed, 7 insertions, 20 deletions
diff --git a/otest/newlayout/tuscany-java-caa-test-runner/src/test/tjava/org/apache/tuscany/sca/otest/TuscanyOSGiRuntimeBridge.java b/otest/newlayout/tuscany-java-caa-test-runner/src/test/tjava/org/apache/tuscany/sca/otest/TuscanyOSGiRuntimeBridge.java
index 8b909b0483..6f7af61cee 100644
--- a/otest/newlayout/tuscany-java-caa-test-runner/src/test/tjava/org/apache/tuscany/sca/otest/TuscanyOSGiRuntimeBridge.java
+++ b/otest/newlayout/tuscany-java-caa-test-runner/src/test/tjava/org/apache/tuscany/sca/otest/TuscanyOSGiRuntimeBridge.java
@@ -44,7 +44,6 @@ public class TuscanyOSGiRuntimeBridge implements RuntimeBridge {
protected NodeLauncher launcher;
protected Node node;
- TestConfiguration testConfiguration = null;
protected Properties expectedErrorMessages;
public TuscanyOSGiRuntimeBridge() {
@@ -58,26 +57,18 @@ public class TuscanyOSGiRuntimeBridge implements RuntimeBridge {
}
}
- public TestConfiguration getTestConfiguration() {
- return testConfiguration;
- }
-
- public void setTestConfiguration(TestConfiguration testConfiguration) {
- this.testConfiguration = testConfiguration;
- }
-
- 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
launcher = NodeLauncher.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);
System.out.println("SCA Node API ClassLoader: " + node.getClass().getClassLoader());
// Start the node
node.start();
@@ -97,17 +88,16 @@ public class TuscanyOSGiRuntimeBridge 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]);
+ String aLocation = contributionLocation.replaceAll("%1", contributionNames[i]);
locations[i] = aLocation;
- } // end for
+ } // end for
} else {
if (locations == null) {
// No contribution specified - throw an Exception
@@ -130,9 +120,6 @@ public class TuscanyOSGiRuntimeBridge implements RuntimeBridge {
} // 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);