Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIXED JENKINS-12113] local module directory is not expanded with Env…
…Vars
- Loading branch information
kutzi
committed
Feb 12, 2012
1 parent
15a2394
commit c96f849
Showing
2 changed files
with
98 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package hudson.scm; | ||
|
||
import hudson.EnvVars; | ||
import hudson.FilePath; | ||
import hudson.remoting.VirtualChannel; | ||
|
||
import org.junit.Assert; | ||
import org.junit.Test; | ||
import org.jvnet.hudson.test.Bug; | ||
|
||
/** | ||
* Unit tests for {@link SubversionSCM}. | ||
* | ||
* ({@link SubversionSCMTest} ist more an integration test) | ||
* | ||
* @author kutzi | ||
*/ | ||
public class SubversionSCMUnitTest { | ||
|
||
@Test | ||
@Bug(12113) | ||
public void testLocalDirectoryIsExpandedWithEnvVars() { | ||
FilePath root = new FilePath((VirtualChannel)null, "root"); | ||
|
||
EnvVars envVars = new EnvVars(); | ||
envVars.put("BRANCH", "test"); | ||
|
||
SubversionSCM scm = new SubversionSCM("dummyUrl"); | ||
|
||
FilePath resolvedRoot = scm._getModuleRoot(root, "$BRANCH/someMorePath", envVars); | ||
|
||
Assert.assertEquals("root/test/someMorePath", resolvedRoot.getRemote()); | ||
} | ||
} |