提交 27a720f9 编写于 作者: K kohsuke

Merged revisions 20720-20721,20736,20739-20741,20743,20747 via svnmerge from

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

........
  r20720 | kohsuke | 2009-08-14 13:43:55 -0700 (Fri, 14 Aug 2009) | 1 line
  
  linkout:out appear to be replaced by CaseResult.annotate
........
  r20721 | kohsuke | 2009-08-14 13:50:39 -0700 (Fri, 14 Aug 2009) | 1 line
  
  fixed tests
........
  r20736 | kohsuke | 2009-08-14 15:11:00 -0700 (Fri, 14 Aug 2009) | 1 line
  
  this is simpler.
........
  r20739 | kohsuke | 2009-08-14 17:07:25 -0700 (Fri, 14 Aug 2009) | 1 line
  
  adding the SCIS ad
........
  r20740 | kohsuke | 2009-08-14 19:21:50 -0700 (Fri, 14 Aug 2009) | 1 line
  
  ignore generated files
........
  r20741 | kohsuke | 2009-08-14 19:36:41 -0700 (Fri, 14 Aug 2009) | 1 line
  
  [maven-release-plugin] prepare release hudson-1_320
........
  r20743 | kohsuke | 2009-08-14 19:36:58 -0700 (Fri, 14 Aug 2009) | 1 line
  
  [maven-release-plugin] prepare for next development iteration
........
  r20747 | kohsuke | 2009-08-14 22:48:09 -0700 (Fri, 14 Aug 2009) | 1 line
  
  updated changelog as a part of the release
