Improved reliability of test

This commit is contained in:
Joakim Erdfelt 2022-10-17 15:17:27 -05:00
parent 6b2425a23f
commit d84de5d847
No known key found for this signature in database
GPG Key ID: 2D0E1FB8FE4B68B4
1 changed files with 5 additions and 3 deletions

View File

@ -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()));