Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #117 from christ66/JENKINS-27084
[FIXED JENKINS-27084] Revert system property change
  • Loading branch information
christ66 committed Jun 15, 2015
2 parents a67ae6e + 2fedb3a commit ad260ce
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 43 deletions.
2 changes: 1 addition & 1 deletion src/main/java/hudson/scm/DirAwareSVNXMLLogHandler.java
Expand Up @@ -4,7 +4,7 @@
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
* are also available at http://lib.svnkit.com/license.html
* are also available at http://svnkit.com/license.html
* If newer versions of this license are posted there, you may use a
* newer version instead, at your option.
* ====================================================================
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/hudson/scm/SubversionChangeLogBuilder.java
Expand Up @@ -107,7 +107,7 @@ public boolean run(Collection<SubversionSCM.External> externals, Result changeLo
th.setResult(changeLog);
SVNLogFilter logFilter = scm.isFilterChangelog() ? scm.createSVNLogFilter() : new NullSVNLogFilter();
DirAwareSVNXMLLogHandler logHandler = new DirAwareSVNXMLLogHandler(th, logFilter);
// work around for http://lib.svnkit.com/tracker/view.php?id=175
// work around for http://svnkit.com/tracker/view.php?id=175
th.setDocumentLocator(DUMMY_LOCATOR);
logHandler.startDocument();

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/hudson/scm/SubversionEventHandlerImpl.java
Expand Up @@ -4,7 +4,7 @@
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
* are also available at http://lib.svnkit.com/license.html
* are also available at http://svnkit.com/license.html
* If newer versions of this license are posted there, you may use a
* newer version instead, at your option.
* ====================================================================
Expand Down
14 changes: 7 additions & 7 deletions src/main/java/hudson/scm/SubversionSCM.java
Expand Up @@ -866,7 +866,7 @@ public boolean requiresWorkspaceForPolling() {
*
* <p>
* Use canonical path to avoid SVNKit/symlink problem as described in
* https://wiki.lib.svnkit.com/SVNKit_FAQ
* https://wiki.svnkit.com/SVNKit_FAQ
*
* @return null
* if the operation failed. Otherwise the set of local workspace paths
Expand Down Expand Up @@ -2232,10 +2232,10 @@ public void postCredential(String url, final UserProvidedCredential upc, PrintWr

try {
// the way it works with SVNKit is that
// 1) lib.svnkit calls AuthenticationManager asking for a credential.
// 1) svnkit calls AuthenticationManager asking for a credential.
// this is when we can see the 'realm', which identifies the user domain.
// 2) DefaultSVNAuthenticationManager returns the username and password we set below
// 3) if the authentication is successful, lib.svnkit calls back acknowledgeAuthentication
// 3) if the authentication is successful, svnkit calls back acknowledgeAuthentication
// (so we store the password info here)
repository = SVNRepositoryFactory.create(SVNURL.parseURIDecoded(url));
repository.setTunnelProvider( createDefaultSVNOptions() );
Expand Down Expand Up @@ -2591,13 +2591,13 @@ private static final class Initializer {

// disable the connection pooling, which causes problems like
// http://www.nabble.com/SSH-connection-problems-p12028339.html
if(System.getProperty("lib.svnkit.ssh2.persistent")==null)
System.setProperty("lib.svnkit.ssh2.persistent","false");
if(System.getProperty("svnkit.ssh2.persistent")==null)
System.setProperty("svnkit.ssh2.persistent","false");

// push Negotiate to the end because it requires a valid Kerberos configuration.
// see HUDSON-8153
if(System.getProperty("lib.svnkit.http.methods")==null)
System.setProperty("lib.svnkit.http.methods","Digest,Basic,NTLM,Negotiate");
if(System.getProperty("svnkit.http.methods")==null)
System.setProperty("svnkit.http.methods","Digest,Basic,NTLM,Negotiate");

// use SVN1.4 compatible workspace by default.
SVNAdminAreaFactory.setSelector(new SubversionWorkspaceSelector());
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/hudson/scm/UserProvidedCredential.java
Expand Up @@ -178,7 +178,7 @@ public AuthenticationManagerImpl(TaskListener listener) {
public SVNAuthentication getFirstAuthentication(String kind, String realm, SVNURL url) throws SVNException {
authenticationAttempted = true;
if (kind.equals(ISVNAuthenticationManager.USERNAME))
// when using svn+ssh, lib.svnkit first asks for ISVNAuthenticationManager.SSH
// when using svn+ssh, svnkit first asks for ISVNAuthenticationManager.SSH
// authentication to connect via SSH, then calls this method one more time
// to get the user name. Perhaps svn takes user name on its own, separate
// from OS user name? In any case, we need to return the same user name.
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/hudson/scm/subversion/UpdateUpdater.java
Expand Up @@ -217,7 +217,7 @@ public List<External> perform() throws IOException, InterruptedException {

/**
* Retrieve nested SVNException.
* lib.svnkit use to hide the root cause within nested {@link SVNException}. Also, SVNException cause in many cases
* svnkit use to hide the root cause within nested {@link SVNException}. Also, SVNException cause in many cases
* is a {@link SVNErrorMessage}, that itself has a lower level SVNException as cause, and so on.
*/
private SVNException getNestedSVNException(Throwable e) {
Expand Down
61 changes: 30 additions & 31 deletions src/test/java/hudson/scm/SubversionSCMTest.java
Expand Up @@ -78,8 +78,8 @@
/**
* @author Kohsuke Kawaguchi
*/
// TODO: we're relying on no less than 3 external SVN repos for this test: svn.jenkins-ci.org, subversion.tigris.org and svn.codehaus.org
// while the 1st one is probably okay, we should look that we get rid of the other 2 dependencies
// TODO: we're relying on no less than 2 external SVN repos for this test: svn.jenkins-ci.org, subversion.tigris.org
// while the 1st one is probably okay, we should look that we get rid of the other dependency
@SuppressWarnings({"rawtypes","deprecation"})
public class SubversionSCMTest extends AbstractSubversionTest {

Expand Down Expand Up @@ -172,10 +172,10 @@ public void testHttpsCheckOut() throws Exception {
@Email("http://jenkins.361315.n4.nabble.com/Hudson-1-266-and-1-267-Subversion-authentication-broken-td375737.html")
public void testHttpCheckOut() throws Exception {
FreeStyleProject p = createFreeStyleProject();
p.setScm(new SubversionSCM("http://svn.codehaus.org/sxc/tags/sxc-0.5/sxc-core/src/test/java/com/envoisolutions/sxc/builder/"));
p.setScm(new SubversionSCM("https://svn.jenkins-ci.org/trunk/hudson/test-projects/trivial-maven/src/test/java/test/"));

FreeStyleBuild b = assertBuildStatusSuccess(p.scheduleBuild2(0, new Cause.UserIdCause()).get());
assertTrue(b.getWorkspace().child("Node.java").exists());
assertTrue(b.getWorkspace().child("AppTest.java").exists());
}

@Url("http://hudson.pastebin.com/m3ea34eea")
Expand Down Expand Up @@ -299,18 +299,17 @@ public void testRevisionParameter() throws Exception {
@Bug(22568)
public void testPollingWithDefaultParametersWithCurlyBraces() throws Exception {
FreeStyleProject p = createFreeStyleProject();

String url = "http://svn.codehaus.org/sxc/tags/sxc-0.5/sxc-core/src/test/java/com/envoisolutions/sxc/builder/";
p.setScm(new SubversionSCM("${REPO}" + url.substring(10)));
String var = url.substring(0, 10);
ParametersDefinitionProperty property = new ParametersDefinitionProperty(new StringParameterDefinition("REPO", var));
String repo = "https://svn.jenkins-ci.org/";
String path = "trunk/hudson/test-projects/trivial-ant/";
p.setScm(new SubversionSCM("${REPO}" + path));
ParametersDefinitionProperty property = new ParametersDefinitionProperty(new StringParameterDefinition("REPO", repo));
p.addProperty(property);

FreeStyleBuild b = p.scheduleBuild2(0, new Cause.UserIdCause(),
new ParametersAction(new StringParameterValue("REPO", var))).get();
new ParametersAction(new StringParameterValue("REPO", repo))).get();

assertBuildStatus(Result.SUCCESS,b);
assertTrue(b.getWorkspace().child("Node.java").exists());
assertTrue(b.getWorkspace().child("build.xml").exists());

// as a baseline, this shouldn't detect any change
TaskListener listener = createTaskListener();
Expand All @@ -322,17 +321,17 @@ public void testPollingWithDefaultParametersWithCurlyBraces() throws Exception {
public void testPollingWithDefaultParametersWithOutCurlyBraces() throws Exception {
FreeStyleProject p = createFreeStyleProject();

String url = "http://svn.codehaus.org/sxc/tags/sxc-0.5/sxc-core/src/test/java/com/envoisolutions/sxc/builder/";
p.setScm(new SubversionSCM("$REPO" + url.substring(10)));
String var = url.substring(0, 10);
ParametersDefinitionProperty property = new ParametersDefinitionProperty(new StringParameterDefinition("REPO", var));
String repo = "https://svn.jenkins-ci.org";
String path = "/trunk/hudson/test-projects/trivial-ant/";
p.setScm(new SubversionSCM("$REPO" + path));
ParametersDefinitionProperty property = new ParametersDefinitionProperty(new StringParameterDefinition("REPO", repo));
p.addProperty(property);

FreeStyleBuild b = p.scheduleBuild2(0, new Cause.UserIdCause(),
new ParametersAction(new StringParameterValue("REPO", var))).get();
new ParametersAction(new StringParameterValue("REPO", repo))).get();

assertBuildStatus(Result.SUCCESS,b);
assertTrue(b.getWorkspace().child("Node.java").exists());
assertTrue(b.getWorkspace().child("build.xml").exists());

// as a baseline, this shouldn't detect any change
TaskListener listener = createTaskListener();
Expand All @@ -344,17 +343,17 @@ public void testPollingWithDefaultParametersWithOutCurlyBraces() throws Exceptio
public void testPollingWithChoiceParametersWithOutCurlyBraces() throws Exception {
FreeStyleProject p = createFreeStyleProject();

String url = "http://svn.codehaus.org/sxc/tags/sxc-0.5/sxc-core/src/test/java/com/envoisolutions/sxc/builder/";
p.setScm(new SubversionSCM("${REPO}" + url.substring(10)));
String var = url.substring(0, 10);
ParametersDefinitionProperty property = new ParametersDefinitionProperty(new ChoiceParameterDefinition("REPO", new String[] {var, "test"}, ""));
String repo = "https://svn.jenkins-ci.org/";
String path = "trunk/hudson/test-projects/trivial-maven/src/test/java/test";
p.setScm(new SubversionSCM("${REPO}" + path));
ParametersDefinitionProperty property = new ParametersDefinitionProperty(new ChoiceParameterDefinition("REPO", new String[] {repo, "test"}, ""));
p.addProperty(property);

FreeStyleBuild b = p.scheduleBuild2(0, new Cause.UserIdCause(),
new ParametersAction(new StringParameterValue("REPO", var))).get();
new ParametersAction(new StringParameterValue("REPO", repo))).get();

assertBuildStatus(Result.SUCCESS,b);
assertTrue(b.getWorkspace().child("Node.java").exists());
assertTrue(b.getWorkspace().child("AppTest.java").exists());

// as a baseline, this shouldn't detect any change
TaskListener listener = createTaskListener();
Expand Down Expand Up @@ -550,24 +549,24 @@ public void testURLWithVariable() throws Exception {

// --- 1st case: URL with a variable ---

String url = "http://svn.codehaus.org/sxc/tags/sxc-0.5/sxc-core/src/test/java/com/envoisolutions/sxc/builder/";
p.setScm(new SubversionSCM("$REPO" + url.substring(10)));
String var = url.substring(0, 10);
String repo = "https://svn.jenkins-ci.org";
String path = "/trunk/hudson/test-projects/trivial-maven/src/test/java/test";
p.setScm(new SubversionSCM("$REPO" + path));

FreeStyleBuild b = p.scheduleBuild2(0, new Cause.UserIdCause(),
new ParametersAction(new StringParameterValue("REPO", var))).get();
new ParametersAction(new StringParameterValue("REPO", repo))).get();
System.out.println(b.getLog(LOG_LIMIT));
assertBuildStatus(Result.SUCCESS,b);
assertTrue(b.getWorkspace().child("Node.java").exists());
assertTrue(b.getWorkspace().child("AppTest.java").exists());

// --- 2nd case: URL with an empty variable ---

p.setScm(new SubversionSCM(url + "$EMPTY_VAR"));
p.setScm(new SubversionSCM(repo + path + "$EMPTY_VAR"));

b = p.scheduleBuild2(0, new Cause.UserIdCause(),
new ParametersAction(new StringParameterValue("EMPTY_VAR", ""))).get();
assertBuildStatus(Result.SUCCESS,b);
assertTrue(b.getWorkspace().child("Node.java").exists());
assertTrue(b.getWorkspace().child("AppTest.java").exists());
}

/**
Expand Down Expand Up @@ -783,7 +782,7 @@ private static String readFileAsString(File file)
@Bug(3904)
public void testSymbolicLinkCheckout() throws Exception {
// Only perform if symlink behavior is enabled
if (!"true".equals(System.getProperty("lib.svnkit.symlinks"))) {
if (!"true".equals(System.getProperty("svnkit.symlinks"))) {
return;
}

Expand Down

0 comments on commit ad260ce

Please sign in to comment.