........


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@20799 71c3de6d-444a-0410-be80-ed276b4c234a
上级 f4655d9f
......@@ -4,7 +4,7 @@
<parent>
<artifactId>pom</artifactId>
<groupId>org.jvnet.hudson.main</groupId>
<version>1.320-SNAPSHOT</version>
<version>1.321-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.320-SNAPSHOT</version>
<version>1.321-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
......
/*
* The MIT License
*
* Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi
*
* 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.
*/
package hudson.util;
import org.apache.commons.jelly.JellyTagException;
import org.apache.commons.jelly.MissingAttributeException;
import org.apache.commons.jelly.TagSupport;
import org.apache.commons.jelly.XMLOutput;
import org.apache.commons.jelly.expression.Expression;
import org.kohsuke.stapler.jelly.OutTag;
import org.springframework.beans.factory.annotation.Required;
import org.xml.sax.SAXException;
/**
* Variant of {@linkplain OutTag <st:out>} that tries to hyperlink URLs.
*/
public class HyperlinkingOutTag extends TagSupport {
private Expression value;
@Required
public void setValue(Expression value) {
this.value = value;
}
public void doTag(XMLOutput output) throws MissingAttributeException, JellyTagException {
String text = value.evaluateAsString(context);
if (text != null) {
try {
output.write(text.
replace("&", "&amp;").
replace("<", "&lt;").
replaceAll("\\b(https?://[^\\s)>]+)", "<a href=\"$1\">$1</a>"));
} catch (SAXException e) {
throw new JellyTagException("could not write the XMLOutput", e);
}
}
}
}
......@@ -23,7 +23,7 @@ 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:lo="hudson:linkout">
xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form">
<l:layout title="${it.owner} test - ${it.displayName}">
<st:include page="sidepanel.jelly" />
<l:main-panel>
......@@ -70,7 +70,7 @@ THE SOFTWARE.
<h3>${%Error Message}</h3>
<pre>"${it.annotate(it.errorDetails)}</pre>
<h3>${%Stacktrace}</h3>
<pre><lo:out value="${it.annotate(it.errorStackTrace)}"/></pre>
<pre>${it.annotate(it.errorStackTrace)}</pre>
<j:if test="${!empty(it.stdout)}">
<h3>${%Standard Output}</h3>
......
......@@ -26,7 +26,7 @@ THE SOFTWARE.
Trend of test execution over time.
-->
<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:lo="hudson:linkout">
xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form">
<table class="pane sortable" id="testresult">
<tr>
<td class="pane-header" style="width:10em">${%Build}</td>
......
......@@ -24,7 +24,7 @@ THE SOFTWARE.
<!-- this is loaded on demand in the failed test results summary -->
<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:lo="hudson:linkout">
xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form">
<j:choose>
<j:when test="${it.errorDetails!=null}">
<h3>${%Error Details}</h3>
......
......@@ -23,7 +23,7 @@ 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:lo="hudson:linkout">
xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form">
<table class="pane sortable" id="testresult">
<tr>
<td class="pane-header">${%Build}</td>
......
......@@ -23,7 +23,7 @@ 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:lo="hudson:linkout">
xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form">
<table class="pane sortable" id="testresult">
<tr>
<td class="pane-header">${%Build}</td>
......
/*
* The MIT License
*
* Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi
*
* 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.
*/
package hudson.util;
import java.io.StringWriter;
import junit.framework.TestCase;
import org.apache.commons.jelly.XMLOutput;
import org.apache.commons.jelly.expression.ConstantExpression;
public class HyperlinkingOutTagTest extends TestCase {
public HyperlinkingOutTagTest(String name) {
super(name);
}
public void testPlain() throws Exception {
assertOutput("plain text", "plain text");
}
public void testOnItsOwnLine() throws Exception {
assertOutput("line #1\nhttp://nowhere.net/\nline #2\n",
"line #1\n<a href=\"http://nowhere.net/\">http://nowhere.net/</a>\nline #2\n");
}
public void testInline() throws Exception {
assertOutput("failed; see http://nowhere.net/",
"failed; see <a href=\"http://nowhere.net/\">http://nowhere.net/</a>");
assertOutput("failed (see http://nowhere.net/)",
"failed (see <a href=\"http://nowhere.net/\">http://nowhere.net/</a>)");
}
public void testMultipleLinks() throws Exception {
assertOutput("http://nowhere.net/ - failed: http://elsewhere.net/",
"<a href=\"http://nowhere.net/\">http://nowhere.net/</a> - failed: " +
"<a href=\"http://elsewhere.net/\">http://elsewhere.net/</a>");
}
public void testHttps() throws Exception {
assertOutput("https://nowhere.net/",
"<a href=\"https://nowhere.net/\">https://nowhere.net/</a>");
}
public void testMushedUp() throws Exception {
assertOutput("stuffhttp://nowhere.net/", "stuffhttp://nowhere.net/");
}
public void testEscapedMetaChars() throws Exception {
assertOutput("a < b && c < d", "a &lt; b &amp;&amp; c &lt; d");
}
public void testEscapedMetaCharsWithLinks() throws Exception {
assertOutput("see <http://nowhere.net/>",
"see &lt;<a href=\"http://nowhere.net/\">http://nowhere.net/</a>>");
assertOutput("http://google.com/?q=stuff&lang=en",
"<a href=\"http://google.com/?q=stuff&amp;lang=en\">http://google.com/?q=stuff&amp;lang=en</a>");
}
public void testPortNumber() throws Exception {
assertOutput("http://localhost:8080/stuff/",
"<a href=\"http://localhost:8080/stuff/\">http://localhost:8080/stuff/</a>");
}
private void assertOutput(String in, String out) throws Exception {
StringWriter w = new StringWriter();
XMLOutput xmlo = XMLOutput.createXMLOutput(w);
HyperlinkingOutTag tag = new HyperlinkingOutTag();
tag.setValue(new ConstantExpression(in));
tag.doTag(xmlo);
assertEquals(out, w.toString());
}
}
hudson (1.320) unstable; urgency=low
* See http://hudson.dev.java.net/changelog.html for more details.
-- Kohsuke Kawaguchi <kk@kohsuke.org> Fri, 14 Aug 2009 22:36:35 -0700
hudson (1.319) unstable; urgency=low
* See http://hudson.dev.java.net/changelog.html for more details.
......
......@@ -27,7 +27,7 @@ THE SOFTWARE.
<parent>
<groupId>org.jvnet.hudson.main</groupId>
<artifactId>pom</artifactId>
<version>1.320-SNAPSHOT</version>
<version>1.321-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.320-SNAPSHOT</version>
<version>1.321-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.320-SNAPSHOT</version>
<version>1.321-SNAPSHOT</version>
</parent>
<artifactId>maven-plugin</artifactId>
......
......@@ -33,7 +33,7 @@ THE SOFTWARE.
<groupId>org.jvnet.hudson.main</groupId>
<artifactId>pom</artifactId>
<version>1.320-SNAPSHOT</version>
<version>1.321-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Hudson main module</name>
......
......@@ -27,7 +27,7 @@ THE SOFTWARE.
<parent>
<groupId>org.jvnet.hudson.main</groupId>
<artifactId>pom</artifactId>
<version>1.320-SNAPSHOT</version>
<version>1.321-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.320-SNAPSHOT</version>
<version>1.321-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.jvnet.hudson.main</groupId>
......
......@@ -217,7 +217,7 @@ public abstract class HudsonTestCase extends TestCase {
hudson = newHudson();
hudson.setNoUsageStatistics(true); // collecting usage stats from tests are pointless.
hudson.setCrumbIssuer(((CrumbIssuerDescriptor<CrumbIssuer>)hudson.getDescriptor(TestCrumbIssuer.class)).newInstance(null,null));
hudson.setCrumbIssuer(new TestCrumbIssuer());
hudson.servletContext.setAttribute("app",hudson);
hudson.servletContext.setAttribute("version","?");
......
......@@ -23,15 +23,11 @@
*/
package hudson.tasks.junit;
import hudson.maven.MavenModuleSet;
import hudson.maven.MavenModuleSetBuild;
import static hudson.model.Result.UNSTABLE;
import hudson.model.FreeStyleProject;
import hudson.model.AbstractBuild;
import hudson.model.BuildListener;
import hudson.model.Result;
import hudson.model.FreeStyleBuild;
import hudson.tasks.test.AbstractTestResultAction;
import hudson.Launcher;
import org.jvnet.hudson.test.HudsonTestCase;
import org.jvnet.hudson.test.Email;
......@@ -78,5 +74,31 @@ public class CaseResultTest extends HudsonTestCase {
assertEquals("org.twia.vendor.VendorManagerTest",cr.getClassName());
assertEquals("testGetVendorFirmKeyForVendorRep",cr.getName());
// piggy back tests for annotate methods
assertOutput(cr,"plain text", "plain text");
assertOutput(cr,"line #1\nhttp://nowhere.net/\nline #2\n",
"line #1\n<a href=\"http://nowhere.net/\">http://nowhere.net/</a>\nline #2\n");
assertOutput(cr,"failed; see http://nowhere.net/",
"failed; see <a href=\"http://nowhere.net/\">http://nowhere.net/</a>");
assertOutput(cr,"failed (see http://nowhere.net/)",
"failed (see <a href=\"http://nowhere.net/\">http://nowhere.net/</a>)");
assertOutput(cr,"http://nowhere.net/ - failed: http://elsewhere.net/",
"<a href=\"http://nowhere.net/\">http://nowhere.net/</a> - failed: " +
"<a href=\"http://elsewhere.net/\">http://elsewhere.net/</a>");
assertOutput(cr,"https://nowhere.net/",
"<a href=\"https://nowhere.net/\">https://nowhere.net/</a>");
assertOutput(cr,"stuffhttp://nowhere.net/", "stuffhttp://nowhere.net/");
assertOutput(cr,"a < b && c < d", "a &lt; b &amp;&amp; c &lt; d");
assertOutput(cr,"see <http://nowhere.net/>",
"see &lt;<a href=\"http://nowhere.net/\">http://nowhere.net/</a>>");
assertOutput(cr,"http://google.com/?q=stuff&lang=en",
"<a href=\"http://google.com/?q=stuff&amp;lang=en\">http://google.com/?q=stuff&amp;lang=en</a>");
assertOutput(cr,"http://localhost:8080/stuff/",
"<a href=\"http://localhost:8080/stuff/\">http://localhost:8080/stuff/</a>");
}
private void assertOutput(CaseResult cr, String in, String out) throws Exception {
assertEquals(out, cr.annotate(in));
}
}
......@@ -122,8 +122,7 @@ public class JUnitResultArchiverTest extends HudsonTestCase {
}
private void testSetDescription(String url, TestObject object)
throws IOException, SAXException, Exception {
private void testSetDescription(String url, TestObject object) throws Exception {
HtmlPage page = new WebClient().goTo(url);
page.getAnchorByHref("editDescription").click();
......
......@@ -27,7 +27,7 @@ THE SOFTWARE.
<parent>
<groupId>org.jvnet.hudson.main</groupId>
<artifactId>pom</artifactId>
<version>1.320-SNAPSHOT</version>
<version>1.321-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
......@@ -113,6 +113,7 @@ THE SOFTWARE.
<resolveArtifact groupId="${project.groupId}" artifactId="maven-plugin" version="${project.version}" type="hpi" tofile="${basedir}/target/generated-resources/WEB-INF/plugins/maven-plugin.hpi" />
<resolveArtifact groupId="org.jvnet.hudson.plugins" artifactId="ssh-slaves" version="0.7" type="hpi" tofile="${basedir}/target/generated-resources/WEB-INF/plugins/ssh-slaves.hpi" />
<resolveArtifact groupId="org.jvnet.hudson.plugins" artifactId="subversion" version="1.4" type="hpi" tofile="${basedir}/target/generated-resources/WEB-INF/plugins/subversion.hpi" />
<resolveArtifact groupId="org.jvnet.hudson.plugins" artifactId="scis-ad" version="1.0" type="hpi" tofile="${basedir}/target/generated-resources/WEB-INF/plugins/scis-ad.hpi" />
</tasks>
</configuration>
</execution>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册