Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Merge pull request #7 from alexlehm/master
[JENKINS-12582] CVS-Plugin: Password file "${user.home}/.cvspass" is ignored
- Loading branch information
Showing
3 changed files
with
34 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package hudson.scm; | ||
|
||
import java.io.File; | ||
import java.net.URISyntaxException; | ||
|
||
import org.junit.Test; | ||
import org.jvnet.hudson.test.HudsonTestCase; | ||
|
||
public class LegacyConvertorTest extends HudsonTestCase { | ||
|
||
// borrowed from core/test/.../TestResultTest, this is probably too complicated | ||
private String getDataFile(String name) throws URISyntaxException { | ||
return new File(LegacyConvertorTest.class.getResource(name).toURI()).getAbsolutePath(); | ||
} | ||
|
||
// check JENKINS-12582 CVS-Plugin: Password file "${user.home}/.cvspass" is ignored | ||
@Test | ||
public final void testGetPassword() throws URISyntaxException { | ||
// FIXME: not sure if setting user.home is safe in all cases? | ||
String home=System.getProperty("user.home"); | ||
System.setProperty("user.home", getDataFile("")); | ||
LegacyConvertor instance = LegacyConvertor.getInstance(); | ||
assertEquals("password", instance.getPassword(":pserver:user@example.com/usr/local/cvsroot")); | ||
assertEquals("password", instance.getPassword(":pserver:user@example.com:/usr/local/cvsroot")); | ||
|
||
System.setProperty("user.home", home); | ||
} | ||
|
||
} |
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 @@ | ||
/1 :pserver:user@example.com:2401/usr/local/cvsroot A:yZZ30 e |