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/newlayout/tuscany-policy-test-runner | |
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 'otest/newlayout/tuscany-policy-test-runner')
-rw-r--r-- | otest/newlayout/tuscany-policy-test-runner/src/test/tjava/org/apache/tuscany/sca/otest/TuscanyRuntimeBridge.java | 18 |
1 files changed, 15 insertions, 3 deletions
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 |