summaryrefslogtreecommitdiffstats
path: root/java/sca
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-08-05 18:51:00 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-08-05 18:51:00 +0000
commit63798bfd54f26213897e4db67716ec9fb3ba7d22 (patch)
treee69fe2d80f8aad5e831662d33f770d600dac3c77 /java/sca
parent673e1ece424a13e9b3e10b92b96b5cc92f639be1 (diff)
Format the code
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@801358 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca')
-rw-r--r--java/sca/otest/current/tests/src/main/ttest/tuscany/TuscanyRuntimeBridge.java129
1 files changed, 64 insertions, 65 deletions
diff --git a/java/sca/otest/current/tests/src/main/ttest/tuscany/TuscanyRuntimeBridge.java b/java/sca/otest/current/tests/src/main/ttest/tuscany/TuscanyRuntimeBridge.java
index 1b5b76e4b6..dfaab9415a 100644
--- a/java/sca/otest/current/tests/src/main/ttest/tuscany/TuscanyRuntimeBridge.java
+++ b/java/sca/otest/current/tests/src/main/ttest/tuscany/TuscanyRuntimeBridge.java
@@ -14,51 +14,50 @@ import client.TestConfiguration;
*
*/
public class TuscanyRuntimeBridge implements RuntimeBridge {
-
- static final String CONTRIBUTION_LOCATION_PROPKEY = "OASIS_TESTENV_CONTRIBUTION_LOCATION";
-
+
+ static final String CONTRIBUTION_LOCATION_PROPKEY = "OASIS_TESTENV_CONTRIBUTION_LOCATION";
+
protected NodeFactory launcher;
protected Node node;
TestConfiguration testConfiguration = null;
-
+
public TuscanyRuntimeBridge() {
}
-
- 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 = NodeFactory.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
+
+ 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 = NodeFactory.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
+ } // 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
@@ -66,30 +65,30 @@ public class TuscanyRuntimeBridge implements RuntimeBridge {
* @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;
+ 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() {
+
+ public void stopContribution() {
if (node != null) {
node.stop();
node.destroy();
@@ -97,10 +96,10 @@ public class TuscanyRuntimeBridge implements RuntimeBridge {
if (launcher != null) {
launcher.destroy();
} // end if
- } // end method stopContribution
-
- public String getContributionLocation(Class<?> testClass) {
- return ContributionLocationHelper.getContributionLocation(testConfiguration.getTestClass());
- } // end method getContributionLocation
-
+ } // end method stopContribution
+
+ public String getContributionLocation(Class<?> testClass) {
+ return ContributionLocationHelper.getContributionLocation(testConfiguration.getTestClass());
+ } // end method getContributionLocation
+
} // end class TuscanyRuntimeBridge