Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[JENKINS-21723] Use relative links in trend graphs.
  • Loading branch information
uhafner committed Feb 4, 2015
1 parent 050c6da commit 85dfc48
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 14 deletions.
8 changes: 4 additions & 4 deletions src/test/java/plugins/AbstractAnalysisTest.java
Expand Up @@ -380,11 +380,11 @@ protected void assertXmlApiMatchesExpected(Build build, String apiUrl, String ex
/**
* Checks if the area links of jobs matches the regular expression.
*
* @param job Job to check the area links
* @param regularExpression Expression should match
* @param job job to check the area links
* @param plugin URL of the corresponding plug-in
*/
public void assertAreaLinksOfJobAreLike(Job job, String regularExpression) {
Pattern pattern = Pattern.compile(regularExpression);
public void assertAreaLinksOfJobAreLike(Job job, String plugin) {
Pattern pattern = Pattern.compile("^\\d+/" + plugin + "Result/(HIGH|NORMAL|LOW)");
for (String currentLink : job.getAreaLinks()) {
assertTrue("Link should be relative", pattern.matcher(currentLink).matches());
}
Expand Down
5 changes: 2 additions & 3 deletions src/test/java/plugins/CheckStylePluginTest.java
Expand Up @@ -22,7 +22,6 @@
import org.jenkinsci.test.acceptance.po.ListView;
import org.jenkinsci.test.acceptance.po.Node;
import org.jenkinsci.test.acceptance.po.PageObject;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.openqa.selenium.By;
Expand Down Expand Up @@ -219,14 +218,14 @@ private void assertThatPageContainsCheckstyleResults(final PageObject page) {
/**
* Runs job two times to check if the links of the graph are relative.
*/
@Test @Bug("21723") @Ignore("Until JENKINS-21723 is fixed")
@Test @Bug("21723")
public void view_checkstyle_report_job_graph_links() throws Exception {
FreeStyleJob job = createFreeStyleJob();
buildJobAndWait(job);
editJob(FILE_FOR_2ND_RUN, false, job);
buildJobWithSuccess(job);

assertAreaLinksOfJobAreLike(job, "^\\d+/checkstyleResult");
assertAreaLinksOfJobAreLike(job, "checkstyle");
}

/**
Expand Down
6 changes: 2 additions & 4 deletions src/test/java/plugins/FindbugsPluginTest.java
Expand Up @@ -24,7 +24,6 @@
package plugins;

import javax.xml.parsers.ParserConfigurationException;

import java.io.IOException;
import java.util.SortedMap;
import java.util.TreeMap;
Expand All @@ -45,7 +44,6 @@
import org.jenkinsci.test.acceptance.po.FreeStyleJob;
import org.jenkinsci.test.acceptance.po.ListView;
import org.jenkinsci.test.acceptance.po.Node;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.openqa.selenium.By;
Expand Down Expand Up @@ -191,14 +189,14 @@ public void record_analysis_two_runs() {
/**
* Runs job two times to check if the links of the graph are relative.
*/
@Test @Bug("21723") @Ignore("Until JENKINS-21723 is fixed")
@Test @Bug("21723")
public void view_findbugs_report_job_graph_links() {
FreeStyleJob job = setUpFindbugsFreestyleJob();
buildJobAndWait(job);
editJob("/findbugs_plugin/forSecondRun/findbugsXml.xml", false, job);
buildJobWithSuccess(job);

assertAreaLinksOfJobAreLike(job, "^\\d+/findbugsResult");
assertAreaLinksOfJobAreLike(job, "findbugs");
}

/**
Expand Down
5 changes: 2 additions & 3 deletions src/test/java/plugins/PmdPluginTest.java
Expand Up @@ -22,7 +22,6 @@
import org.jenkinsci.test.acceptance.po.ListView;
import org.jenkinsci.test.acceptance.po.Node;
import org.jenkinsci.test.acceptance.po.PageObject;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.openqa.selenium.By;
Expand Down Expand Up @@ -233,14 +232,14 @@ public void should_report_new_and_fixed_warnings_in_consecutive_builds() {
/**
* Runs job two times to check if the links of the graph are relative.
*/
@Test @Bug("21723") @Ignore("Until JENKINS-21723 is fixed")
@Test @Bug("21723")
public void view_pmd_report_job_graph_links() {
FreeStyleJob job = createFreeStyleJob();
buildJobAndWait(job);
editJob(PLUGIN_ROOT + "forSecondRun/pmd-warnings.xml", false, job);
buildJobWithSuccess(job);

assertAreaLinksOfJobAreLike(job, "^\\d+/pmdResult");
assertAreaLinksOfJobAreLike(job, "pmd");
}

/**
Expand Down

0 comments on commit 85dfc48

Please sign in to comment.