Skip to content

CoverageHTMLReporter: Overwrite assets and handle NULL ProjectName #50

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 20, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions src/main/java/org/utplsql/api/reporter/CoverageHTMLReporter.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
import java.io.IOException;
import java.io.InputStream;
import java.net.URISyntaxException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.*;
import java.util.List;
import java.util.function.Consumer;

Expand All @@ -33,8 +31,15 @@ protected void setAttributes(Object[] attributes) {
super.setAttributes(attributes);

if ( attributes != null ) {
projectName = String.valueOf(attributes[3]);
assetsPath = String.valueOf(attributes[4]);
if ( attributes[3] != null )
projectName = String.valueOf(attributes[3]);
else
projectName = null;

if ( attributes[4] != null )
assetsPath = String.valueOf(attributes[4]);
else
assetsPath = null;
}
}

Expand Down Expand Up @@ -82,7 +87,7 @@ private static void copyFileFromClasspath( Path assetPath, Path targetDirectory,
try (InputStream is = CoverageHTMLReporter.class.getClassLoader()
.getResourceAsStream(assetPath.toString())
) {
Files.copy( is, targetAssetPath );
Files.copy( is, targetAssetPath, StandardCopyOption.REPLACE_EXISTING);
}
}

Expand Down