Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
[JENKINS-23641] - Direct tests for the issue
Signed-off-by: Oleg Nenashev <o.v.nenashev@gmail.com>
- Loading branch information
1 parent
c4347f8
commit 25c1e85dd48d2bbe878aa7eb26f862b6e9f52971
Showing
3 changed files
with
55 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,51 @@ | ||
/* | ||
* To change this license header, choose License Headers in Project Properties. | ||
* To change this template file, choose Tools | Templates | ||
* and open the template in the editor. | ||
*/ | ||
|
||
package com.cloudbees.jenkins; | ||
|
||
import hudson.model.Build; | ||
import hudson.model.FreeStyleProject; | ||
import hudson.model.Result; | ||
import hudson.plugins.git.GitSCM; | ||
import org.junit.Rule; | ||
import org.junit.Test; | ||
import org.jvnet.hudson.test.Bug; | ||
import org.jvnet.hudson.test.HudsonTestCase; | ||
import org.jvnet.hudson.test.JenkinsRule; | ||
|
||
/** | ||
* Tests for {@link GitHubCommitNotifier}. | ||
* @author Oleg Nenashev <o.v.nenashev@gmail.com> | ||
*/ | ||
public class GitHubCommitNotifierTest extends HudsonTestCase { | ||
|
||
// @Rule | ||
// public JenkinsRule r = new JenkinsRule(); | ||
|
||
|
||
@Test | ||
@Bug(23641) | ||
public void testNoBuildData() throws Exception, InterruptedException { | ||
FreeStyleProject prj = createFreeStyleProject("23641_noBuildData"); | ||
prj.getPublishersList().add(new GitHubCommitNotifier()); | ||
Build b = prj.scheduleBuild2(0).get(); | ||
assertBuildStatus(Result.FAILURE, b); | ||
assertLogContains(Messages.GitHubCommitNotifier_NoBuildDataError(), b); | ||
} | ||
|
||
@Test | ||
@Bug(23641) | ||
public void testNoBuildRevision() throws Exception, InterruptedException { | ||
FreeStyleProject prj = createFreeStyleProject(); | ||
prj.setScm(new GitSCM("http://non.existent.git.repo.nowhere/repo.git")); | ||
prj.getPublishersList().add(new GitHubCommitNotifier()); | ||
Build b = prj.scheduleBuild2(0).get(); | ||
assertBuildStatus(Result.FAILURE, b); | ||
assertLogContains(Messages.GitHubCommitNotifier_NoLastRevisionError(), b); | ||
} | ||
|
||
|
||
} |