summaryrefslogtreecommitdiffstats
path: root/otest/newlayout
diff options
context:
space:
mode:
authorslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2010-03-04 12:09:29 +0000
committerslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2010-03-04 12:09:29 +0000
commit49668061453ae65d71f2ba37cbf0e2a10cbafbd6 (patch)
treed97970ace7bf388058ff221a6c4d0e3ce5e23acc /otest/newlayout
parenteac5b11cfbf00b74c2eab3f6e5a7f4adf0b5b5f2 (diff)
Fix up OSGi version of the bridge also
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@918959 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'otest/newlayout')
-rw-r--r--otest/newlayout/tuscany-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-test-runner/src/test/tjava/org/apache/tuscany/sca/otest/TuscanyOSGiRuntimeBridge.java b/otest/newlayout/tuscany-test-runner/src/test/tjava/org/apache/tuscany/sca/otest/TuscanyOSGiRuntimeBridge.java
index 8b909b0483..6f7af61cee 100644
--- a/otest/newlayout/tuscany-test-runner/src/test/tjava/org/apache/tuscany/sca/otest/TuscanyOSGiRuntimeBridge.java
+++ b/otest/newlayout/tuscany-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);