Testcase for ToolInstallation support
This commit is contained in:
parent
54b3199086
commit
ea33bed2aa
|
|
@ -0,0 +1,30 @@
|
|||
package org.jenkinsci.plugins.casc;
|
||||
|
||||
import hudson.plugins.git.GitTool;
|
||||
import jenkins.model.Jenkins;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.jvnet.hudson.test.JenkinsRule;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
/**
|
||||
* @author <a href="mailto:nicolas.deloof@gmail.com">Nicolas De Loof</a>
|
||||
*/
|
||||
public class GitToolInstallationTest {
|
||||
|
||||
|
||||
@Rule
|
||||
public JenkinsRule j = new JenkinsRule();
|
||||
|
||||
@Test
|
||||
public void set_git_installations() throws Exception {
|
||||
ConfigurationAsCode.configure(getClass().getResourceAsStream("GitToolInstallationTest.yml"));
|
||||
|
||||
final Jenkins jenkins = Jenkins.getInstance();
|
||||
final GitTool.DescriptorImpl descriptor = (GitTool.DescriptorImpl) jenkins.getDescriptor(GitTool.class);
|
||||
assertEquals(2, descriptor.getInstallations().length);
|
||||
assertEquals("/usr/local/bin/git", descriptor.getInstallation("another_git").getGitExe());
|
||||
assertEquals("/bin/git", descriptor.getInstallation("git").getGitExe());
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
|
||||
git:
|
||||
installations:
|
||||
- name: git
|
||||
home: /bin/git
|
||||
- name: another_git
|
||||
home: /usr/local/bin/git
|
||||
|
||||
Loading…
Reference in New Issue