Skip to content
Permalink
Browse files

[FIXED JENKINS-30220] Add UnitTest: validate whether a particular com…

…puter when is offline it fails if the cause is null
  • Loading branch information
Victor Martinez
Victor Martinez committed Aug 31, 2015
1 parent d1d7a44 commit 49b98e258d7ebe65d2073dbd88d67463ad451d78
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 49b98e2

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