From fca5cb37cec3389f326a0ffa60d0116cdc850b22 Mon Sep 17 00:00:00 2001 From: kohsuke Date: Sat, 17 Jan 2009 00:33:56 +0000 Subject: [PATCH] Added a convenience method. git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@14567 71c3de6d-444a-0410-be80-ed276b4c234a --- core/src/main/java/hudson/scm/SubversionSCM.java | 7 +++++++ test/src/test/java/hudson/scm/SubversionSCMTest.java | 6 +----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/core/src/main/java/hudson/scm/SubversionSCM.java b/core/src/main/java/hudson/scm/SubversionSCM.java index 6fd6961f6b..6b2ef9f76b 100644 --- a/core/src/main/java/hudson/scm/SubversionSCM.java +++ b/core/src/main/java/hudson/scm/SubversionSCM.java @@ -159,6 +159,13 @@ public class SubversionSCM extends SCM implements Serializable { this.browser = browser; } + /** + * Convenience constructor, especially during testing. + */ + public SubversionSCM(String svnUrl) { + this(new String[]{svnUrl},new String[]{null},true,null); + } + /** * @deprecated * as of 1.91. Use {@link #getLocations()} instead. diff --git a/test/src/test/java/hudson/scm/SubversionSCMTest.java b/test/src/test/java/hudson/scm/SubversionSCMTest.java index 4284e76489..44b1646bb9 100644 --- a/test/src/test/java/hudson/scm/SubversionSCMTest.java +++ b/test/src/test/java/hudson/scm/SubversionSCMTest.java @@ -72,11 +72,7 @@ public class SubversionSCMTest extends HudsonTestCase { * Loads a test Subversion repository into a temporary directory, and creates {@link SubversionSCM} for it. */ private SubversionSCM loadSvnRepo() throws Exception { - return new SubversionSCM( - new String[] { "file://" + new CopyExisting(getClass().getResource("/svn-repo.zip")).allocate().toURI().toURL().getPath() + "trunk/a" }, - new String[]{null}, - true, null - ); + return new SubversionSCM("file://" + new CopyExisting(getClass().getResource("/svn-repo.zip")).allocate().toURI().toURL().getPath() + "trunk/a"); } @Email("http://www.nabble.com/Hudson-1.266-and-1.267%3A-Subversion-authentication-broken--td21156950.html")