Author: slaws
Date: Thu Mar 4 14:41:08 2010
New Revision: 919002
URL: http://svn.apache.org/viewvc?rev=919002&view=rev
Log:
Fix up the JCAA osgi bridge to match OASIS
Modified:
tuscany/otest/newlayout/tuscany-java-caa-test-runner/src/test/tjava/org/apache/tuscany/sca/otest/TuscanyOSGiRuntimeBridge.java
Modified:
tuscany/otest/newlayout/tuscany-java-caa-test-runner/src/test/tjava/org/apache/tuscany/sca/otest/TuscanyOSGiRuntimeBridge.java
URL:
http://svn.apache.org/viewvc/tuscany/otest/newlayout/tuscany-java-caa-test-runner/src/test/tjava/org/apache/tuscany/sca/otest/TuscanyOSGiRuntimeBridge.java?rev=919002&r1=919001&r2=919002&view=diff
==============================================================================
---
tuscany/otest/newlayout/tuscany-java-caa-test-runner/src/test/tjava/org/apache/tuscany/sca/otest/TuscanyOSGiRuntimeBridge.java
(original)
+++
tuscany/otest/newlayout/tuscany-java-caa-test-runner/src/test/tjava/org/apache/tuscany/sca/otest/TuscanyOSGiRuntimeBridge.java
Thu Mar 4 14:41:08 2010
@@ -44,7 +44,6 @@
protected NodeLauncher launcher;
protected Node node;
- TestConfiguration testConfiguration = null;
protected Properties expectedErrorMessages;
public TuscanyOSGiRuntimeBridge() {
@@ -58,26 +57,18 @@
}
}
- 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 @@
* 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 @@
} // 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);