diff options
author | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2009-09-23 17:37:40 +0000 |
---|---|---|
committer | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2009-09-23 17:37:40 +0000 |
commit | 6000b221ac2f097498c4915279351d53108277f3 (patch) | |
tree | e6d0d7cadb2491ee5a4f82d3d2f96cdecba0e4b0 /java/sca/otest/newlayout/tuscany-test-runner/src/test/tjava/org/apache/tuscany/sca/otest/TuscanyRuntimeBridge.java | |
parent | 4c31e02ecc8216a242419b451dfec4a48fe8645d (diff) |
Updates to make the runtime bridge implementations match the new interface in OASIS that allows individual errors to be checked for
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@818171 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r-- | java/sca/otest/newlayout/tuscany-test-runner/src/test/tjava/org/apache/tuscany/sca/otest/TuscanyRuntimeBridge.java | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/java/sca/otest/newlayout/tuscany-test-runner/src/test/tjava/org/apache/tuscany/sca/otest/TuscanyRuntimeBridge.java b/java/sca/otest/newlayout/tuscany-test-runner/src/test/tjava/org/apache/tuscany/sca/otest/TuscanyRuntimeBridge.java index 98aaa2ef7b..9658dfd0ad 100644 --- a/java/sca/otest/newlayout/tuscany-test-runner/src/test/tjava/org/apache/tuscany/sca/otest/TuscanyRuntimeBridge.java +++ b/java/sca/otest/newlayout/tuscany-test-runner/src/test/tjava/org/apache/tuscany/sca/otest/TuscanyRuntimeBridge.java @@ -18,6 +18,9 @@ */ package org.apache.tuscany.sca.otest; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; + import java.io.IOException; import java.io.InputStream; import java.util.Properties; @@ -48,7 +51,7 @@ public class TuscanyRuntimeBridge implements RuntimeBridge { // read test error mapping expectedErrorMessages = new Properties(); try { - InputStream propertiesStream = this.getClass().getResourceAsStream("/oasis-sca-tests-errors.properties"); + InputStream propertiesStream = this.getClass().getResourceAsStream("/tuscany-oasis-sca-tests-errors.properties"); expectedErrorMessages.load(propertiesStream); } catch (IOException e) { System.out.println("Unable to read oasis-sca-tests-errors.properties file"); @@ -131,34 +134,30 @@ public class TuscanyRuntimeBridge implements RuntimeBridge { return ContributionLocationHelper.getContributionLocation(testConfiguration.getTestClass()); } // end method getContributionLocation - public boolean checkError(String testName, Throwable ex){ + public void checkError(String testName, Throwable ex) throws Throwable { String expectedMessage = expectedErrorMessages.getProperty(testName); String receivedMessage = ex.getMessage(); if (expectedMessage == null){ - System.out.println("Null expected error message for test " + testName); - System.out.println("Please add message to oasis-sca-tests-errors.properties"); - return false; + fail("Null expected error message for test " + testName + + "Please add message to oasis-sca-tests-errors.properties"); } if (receivedMessage == null){ - System.out.println("Null received error message for test " + testName); - return false; + fail("Null received error message for test " + testName); } int messageStart = receivedMessage.indexOf("] - "); if (messageStart < 0){ - System.out.println("Message separator not found for test " + testName); + fail("Message separator not found for test " + testName); } receivedMessage = receivedMessage.substring(messageStart + 4); - if (receivedMessage.startsWith(expectedMessage)){ - return true; - } else { - return false; - } + assertEquals( expectedMessage, receivedMessage ); + + return; } } // end class TuscanyRuntimeBridge |