Skip to content

Commit

Permalink
[FIXED JENKINS-10450] Use 404 status code for noWorkspace.jelly.
Browse files Browse the repository at this point in the history
  • Loading branch information
jglick committed Oct 8, 2014
1 parent 434aece commit 0adf979
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
3 changes: 3 additions & 0 deletions changelog.html
Expand Up @@ -55,6 +55,9 @@
<!-- Record your changes in the trunk here. -->
<div id="trunk" style="display:none"><!--=TRUNK-BEGIN=-->
<ul class=image>
<li class=rfe>
Missing workspace page should use 404 status code.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-10450">issue 10450</a>)
<li class=bug>
Updated SSH Slaves plugin to 1.8.
</ul>
Expand Down
Expand Up @@ -25,6 +25,7 @@ THE SOFTWARE.
<!-- tell user that there's no workspace yet -->
<?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:f="/lib/form" xmlns:i="jelly:fmt">
<st:statusCode value="404"/>
<l:layout>
<st:include page="sidepanel.jelly" />
<l:main-panel>
Expand Down
13 changes: 13 additions & 0 deletions test/src/test/java/hudson/model/ProjectTest.java
Expand Up @@ -88,6 +88,7 @@

import org.junit.Ignore;
import org.jvnet.hudson.test.Bug;
import org.jvnet.hudson.test.Issue;

/**
*
Expand Down Expand Up @@ -202,6 +203,18 @@ public void testGetSomeBuildWithWorkspace() throws Exception{
p.getLastBuild().delete();
assertNull("Project should not have build with some workspace.", p.getSomeBuildWithWorkspace());
}

@Issue("JENKINS-10450")
@Test public void workspaceBrowsing() throws Exception {
FreeStyleProject p = j.createFreeStyleProject("project");
p.getBuildersList().add(new Shell("echo ahoj > some.log"));
j.buildAndAssertSuccess(p);
JenkinsRule.WebClient wc = j.createWebClient();
wc.goTo("job/project/ws/some.log", "text/plain");
wc.assertFails("job/project/ws/other.log", 404);
p.doDoWipeOutWorkspace();
wc.assertFails("job/project/ws/some.log", 404);
}

@Test
public void testGetQuietPeriod() throws IOException{
Expand Down

0 comments on commit 0adf979

Please sign in to comment.