Skip to content

Commit

Permalink
Changelog and cleanup for [JENKINS-8334]
Browse files Browse the repository at this point in the history
Originally-Committed-As: 6b1cc47024172238a65d45f28db84f13495d8780
  • Loading branch information
kutzi committed Jan 19, 2013
1 parent fe8a9a7 commit 487579a
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/main/java/hudson/maven/reporters/SurefireArchiver.java
Expand Up @@ -114,7 +114,7 @@ public boolean preExecute(MavenBuildProxy build, MavenProject pom, MojoInfo mojo
}

public boolean postExecute(MavenBuildProxy build, MavenProject pom, MojoInfo mojo, final BuildListener listener, Throwable error) throws InterruptedException, IOException {
TestMojo testMojo = TestMojo.lookup(mojo);
TestMojo testMojo = getTestMojo(mojo);
if (testMojo == null) return true;

listener.getLogger().println(Messages.SurefireArchiver_Recording());
Expand Down Expand Up @@ -302,26 +302,29 @@ public Collection<? extends Action> getProjectActions(MavenModule module) {
}

boolean isTestMojo(MojoInfo mojo) {

return getTestMojo(mojo) != null;
}

private TestMojo getTestMojo(MojoInfo mojo) {
TestMojo testMojo = TestMojo.lookup(mojo);

if (testMojo == null)
return false;
return null;

try {
// most test plugins have at least on of the test-skip properties:
String[] skipProperties = {"skip", "skipExec", "skipTests", "skipTest"};
for (String skipProperty : skipProperties) {
Boolean skip = mojo.getConfigurationValue(skipProperty, Boolean.class);
if (((skip != null) && (skip))) {
return false;
return null;
}
}
} catch (ComponentConfigurationException e) {
return false;
return null;
}

return true;
return testMojo;
}

// I'm not sure if SurefireArchiver is actually ever (de-)serialized,
Expand Down

0 comments on commit 487579a

Please sign in to comment.