Skip to content

Commit

Permalink
Refactoring of a solution to avoid contention on resource JAR files.
Browse files Browse the repository at this point in the history
  • Loading branch information
wakaleo committed Oct 22, 2015
1 parent fe753a8 commit 13edac4
Showing 1 changed file with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import java.nio.file.Path;
import java.util.EnumSet;
import java.util.Map;
import java.util.concurrent.atomic.AtomicBoolean;

import static net.thucydides.core.reports.html.HtmlResourceCopier.copyHtmlResourcesFrom;

Expand Down Expand Up @@ -69,14 +68,9 @@ protected EnvironmentVariables getEnvironmentVariables() {
return environmentVariables;
}

private static AtomicBoolean alreadyCopied = new AtomicBoolean(false);

protected void copyResourcesToOutputDirectory() throws IOException {

if (!alreadyCopied.getAndSet(true)) {
updateResourceDirectoryFromSystemPropertyIfDefined();
copyHtmlResourcesFrom(getResourceDirectory()).to(getOutputDirectory());
}
updateResourceDirectoryFromSystemPropertyIfDefined();
copyHtmlResourcesFrom(getResourceDirectory()).to(getOutputDirectory());
}

protected void copyTestResultsToOutputDirectory() throws IOException {
Expand Down

0 comments on commit 13edac4

Please sign in to comment.