Skip to content

Commit 7d2f32c

Browse files
committed
Clean file formatting
1 parent f961bc3 commit 7d2f32c

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

components/context/src/test/java/datadog/context/InsertSourceFileExtension.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,14 @@ public void executionFinished(
3030
// get mapping of test classname to source file
3131
Map<String, String> sourceFiles = GatherSourceFileInfoExtension.getSourceFiles();
3232

33+
String filePath = Paths.get("").toAbsolutePath() + "/build/test-results/test/";
34+
3335
// for each test...
3436
for (String sourceFile : sourceFiles.keySet()) {
35-
// get xml report file
36-
String filePath =
37-
Paths.get("").toAbsolutePath() + "/build/test-results/test/TEST-" + sourceFile + ".xml";
3837
try {
39-
String fileContent = new String(Files.readAllBytes(Paths.get(filePath)));
38+
// get xml report file
39+
String fileContent =
40+
new String(Files.readAllBytes(Paths.get(filePath + "TEST-" + sourceFile + ".xml")));
4041

4142
// add test source file info to report
4243
Pattern pattern = Pattern.compile("<testcase(.*?)classname=\"(.*?)\"(.*?)>");
@@ -62,9 +63,8 @@ public void executionFinished(
6263
matcher.appendTail(result);
6364

6465
// set old filePath to new xml result
65-
// this logic must be wrong or go elsewhere bc its getting overwritten. `result` output
66-
// seems correct.
67-
BufferedWriter writer = new BufferedWriter(new FileWriter(filePath));
66+
BufferedWriter writer =
67+
new BufferedWriter(new FileWriter(filePath + "MOD-" + sourceFile + ".xml"));
6868
writer.write(result.toString());
6969
writer.close();
7070
} catch (Exception e) {

0 commit comments

Comments
 (0)