Permalink
Browse files

Merge branch 'master' of github.com:swestcott/fitnesse-plugin

  • Loading branch information...
2 parents 26a6cc4 + 47864bc commit b99852db05f5f2552494ae5e7b16d72eab82f852 @swestcott swestcott committed May 4, 2012
View
2 src/main/java/hudson/plugins/fitnesse/FitnesseResultsRecorder.java
@@ -71,6 +71,8 @@ public boolean perform(AbstractBuild<?, ?> build, Launcher launcher,
try {
FilePath[] resultFiles = getResultFiles(build);
FitnesseResults results = getResults(listener.getLogger(), resultFiles);
+ if (results == null) return true; // no Fitnesse results found at all
+
FitnesseResultsAction action = new FitnesseResultsAction(build, results);
if (results.getBuildResult() != null) build.setResult(results.getBuildResult());
build.addAction(action);
View
13 src/test/java/hudson/plugins/fitnesse/HudsonDependentTest.java
@@ -157,4 +157,17 @@ public void testBuildStartingFitnesseAndExplodingTheJarFile() throws Exception {
Assert.assertTrue(resultsAction.getResult().getPassCount() > 0);
Assert.assertEquals(2, resultsAction.getResult().getFailCount());
}
+
+ public void testBuildWithoutResults() throws Exception {
+ FreeStyleProject project = createFreeStyleProject(getName());
+ project.getBuildersList().clear();
+ project.getPublishersList().clear();
+ String resultsFile = "fitnesse-results-inexistant.xml";
+ project.getPublishersList().add(new FitnesseResultsRecorder(resultsFile));
+
+ FreeStyleBuild build = project.scheduleBuild2(0).get();
+ Assert.assertTrue(build.getLogFile().getAbsolutePath(), Result.SUCCESS.equals(build.getResult()));
+ FitnesseResultsAction resultsAction = build.getAction(FitnesseResultsAction.class);
+ Assert.assertNull(resultsAction);
+ }
}

0 comments on commit b99852d

Please sign in to comment.