提交 8bf35b20 编写于 作者: K kohsuke

Merged revisions 27147,27149-27151,27153 via svnmerge from

https://svn.dev.java.net/svn/hudson/branches/rc

........
  r27147 | kohsuke | 2010-02-08 11:10:47 -0800 (Mon, 08 Feb 2010) | 1 line
  
  [FIXED HUDSON-5536] in 1.345 and added a test case.
........
  r27149 | kohsuke | 2010-02-08 12:01:18 -0800 (Mon, 08 Feb 2010) | 1 line
  
  added a backward compatibility measure to expose variables in both forms
........
  r27150 | kohsuke | 2010-02-08 12:02:19 -0800 (Mon, 08 Feb 2010) | 1 line
  
  forgot to commit this(?)
........
  r27151 | kohsuke | 2010-02-08 12:24:51 -0800 (Mon, 08 Feb 2010) | 1 line
  
  [maven-release-plugin] prepare release hudson-1_345
........
  r27153 | kohsuke | 2010-02-08 12:25:04 -0800 (Mon, 08 Feb 2010) | 1 line
  
  [maven-release-plugin] prepare for next development iteration
........


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@27154 71c3de6d-444a-0410-be80-ed276b4c234a
上级 207f4c58
......@@ -4,7 +4,7 @@
<parent>
<artifactId>pom</artifactId>
<groupId>org.jvnet.hudson.main</groupId>
<version>1.345-SNAPSHOT</version>
<version>1.346-SNAPSHOT</version>
</parent>
<artifactId>cli</artifactId>
<name>Hudson CLI</name>
......
......@@ -27,7 +27,7 @@ THE SOFTWARE.
<parent>
<groupId>org.jvnet.hudson.main</groupId>
<artifactId>pom</artifactId>
<version>1.345-SNAPSHOT</version>
<version>1.346-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
......
......@@ -27,6 +27,7 @@ import hudson.EnvVars;
import org.kohsuke.stapler.DataBoundConstructor;
import org.kohsuke.stapler.export.Exported;
import java.util.Locale;
import java.util.Map;
import hudson.util.VariableResolver;
......@@ -54,6 +55,7 @@ public class BooleanParameterValue extends ParameterValue {
@Override
public void buildEnvVars(AbstractBuild<?,?> build, EnvVars env) {
env.put(name,Boolean.toString(value));
env.put(name.toUpperCase(Locale.ENGLISH),Boolean.toString(value)); // backward compatibility pre 1.345
}
@Override
......
......@@ -26,6 +26,7 @@ package hudson.model;
import hudson.EnvVars;
import org.kohsuke.stapler.DataBoundConstructor;
import java.util.Locale;
import java.util.Map;
public class JobParameterValue extends ParameterValue {
......@@ -44,5 +45,6 @@ public class JobParameterValue extends ParameterValue {
public void buildEnvVars(AbstractBuild<?,?> build, EnvVars env) {
// TODO: check with Tom if this is really what he had in mind
env.put(name,job.toString());
env.put(name.toUpperCase(Locale.ENGLISH),job.toString()); // backward compatibility pre 1.345
}
}
......@@ -28,6 +28,8 @@ import hudson.util.Secret;
import hudson.util.VariableResolver;
import org.kohsuke.stapler.DataBoundConstructor;
import java.util.Locale;
/**
* @author Kohsuke Kawaguchi
*/
......@@ -48,7 +50,9 @@ public class PasswordParameterValue extends ParameterValue {
@Override
public void buildEnvVars(AbstractBuild<?,?> build, EnvVars env) {
env.put(name, value != null ? value.toString() : null);
String v = value != null ? value.toString() : null;
env.put(name, v);
env.put(name.toUpperCase(Locale.ENGLISH),v); // backward compatibility pre 1.345
}
@Override
......
......@@ -23,6 +23,7 @@
*/
package hudson.model;
import java.util.Locale;
import java.util.Map;
import hudson.EnvVars;
......@@ -68,7 +69,10 @@ public class RunParameterValue extends ParameterValue {
*/
@Override
public void buildEnvVars(AbstractBuild<?,?> build, EnvVars env) {
env.put(name, Hudson.getInstance().getRootUrl() + getRun().getUrl());
String value = Hudson.getInstance().getRootUrl() + getRun().getUrl();
env.put(name, value);
env.put(name.toUpperCase(Locale.ENGLISH),value); // backward compatibility pre 1.345
}
@Override
......
......@@ -27,6 +27,7 @@ import hudson.EnvVars;
import org.kohsuke.stapler.DataBoundConstructor;
import org.kohsuke.stapler.export.Exported;
import java.util.Locale;
import java.util.Map;
import hudson.util.VariableResolver;
......@@ -54,6 +55,7 @@ public class StringParameterValue extends ParameterValue {
@Override
public void buildEnvVars(AbstractBuild<?,?> build, EnvVars env) {
env.put(name,value);
env.put(name.toUpperCase(Locale.ENGLISH),value); // backward compatibility pre 1.345
}
@Override
......
......@@ -27,7 +27,7 @@ THE SOFTWARE.
<parent>
<groupId>org.jvnet.hudson.main</groupId>
<artifactId>pom</artifactId>
<version>1.345-SNAPSHOT</version>
<version>1.346-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
......
......@@ -27,7 +27,7 @@ THE SOFTWARE.
<parent>
<groupId>org.jvnet.hudson.main</groupId>
<artifactId>pom</artifactId>
<version>1.345-SNAPSHOT</version>
<version>1.346-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
......
......@@ -27,7 +27,7 @@ THE SOFTWARE.
<parent>
<groupId>org.jvnet.hudson.main</groupId>
<artifactId>pom</artifactId>
<version>1.345-SNAPSHOT</version>
<version>1.346-SNAPSHOT</version>
</parent>
<artifactId>maven-plugin</artifactId>
......
......@@ -33,7 +33,7 @@ THE SOFTWARE.
<groupId>org.jvnet.hudson.main</groupId>
<artifactId>pom</artifactId>
<version>1.345-SNAPSHOT</version>
<version>1.346-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Hudson main module</name>
......
......@@ -49,7 +49,7 @@ mv hudson_${ver}_all.deb binary
sudo apt-get install apt-utils
apt-ftparchive packages binary | tee binary/Packages | gzip -9c > binary/Packages.gz
apt-ftparchive contents binary | gzip -9c > binary/Contents.gz
apt-ftparchive -c debian/release.conf release binary > binary/Release
apt-ftparchive -c main/debian/release.conf release binary > binary/Release
# sign the release file
rm binary/Release.gpg || true
gpg --no-use-agent --passphrase-file ~/.gpg.passphrase -abs -o binary/Release.gpg binary/Release
......
......@@ -27,7 +27,7 @@ THE SOFTWARE.
<parent>
<groupId>org.jvnet.hudson.main</groupId>
<artifactId>pom</artifactId>
<version>1.345-SNAPSHOT</version>
<version>1.346-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
......
......@@ -27,7 +27,7 @@ THE SOFTWARE.
<parent>
<artifactId>pom</artifactId>
<groupId>org.jvnet.hudson.main</groupId>
<version>1.345-SNAPSHOT</version>
<version>1.346-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.jvnet.hudson.main</groupId>
......
......@@ -156,7 +156,7 @@ import java.util.concurrent.CountDownLatch;
/**
* Base class for all Hudson test cases.
*
* @see <a href="http://wiki.hudson-ci.org/wiki/display/HUDSON/Unit+Test">Wiki article about unit testing in Hudson</a>
* @see <a href="http://wiki.hudson-ci.org/display/HUDSON/Unit+Test">Wiki article about unit testing in Hudson</a>
* @author Kohsuke Kawaguchi
*/
public abstract class HudsonTestCase extends TestCase implements RootAction {
......
package hudson.model;
import hudson.model.DownloadService.Downloadable;
import net.sf.json.JSONObject;
import org.jvnet.hudson.test.Bug;
import org.jvnet.hudson.test.HudsonTestCase;
import org.kohsuke.stapler.StaplerResponse;
import java.io.IOException;
/**
* @author Kohsuke Kawaguchi
*/
public class DownloadServiceTest extends HudsonTestCase {
private Downloadable job;
/**
* Makes sure that JavaScript on the client side for handling submission works.
*/
@Override
protected void setUp() throws Exception {
super.setUp();
// this object receives the submission.
// to bypass the URL restriction, we'll trigger downloadService.download ourselves
job = new Downloadable("test", "UNUSED");
Downloadable.all().add(job);
}
@Override
protected void tearDown() throws Exception {
Downloadable.all().remove(job);
super.tearDown();
}
@Bug(5536)
public void testPost() throws Exception {
assertNull(job.getData());
createWebClient().goTo("/self/testPost");
JSONObject d = job.getData();
assertEquals(hashCode(),d.getInt("hello"));
}
/**
* This is where the browser should hit to retrieve data.
*/
public void doData(StaplerResponse rsp) throws IOException {
rsp.setContentType("application/javascript");
rsp.getWriter().println("downloadService.post('test',{'hello':"+hashCode()+"})");
}
}
<!--
The MIT License
Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi, Matthew R. Harrah, Tom Huybrechts, id:cactusman
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-->
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form" xmlns:i="jelly:fmt">
<l:layout title="test">
<l:main-panel>
<script>
downloadService.download("test","${rootURL}/self/data",{},"/descriptor/hudson.model.DownloadService/byId/test/postBack",null);
</script>
</l:main-panel>
</l:layout>
</j:jelly>
\ No newline at end of file
......@@ -27,7 +27,7 @@ THE SOFTWARE.
<parent>
<groupId>org.jvnet.hudson.main</groupId>
<artifactId>pom</artifactId>
<version>1.345-SNAPSHOT</version>
<version>1.346-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
......
......@@ -2,7 +2,5 @@
The name of the parameter
<p>
Note that when this field is exposed as an environment variable, the name
will be always in upper case (e.g., the parameter "foo" would be exposed
as "FOO"). In Ant for example you access it by typing in ${env.FOO}
These parameters are exposed to build as environment variables.
</div>
\ No newline at end of file
......@@ -44,6 +44,7 @@ var crumb = {
value: null,
init: function(crumbField, crumbValue) {
if (crumbField=="") return; // layout.jelly passes in "" whereas it means null.
this.fieldName = crumbField;
this.value = crumbValue;
},
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册