Skip to content

Commit

Permalink
Simplify DevWatchTest to avoid random windows failure
Browse files Browse the repository at this point in the history
  • Loading branch information
jfdenise committed Jun 21, 2024
1 parent 074ee56 commit 0ba335f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,8 @@ public void run() {

@Override
public void shutdownServer() throws Exception {
super.shutdownServerAsync();
// Do not initiate shutdown, when the mvn process will exit, shutdown hook will shutdown any running server
//super.shutdownServerAsync();

if (process != null) {
if (retCode != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,20 @@ public void testDevWatchWeb() throws Exception {
assertTrue(pollBodyContent(url, expectedNewContent));

Thread.sleep(3000);
// Update Java file and check that previous resources update is reflected
// Update Java file and check that resources update is reflected
String testMsg2 = " The test2!";
props.setProperty("msg", testMsg2);
try (FileOutputStream output = new FileOutputStream(resourcesFile.toFile())) {
props.store(output, null);
}
Thread.sleep(3000);
javaFile = getTestDir().resolve("src").resolve("main").resolve("java").
resolve("org").resolve("wildfly").resolve("plugins").resolve("demo").resolve("jaxrs").resolve("HelloWorldEndpoint.java");
str = new String(Files.readAllBytes(javaFile), "UTF-8");
radical = "Hi guys ";
patchedRadical = "FOOFOO ";
str = str.replace(radical, patchedRadical);
expectedNewContent = patchedRadical + testMsg;
expectedNewContent = patchedRadical + testMsg2;
Files.write(javaFile, str.getBytes());

assertTrue(pollBodyContent(url, expectedNewContent));
Expand Down

0 comments on commit 0ba335f

Please sign in to comment.