|
11 | 11 | import java.nio.file.attribute.PosixFilePermissions; |
12 | 12 | import java.util.Comparator; |
13 | 13 | import java.util.List; |
| 14 | +import java.util.regex.Pattern; |
14 | 15 | import java.util.stream.Stream; |
15 | 16 | import org.junit.jupiter.api.AfterEach; |
16 | 17 | import org.junit.jupiter.api.BeforeEach; |
@@ -63,8 +64,13 @@ void testCrashUploaderInitializationSuccess(String target, String pidArg) |
63 | 64 | assertTrue(Files.exists(file), "File " + file + " should have been created"); |
64 | 65 | List<String> lines = Files.readAllLines(file); |
65 | 66 | assertFalse(lines.isEmpty(), "File " + file + " is expected to be non-empty"); |
| 67 | + // sanity check to see if no placeholders are left |
| 68 | + Pattern placeholder = Pattern.compile("![A-Z_]+!"); |
| 69 | + assertFalse(lines.stream().anyMatch(l -> placeholder.matcher(l).find())); |
66 | 70 | // sanity to check the crash log file was properly replaced in the script |
67 | 71 | assertTrue(lines.stream().anyMatch(l -> l.contains(hsErrFile))); |
| 72 | + // sanity to check the java home was properly captured |
| 73 | + assertTrue(lines.stream().anyMatch(l -> l.contains("java_home"))); |
68 | 74 | } |
69 | 75 |
|
70 | 76 | @Test |
@@ -96,6 +102,8 @@ void testOomeNotifierInitializationSuccess(String target) throws IOException { |
96 | 102 | assertFalse(lines.isEmpty(), "File " + file + " is expected to be non-empty"); |
97 | 103 | // sanity to check the placeholder was properly replaced |
98 | 104 | assertTrue(lines.stream().anyMatch(l -> !l.contains("!TAGS!"))); |
| 105 | + // sanity to check the java home was properly captured |
| 106 | + assertTrue(lines.stream().anyMatch(l -> l.contains("java_home"))); |
99 | 107 | } |
100 | 108 |
|
101 | 109 | @Test |
|
0 commit comments