From a9513c0ae85579d80f4227b4254523856206577a Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Tue, 17 Sep 2024 20:12:43 +1000 Subject: [PATCH] log to search for restart can be different depending on eexx Signed-off-by: Olivier Lamy --- .../tests/distribution/DisableUrlCacheTest.java | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/tests/test-distribution/test-distribution-common/src/test/java/org/eclipse/jetty/tests/distribution/DisableUrlCacheTest.java b/tests/test-distribution/test-distribution-common/src/test/java/org/eclipse/jetty/tests/distribution/DisableUrlCacheTest.java index ef42a1ff81b..02d13fcdd45 100644 --- a/tests/test-distribution/test-distribution-common/src/test/java/org/eclipse/jetty/tests/distribution/DisableUrlCacheTest.java +++ b/tests/test-distribution/test-distribution-common/src/test/java/org/eclipse/jetty/tests/distribution/DisableUrlCacheTest.java @@ -21,6 +21,7 @@ import java.nio.file.attribute.FileTime; import java.util.List; import java.util.Set; import java.util.concurrent.TimeUnit; +import java.util.stream.Stream; import org.eclipse.jetty.client.ContentResponse; import org.eclipse.jetty.http.HttpStatus; @@ -30,6 +31,8 @@ import org.eclipse.jetty.toolchain.test.FS; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.parallel.Isolated; import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; import org.junit.jupiter.params.provider.ValueSource; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -45,9 +48,17 @@ public class DisableUrlCacheTest extends AbstractJettyHomeTest { private static final Logger LOG = LoggerFactory.getLogger(DisableUrlCacheTest.class); + public static Stream tests() + { + return Stream.of( + Arguments.of("ee10", "Started oeje10w.WebAppContext@"), + Arguments.of("ee11", "Started oeje11w.WebAppContext@") + ); + } + @ParameterizedTest - @ValueSource(strings = {"ee10", "ee11"}) - public void testReloadWebAppWithLog4j2(String env) throws Exception + @MethodSource("tests") + public void testReloadWebAppWithLog4j2(String env, String logToSearch) throws Exception { Path jettyBase = newTestJettyBaseDirectory(); String jettyVersion = System.getProperty("jettyVersion"); @@ -124,7 +135,7 @@ public class DisableUrlCacheTest extends AbstractJettyHomeTest touch(warXmlPath); // Wait for reload to start context - assertTrue(run2.awaitConsoleLogsFor("Started oeje10w.WebAppContext@", START_TIMEOUT, TimeUnit.SECONDS)); + assertTrue(run2.awaitConsoleLogsFor(logToSearch, START_TIMEOUT, TimeUnit.SECONDS)); // wait for deployer node to complete so context is Started not Starting assertTrue(run2.awaitConsoleLogsFor("Executing Node Node[started]", START_TIMEOUT, TimeUnit.SECONDS));