Skip to content

Commit

Permalink
Fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
HindujaB committed Oct 20, 2023
1 parent 4e80200 commit 9b20a22
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import java.util.List;

import static io.ballerina.runtime.profiler.util.Constants.OUT_STREAM;
import static io.ballerina.runtime.profiler.util.Constants.PERFORMANCE_JSON;

/**
* This class contains the JSON parser of the Ballerina profiler.
Expand Down Expand Up @@ -70,7 +71,7 @@ private int getTotalTime(JsonObject node) {

private void writePerformanceJson(String parsedJson) {
parsedJson = "var data = " + parsedJson;
try (FileWriter myWriter = new FileWriter("performance_report.json", StandardCharsets.UTF_8)) {
try (FileWriter myWriter = new FileWriter(PERFORMANCE_JSON, StandardCharsets.UTF_8)) {
myWriter.write(parsedJson);
myWriter.flush();
} catch (IOException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ public void testRunBalProjectWithProfileFlag() throws IOException {
Assert.assertTrue(htmlPath.toFile().exists());
try {
String htmlContent = Files.readString(htmlPath);
Assert.assertTrue(htmlContent.contains("foo/package_a/0/main.main()"));
Assert.assertTrue(htmlContent.contains("foo/package_a/0/$_init.$moduleExecute()"));
Assert.assertTrue(htmlContent.contains("foo/package_a/0/main.main"));
Assert.assertTrue(htmlContent.contains("foo/package_a/0/$_init.$moduleInit"));
} catch (IOException e) {
Assert.fail("Error reading html file");
}
Expand Down

0 comments on commit 9b20a22

Please sign in to comment.