Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Don't show broken image when no test results are available #7

Merged
merged 1 commit into from almost 2 years ago

2 participants

Carsten Pfeiffer Si Westcott
Carsten Pfeiffer

When a new Jenkins job is set up (or when otherwise no test results are available), the project page will show a broken image coming from the trend report.

Si Westcott swestcott merged commit 70e9bb1 into from May 18, 2012
Si Westcott swestcott closed this May 18, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

May 11, 2012
Carsten Pfeiffer Don't show broken image when no test results are available 9944959
This page is out of date. Refresh to see the latest.
10  src/main/java/hudson/plugins/fitnesse/FitnesseProjectAction.java
@@ -36,8 +36,18 @@ public String getUrlName() {
36 36
     /**
37 37
      * Used in floatingBox.jelly
38 38
      */
  39
+    public boolean hasTrend() {
  40
+    	return getLatestResults() != null;
  41
+    }
  42
+    
  43
+    /**
  44
+     * Used in floatingBox.jelly
  45
+     */
39 46
     public History getTrend() {
40 47
     	FitnesseResultsAction latestResults = getLatestResults();
  48
+    	if (latestResults == null) {
  49
+    		return null;
  50
+    	}
41 51
     	FitnesseResults result = latestResults.getResult();
42 52
 		return new History(result,500,200);
43 53
     }
3  src/main/resources/hudson/plugins/fitnesse/FitnesseProjectAction/floatingBox.jelly
... ...
@@ -1,10 +1,13 @@
1 1
 <j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler"
2 2
 	xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson"
3 3
 	xmlns:f="/lib/form" xmlns:i="jelly:fmt">
  4
+	
  5
+    <j:if test="${action.hasTrend()}">
4 6
       <div class="test-trend-caption">
5 7
         ${%FitNesse Results Trend}
6 8
       </div>
7 9
 	  <div>
8 10
         <img src="fitnesse/trend/countGraph/png" lazymap="fitnesse/trend/countGraph/map" alt="[FitNesse results trend chart]"/>
9 11
       </div>
  12
+    </j:if>
10 13
 </j:jelly>
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.