diff options
author | lresende <lresende@13f79535-47bb-0310-9956-ffa450edef68> | 2010-03-13 16:03:17 +0000 |
---|---|---|
committer | lresende <lresende@13f79535-47bb-0310-9956-ffa450edef68> | 2010-03-13 16:03:17 +0000 |
commit | 8fb9a0f170c28034d7594bbf020c300c0a63da17 (patch) | |
tree | d2cc99ac333fb65565d3df46ede996c4391065ac /otest | |
parent | 4e02cd7d1aefdc41b650e923d4074032d7bb1bb9 (diff) |
Properly handling how to retrieve runtime/execution error messages
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@922589 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
4 files changed, 57 insertions, 12 deletions
diff --git a/otest/newlayout/tuscany-java-caa-test-runner/src/test/tjava/org/apache/tuscany/sca/otest/TuscanyRuntimeBridge.java b/otest/newlayout/tuscany-java-caa-test-runner/src/test/tjava/org/apache/tuscany/sca/otest/TuscanyRuntimeBridge.java index 3e0b6380f5..139e8b31fd 100644 --- a/otest/newlayout/tuscany-java-caa-test-runner/src/test/tjava/org/apache/tuscany/sca/otest/TuscanyRuntimeBridge.java +++ b/otest/newlayout/tuscany-java-caa-test-runner/src/test/tjava/org/apache/tuscany/sca/otest/TuscanyRuntimeBridge.java @@ -28,12 +28,11 @@ 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) @@ -127,7 +126,7 @@ public class TuscanyRuntimeBridge implements RuntimeBridge { 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); @@ -203,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/otest/newlayout/tuscany-java-ci-test-runner/src/test/tjava/org/apache/tuscany/sca/otest/TuscanyRuntimeBridge.java b/otest/newlayout/tuscany-java-ci-test-runner/src/test/tjava/org/apache/tuscany/sca/otest/TuscanyRuntimeBridge.java index 63036d305c..e7a161ae13 100644 --- a/otest/newlayout/tuscany-java-ci-test-runner/src/test/tjava/org/apache/tuscany/sca/otest/TuscanyRuntimeBridge.java +++ b/otest/newlayout/tuscany-java-ci-test-runner/src/test/tjava/org/apache/tuscany/sca/otest/TuscanyRuntimeBridge.java @@ -28,12 +28,11 @@ 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)
@@ -127,7 +126,7 @@ public class TuscanyRuntimeBridge implements RuntimeBridge { 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);
@@ -203,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/otest/newlayout/tuscany-policy-test-runner/src/test/tjava/org/apache/tuscany/sca/otest/TuscanyRuntimeBridge.java b/otest/newlayout/tuscany-policy-test-runner/src/test/tjava/org/apache/tuscany/sca/otest/TuscanyRuntimeBridge.java index 3e0b6380f5..1f9fa9bbfa 100644 --- a/otest/newlayout/tuscany-policy-test-runner/src/test/tjava/org/apache/tuscany/sca/otest/TuscanyRuntimeBridge.java +++ b/otest/newlayout/tuscany-policy-test-runner/src/test/tjava/org/apache/tuscany/sca/otest/TuscanyRuntimeBridge.java @@ -28,12 +28,11 @@ 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) @@ -127,7 +126,7 @@ public class TuscanyRuntimeBridge implements RuntimeBridge { 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); @@ -202,5 +201,18 @@ public class TuscanyRuntimeBridge implements RuntimeBridge { } catch (IOException e) { } } + + 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/otest/newlayout/tuscany-test-runner/src/test/tjava/org/apache/tuscany/sca/otest/TuscanyRuntimeBridge.java b/otest/newlayout/tuscany-test-runner/src/test/tjava/org/apache/tuscany/sca/otest/TuscanyRuntimeBridge.java index 3e0b6380f5..139e8b31fd 100644 --- a/otest/newlayout/tuscany-test-runner/src/test/tjava/org/apache/tuscany/sca/otest/TuscanyRuntimeBridge.java +++ b/otest/newlayout/tuscany-test-runner/src/test/tjava/org/apache/tuscany/sca/otest/TuscanyRuntimeBridge.java @@ -28,12 +28,11 @@ 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) @@ -127,7 +126,7 @@ public class TuscanyRuntimeBridge implements RuntimeBridge { 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); @@ -203,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 |