From 994495938d4e43262a161c79e2f4e200319b4cb7 Mon Sep 17 00:00:00 2001 From: Carsten Pfeiffer Date: Fri, 11 May 2012 16:25:46 +0200 Subject: [PATCH] Don't show broken image when no test results are available --- .../hudson/plugins/fitnesse/FitnesseProjectAction.java | 10 ++++++++++ .../fitnesse/FitnesseProjectAction/floatingBox.jelly | 3 +++ 2 files changed, 13 insertions(+) diff --git a/src/main/java/hudson/plugins/fitnesse/FitnesseProjectAction.java b/src/main/java/hudson/plugins/fitnesse/FitnesseProjectAction.java index 554db05..530abf2 100644 --- a/src/main/java/hudson/plugins/fitnesse/FitnesseProjectAction.java +++ b/src/main/java/hudson/plugins/fitnesse/FitnesseProjectAction.java @@ -33,11 +33,21 @@ public String getUrlName() { return "fitnesse"; } + /** + * Used in floatingBox.jelly + */ + public boolean hasTrend() { + return getLatestResults() != null; + } + /** * Used in floatingBox.jelly */ public History getTrend() { FitnesseResultsAction latestResults = getLatestResults(); + if (latestResults == null) { + return null; + } FitnesseResults result = latestResults.getResult(); return new History(result,500,200); } diff --git a/src/main/resources/hudson/plugins/fitnesse/FitnesseProjectAction/floatingBox.jelly b/src/main/resources/hudson/plugins/fitnesse/FitnesseProjectAction/floatingBox.jelly index c135134..a45561d 100644 --- a/src/main/resources/hudson/plugins/fitnesse/FitnesseProjectAction/floatingBox.jelly +++ b/src/main/resources/hudson/plugins/fitnesse/FitnesseProjectAction/floatingBox.jelly @@ -1,10 +1,13 @@ + +
${%FitNesse Results Trend}
[FitNesse results trend chart]
+
\ No newline at end of file