Skip to content

Commit

Permalink
[FIXED JENKINS-30220] Add UnitTest: validate whether a particular com…
Browse files Browse the repository at this point in the history
…puter when is offline it fails if the cause is null
  • Loading branch information
Victor Martinez committed Aug 31, 2015
1 parent d1d7a44 commit 49b98e2
Showing 1 changed file with 16 additions and 0 deletions.
Expand Up @@ -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);
Expand Down

0 comments on commit 49b98e2

Please sign in to comment.