Skip to content
Permalink
Browse files

Merge pull request #1 from v1v/nullcauseTestCase

[FIXED JENKINS-30220] Add UnitTest: validate null Causes
  • Loading branch information
v1v committed Aug 31, 2015
2 parents 2505935 + 49b98e2 commit 53ddf572cbafd2ff7e57bce2ced3b97008b0794b
Showing with 16 additions and 0 deletions.
  1. +16 −0 src/test/java/org/jenkinsci/plugins/mailwatcher/NodeStatusTest.java
@@ -99,6 +99,22 @@ private MailWatcherMailer installComputerListener(MailWatcherMailer mailer) {
return mailer;
}

@Test @Bug(30220)
public void notifyWhenSlaveBecomesOfflineWithoutCause() throws Exception {
MailWatcherMailer mailer = mock(MailWatcherMailer.class);
installComputerListener(mailer);

j.jenkins.getGlobalNodeProperties().add(new WatcherNodeProperty(
"on.online@mailinator.com", "on.offline@mailinator.com"
));

final Computer computer = j.jenkins.toComputer();
computer.setTemporarilyOffline(true, null);
computer.setTemporarilyOffline(false, null);

assertNotified(mailer);
}

@Test @Bug(23496)
public void notifyWhenSlaveBecomesAwailable() throws Exception {
MailWatcherMailer mailer = mock(MailWatcherMailer.class);

0 comments on commit 53ddf57

Please sign in to comment.
You can’t perform that action at this time.