@@ -0,0 +1,1591 @@
+package hudson.plugins.git;%0A%0Aimport hudson.EnvVars;%0Aimport hudson.model.Node;%0Aimport hudson.model.TaskListener;%0Aimport hudson.slaves.DumbSlave;%0Aimport hudson.util.StreamTaskListener;%0Aimport java.io.IOException;%0Aimport org.apache.commons.lang.SystemUtils;%0Aimport static org.junit.Assert.*;%0Aimport org.junit.Before;%0Aimport org.junit.Rule;%0Aimport org.junit.Test;%0Aimport org.jvnet.hudson.test.JenkinsRule;%0A%0Apublic class GitToolTest %7B%0A%0A    @Rule public JenkinsRule j = new JenkinsRule();%0A%0A    private GitTool gitTool;%0A    %0A    @Before%0A    public void setUp() throws IOException %7B%0A        GitTool.onLoaded();%0A        gitTool = GitTool.getDefaultInstallation();%0A    %7D%0A    %0A    @Test%0A    public void testGetGitExe() %7B%0A        assertEquals(SystemUtils.IS_OS_WINDOWS ? %22git.exe%22 : %22git%22, gitTool.getGitExe());%0A    %7D%0A%0A    /* @Test - Need to find a way to create a Node in a unit test */%0A    public void testForNode() throws Exception %7B%0A        DumbSlave s = j.createSlave();%0A        Node node = null;%0A        TaskListener log = StreamTaskListener.fromStdout();%0A        GitTool newTool = gitTool.forNode(node, log);%0A        assertEquals(gitTool.getGitExe(), newTool.getGitExe());%0A    %7D%0A%0A    @Test%0A    public void testForEnvironment() %7B%0A        EnvVars environment = new EnvVars();%0A        GitTool newTool = gitTool.forEnvironment(environment);%0A        assertEquals(gitTool.getGitExe(), newTool.getGitExe());%0A    %7D%0A%0A    @Test%0A    public void testGetDescriptor() %7B%0A        GitTool.DescriptorImpl descriptor = gitTool.getDescriptor();%0A        assertEquals(%22Git%22, descriptor.getDisplayName());%0A    %7D%0A    %0A%7D%0A

Add GitTool test