提交 cf30417b 编写于 作者: K kohsuke

added one more assertion for convenience.

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@13172 71c3de6d-444a-0410-be80-ed276b4c234a
上级 28be7f47
......@@ -248,6 +248,9 @@ public abstract class HudsonTestCase extends TestCase {
new BufferedReader(new InputStreamReader(System.in)).readLine();
}
/**
* Asserts that the outcome of the build is a specific outcome.
*/
public void assertBuildStatus(Result status, Run r) throws Exception {
if(status==r.getResult())
return;
......@@ -257,6 +260,18 @@ public abstract class HudsonTestCase extends TestCase {
assertEquals(status,r.getResult());
}
/**
* Asserts that the console output of the build contains the given substring.
*/
public void assertLogContains(String substring, Run run) throws Exception {
String log = run.getLog();
if(log.contains(substring))
return; // good!
System.out.println(log);
fail("Console output of "+run+" didn't contain "+substring);
}
//
// recipe methods. Control the test environments.
//
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册