Skip to content

Commit

Permalink
Merge pull request #1453 from turkeylurkey/gen-1395r
Browse files Browse the repository at this point in the history
Add restartServerTest() to test generate-features.
  • Loading branch information
turkeylurkey authored Mar 21, 2022
2 parents c000a59 + 71f4c16 commit da1586b
Showing 1 changed file with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,20 @@ public void manualTestsInvocationTest() throws Exception {
assertTrue(verifyLogMessageExists("Unit tests finished.", 10000));
assertTrue(verifyLogMessageExists("Integration tests finished.", 2000));
}


@Test
public void restartServerTest() throws Exception {
int runningGenerateCount = countOccurrences(RUNNING_GENERATE_FEATURES, logFile);
String RESTARTED = "The server has been restarted.";
int restartedCount = countOccurrences(RESTARTED, logFile);
writer.write("r\n"); // command to restart liberty
writer.flush();

assertTrue(verifyLogMessageExists(RESTARTED, 20000, ++restartedCount));
// not supposed to rerun generate features just because of a server restart
assertTrue(verifyLogMessageExists(RUNNING_GENERATE_FEATURES, 2000, runningGenerateCount));
}

@Test
public void invalidDependencyTest() throws Exception {
// add invalid dependency to pom.xml
Expand Down

0 comments on commit da1586b

Please sign in to comment.