Skip to content
This repository has been archived by the owner on Jan 20, 2019. It is now read-only.

Modified FileSystemResultsWriter.java #16

Merged
merged 2 commits into from
Jul 17, 2018

Conversation

AutomatedOwl
Copy link
Contributor

Changed OutputStream object to BufferedOutputStream in order to solve allure-framework/allure-java#197 .
Tested and verified.

Change OutputStream object to BufferedOutputStream in order to solve allure-framework/allure-java#197 .
Tested and verified.
@CLAassistant
Copy link

CLAassistant commented Jun 4, 2018

CLA assistant check
All committers have signed the CLA.

@@ -37,7 +36,7 @@ public void write(TestResult testResult) {
: generateTestResultName(testResult.getUuid());
createDirectories(outputDirectory);
Path file = outputDirectory.resolve(testResultName);
try (OutputStream os = Files.newOutputStream(file, CREATE_NEW)) {
try (OutputStream os = new BufferedOutputStream(new FileOutputStream(file.toString()))) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not using new BufferedOutputStream(Files.newOutputStream(file, CREATE_NEW)) ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I debugged both operations, the former causes the allure results exeception. It's reproduced here: https://github.com/AutomatedOwl/allure-testng-result-write-bug

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, let me check it

PS you need to add aspectjweaver dependency to maven surefire plugin in order to run it (I got no aspectjweaver:1.9.1 in my local maven repo, so build fails)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I guess we need to use blocking io, so your solution is fine. Please replace file.toString() with file.toFile() and update other methods write as well

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@baev changes done

Implemented FileOutputStream in second write method.
@AutomatedOwl
Copy link
Contributor Author

@baev thanks, what's missing now for it to be merged?

@baev
Copy link
Member

baev commented Jul 17, 2018

@AutomatedOwl waiting for Jenkins (will fix it myself)

BTW it would be so nice if you remove wildcard imports from your patch

@baev baev merged commit 51cb1bb into allure-framework:master Jul 17, 2018
@baev
Copy link
Member

baev commented Jul 17, 2018

@AutomatedOwl thanks!

@AutomatedOwl
Copy link
Contributor Author

@baev amazing, thanks! first commit but not the last :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants