You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by sj...@apache.org on 2016/06/22 10:25:28 UTC
[1/2] brooklyn-server git commit: TestSshCommand checks all
assertions rather than throwing first
Repository: brooklyn-server
Updated Branches:
refs/heads/master 004c6c1f0 -> 99d073f62
TestSshCommand checks all assertions rather than throwing first
Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/c6266dde
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/c6266dde
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/c6266dde
Branch: refs/heads/master
Commit: c6266dde407756b93a06e037928371bd30f944ca
Parents: 004c6c1
Author: Sam Corbett <sa...@cloudsoftcorp.com>
Authored: Wed Jun 22 10:22:28 2016 +0100
Committer: Sam Corbett <sa...@cloudsoftcorp.com>
Committed: Wed Jun 22 10:22:28 2016 +0100
----------------------------------------------------------------------
.../brooklyn/test/framework/TestFrameworkAssertions.java | 9 +++++++++
.../apache/brooklyn/test/framework/TestSshCommandImpl.java | 8 +++++---
2 files changed, 14 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/c6266dde/test-framework/src/main/java/org/apache/brooklyn/test/framework/TestFrameworkAssertions.java
----------------------------------------------------------------------
diff --git a/test-framework/src/main/java/org/apache/brooklyn/test/framework/TestFrameworkAssertions.java b/test-framework/src/main/java/org/apache/brooklyn/test/framework/TestFrameworkAssertions.java
index bc358f8..7f1406c 100644
--- a/test-framework/src/main/java/org/apache/brooklyn/test/framework/TestFrameworkAssertions.java
+++ b/test-framework/src/main/java/org/apache/brooklyn/test/framework/TestFrameworkAssertions.java
@@ -155,6 +155,15 @@ public class TestFrameworkAssertions {
}
}
+ public static <T> void checkActualAgainstAssertions(AssertionSupport support,
+ Map<String, Object> assertions, String target, T actual) {
+ try {
+ checkActualAgainstAssertions(assertions, target, actual);
+ } catch (Throwable t) {
+ support.fail(t);
+ }
+ }
+
public static <T> void checkActualAgainstAssertions(Map<String, Object> assertions,
String target, T actual) {
for (Map.Entry<String, Object> assertion : assertions.entrySet()) {
http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/c6266dde/test-framework/src/main/java/org/apache/brooklyn/test/framework/TestSshCommandImpl.java
----------------------------------------------------------------------
diff --git a/test-framework/src/main/java/org/apache/brooklyn/test/framework/TestSshCommandImpl.java b/test-framework/src/main/java/org/apache/brooklyn/test/framework/TestSshCommandImpl.java
index 3d2ae02..c65f4f9 100644
--- a/test-framework/src/main/java/org/apache/brooklyn/test/framework/TestSshCommandImpl.java
+++ b/test-framework/src/main/java/org/apache/brooklyn/test/framework/TestSshCommandImpl.java
@@ -197,15 +197,17 @@ public class TestSshCommandImpl extends TargetableTestComponentImpl implements T
LOG.debug("{}, Result is {}\nwith output [\n{}\n] and error [\n{}\n]", new Object[] {
this, result.getExitCode(), shorten(result.getStdout()), shorten(result.getStderr())
});
+ TestFrameworkAssertions.AssertionSupport support = new TestFrameworkAssertions.AssertionSupport();
for (Map<String, Object> assertion : exitCodeAssertions()) {
- checkActualAgainstAssertions(assertion, "exit code", result.getExitCode());
+ checkActualAgainstAssertions(support, assertion, "exit code", result.getExitCode());
}
for (Map<String, Object> assertion : getAssertions(this, ASSERT_OUT)) {
- checkActualAgainstAssertions(assertion, "stdout", result.getStdout());
+ checkActualAgainstAssertions(support, assertion, "stdout", result.getStdout());
}
for (Map<String, Object> assertion : getAssertions(this, ASSERT_ERR)) {
- checkActualAgainstAssertions(assertion, "stderr", result.getStderr());
+ checkActualAgainstAssertions(support, assertion, "stderr", result.getStderr());
}
+ support.validate();
}
private Result executeDownloadedScript(SshMachineLocation machineLocation, String url, String scriptPath, Map<String, Object> env) {
[2/2] brooklyn-server git commit: This closes #213
Posted by sj...@apache.org.
This closes #213
TestSshCommand checks all assertions rather than throwing first
Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/99d073f6
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/99d073f6
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/99d073f6
Branch: refs/heads/master
Commit: 99d073f620a8186b3e896dd9ce8fecb2dab5d0a9
Parents: 004c6c1 c6266dd
Author: Sam Corbett <sa...@cloudsoftcorp.com>
Authored: Wed Jun 22 11:24:51 2016 +0100
Committer: Sam Corbett <sa...@cloudsoftcorp.com>
Committed: Wed Jun 22 11:24:51 2016 +0100
----------------------------------------------------------------------
.../brooklyn/test/framework/TestFrameworkAssertions.java | 9 +++++++++
.../apache/brooklyn/test/framework/TestSshCommandImpl.java | 8 +++++---
2 files changed, 14 insertions(+), 3 deletions(-)
----------------------------------------------------------------------