From d84de5d847f8d524c0bbc34c408bd3fd3d818a43 Mon Sep 17 00:00:00 2001 From: Joakim Erdfelt Date: Mon, 17 Oct 2022 15:17:27 -0500 Subject: [PATCH] Improved reliability of test --- .../ee10/webapp/StandardDescriptorProcessorTest.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/jetty-ee10/jetty-ee10-webapp/src/test/java/org/eclipse/jetty/ee10/webapp/StandardDescriptorProcessorTest.java b/jetty-ee10/jetty-ee10-webapp/src/test/java/org/eclipse/jetty/ee10/webapp/StandardDescriptorProcessorTest.java index 801189d3e4b..9b3b25d2569 100644 --- a/jetty-ee10/jetty-ee10-webapp/src/test/java/org/eclipse/jetty/ee10/webapp/StandardDescriptorProcessorTest.java +++ b/jetty-ee10/jetty-ee10-webapp/src/test/java/org/eclipse/jetty/ee10/webapp/StandardDescriptorProcessorTest.java @@ -14,12 +14,14 @@ package org.eclipse.jetty.ee10.webapp; import java.io.File; +import java.nio.file.Path; import java.util.Arrays; import java.util.Map; import java.util.concurrent.TimeUnit; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.toolchain.test.MavenTestingUtils; +import org.eclipse.jetty.toolchain.test.jupiter.WorkDir; import org.eclipse.jetty.util.resource.FileSystemPool; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; @@ -29,7 +31,6 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsInAnyOrder; import static org.hamcrest.Matchers.empty; import static org.hamcrest.Matchers.equalToIgnoringCase; -import static org.hamcrest.Matchers.not; import static org.junit.jupiter.api.Assertions.assertEquals; public class StandardDescriptorProcessorTest @@ -53,12 +54,13 @@ public class StandardDescriptorProcessorTest } @Test - public void testVisitSessionConfig() throws Exception + public void testVisitSessionConfig(WorkDir workDir) throws Exception { File webXml = MavenTestingUtils.getTestResourceFile("web-session-config.xml"); WebAppContext wac = new WebAppContext(); wac.setServer(_server); - wac.setBaseResource(MavenTestingUtils.getTargetTestingPath("testSessionConfig")); + Path docroot = workDir.getEmptyPathDir(); + wac.setBaseResource(docroot); wac.setDescriptor(webXml.toURI().toURL().toString()); wac.start(); assertEquals(54, TimeUnit.SECONDS.toMinutes(wac.getSessionHandler().getMaxInactiveInterval()));