From bee3b7c7d8d8c953c61496655c39d1ba20c2e320 Mon Sep 17 00:00:00 2001 From: Basil Crow Date: Fri, 13 Sep 2019 13:11:14 -0700 Subject: [PATCH] [JENKINS-59231] Improve test coverage on the RSS feature --- core/src/main/java/hudson/model/RSS.java | 6 ++++++ test/src/test/java/hudson/model/RSSTest.java | 6 ------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/core/src/main/java/hudson/model/RSS.java b/core/src/main/java/hudson/model/RSS.java index 71bd5753e3..1d4870d13c 100644 --- a/core/src/main/java/hudson/model/RSS.java +++ b/core/src/main/java/hudson/model/RSS.java @@ -82,6 +82,12 @@ public final class RSS { if(flavor==null) flavor="atom"; flavor = flavor.replace('/', '_'); // Don't allow path to any jelly + if (flavor.equals("atom")) { + rsp.setContentType("application/atom+xml; charset=UTF-8"); + } else { + rsp.setContentType("text/xml; charset=UTF-8"); + } + req.getView(Jenkins.get(),"/hudson/"+flavor+".jelly").forward(req,rsp); } } diff --git a/test/src/test/java/hudson/model/RSSTest.java b/test/src/test/java/hudson/model/RSSTest.java index 35341e1f1f..cf081b182f 100644 --- a/test/src/test/java/hudson/model/RSSTest.java +++ b/test/src/test/java/hudson/model/RSSTest.java @@ -42,10 +42,7 @@ public class RSSTest { @Rule public JenkinsRule j = new JenkinsRule(); - //TODO remove the @Ignore - // Seems the XML parser on the CI machine is different / more picky than the one on my machine, will be covered by JENKINS-59231 to improve the code coverage @Test - @Ignore("XML parser too picky on CI") @Issue("JENKINS-59167") public void absoluteURLsPresentInRSS_evenWithoutRootUrlSetup() throws Exception { XmlPage page = getRssPage(); @@ -76,10 +73,7 @@ public class RSSTest { } } - //TODO remove the @Ignore - // Seems the XML parser on the CI machine is different / more picky than the one on my machine, will be covered by JENKINS-59231 to improve the code coverage @Test - @Ignore("XML parser too picky on CI") @Issue("JENKINS-59167") public void absoluteURLsPresentInAtom_evenWithoutRootUrlSetup() throws Exception { XmlPage page = getAtomPage(); -- GitLab