提交 536f6a10 编写于 作者: K Kohsuke Kawaguchi

Merge branch 'master' of github.com:jenkinsci/jenkins

......@@ -261,7 +261,7 @@ public class CLI {
/**
* If the server advertises CLI endpoint, returns its location.
*/
private CliPort getCliTcpPort(String url) throws IOException {
protected CliPort getCliTcpPort(String url) throws IOException {
URL _url = new URL(url);
if (_url.getHost()==null || _url.getHost().length()==0) {
throw new IOException("Invalid URL: "+url);
......
......@@ -368,7 +368,7 @@ public abstract class AbstractItem extends Actionable implements Item, HttpDelet
/**
* Called right after when a {@link Item} is loaded from disk.
* This is an opporunity to do a post load processing.
* This is an opportunity to do a post load processing.
*/
public void onLoad(ItemGroup<? extends Item> parent, String name) throws IOException {
this.parent = parent;
......
......@@ -114,7 +114,7 @@ import org.kohsuke.accmod.restrictions.NoExternalUse;
* This is an extension point in Hudson, allowing different kind of
* rendering to be added as plugins.
*
* <h2>Note for implementors</h2>
* <h2>Note for implementers</h2>
* <ul>
* <li>
* {@link View} subtypes need the <tt>newViewDetail.jelly</tt> page,
......
......@@ -162,18 +162,19 @@ public class TestResultAction extends AbstractTestResultAction<TestResultAction>
public Object getTarget() {
return getResult();
}
public List<TestAction> getActions(TestObject object) {
List<TestAction> result = new ArrayList<TestAction>();
// Added check for null testData to avoid NPE from issue 4257.
if (testData!=null) {
for (Data data : testData) {
result.addAll(data.getTestAction(object));
List<TestAction> result = new ArrayList<TestAction>();
// Added check for null testData to avoid NPE from issue 4257.
if (testData != null) {
for (Data data : testData)
for (TestAction ta : data.getTestAction(object))
if (ta != null)
result.add(ta);
}
return Collections.unmodifiableList(result);
}
return Collections.unmodifiableList(result);
}
public void setData(List<Data> testData) {
this.testData = testData;
}
......
......@@ -34,15 +34,23 @@ THE SOFTWARE.
-->
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:s="/lib/form" xmlns:p="/lib/hudson/project">
<st:documentation>
Sets up the same 'global' variables that the l:layout tag does for content loaded by AJAX scripts.
<st:attribute name="contentType">
Content-type of the response page. This will be ignored if this tag is encountered while
evaluating a page that has called l:layout tag.
</st:attribute>
</st:documentation>
<j:choose>
<j:when test="${rootURL!=null}">
<!-- no envelope needed, since this is called during full HTML rendering. -->
<!-- no envelope needed, since this is called during full HTML rendering. Don't overwrite content-type either -->
<d:invokeBody/>
</j:when>
<j:otherwise>
<!-- called to generate partial HTML. set up HTML headers and etc -->
<!-- copied from layout.jelly -->
<st:contentType value="text/html;charset=UTF-8" />
<st:contentType value="${attrs.contentType?:'text/html;charset=UTF-8'}" />
<j:new var="h" className="hudson.Functions" /><!-- instead of JSP functions -->
${h.initPageVariables(context)}
<j:set var="ajax" value="true"/>
......
......@@ -181,6 +181,19 @@ public class CaseResultTest extends HudsonTestCase {
assertTrue("Should have found 0 elements, but found " + found, found == 0);
}
/**
* Makes sure the summary page remains text/plain (see commit 7089a81 in JENKINS-1544) but
* the index page must be in text/html.
*/
@Bug(21261)
public void testContentType() throws Exception {
configureTestBuild("foo");
WebClient wc = createWebClient();
wc.goTo("job/foo/1/testReport/org.twia.vendor/VendorManagerTest/testCreateAdjustingFirm/","text/html");
wc.goTo("job/foo/1/testReport/org.twia.vendor/VendorManagerTest/testCreateAdjustingFirm/summary","text/plain");
}
private FreeStyleBuild configureTestBuild(String projectName) throws Exception {
FreeStyleProject p = projectName == null ? createFreeStyleProject() : createFreeStyleProject(projectName);
p.getBuildersList().add(new TestBuilder() {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册