Improved reliability of test
This commit is contained in:
parent
6b2425a23f
commit
d84de5d847
|
@ -14,12 +14,14 @@
|
||||||
package org.eclipse.jetty.ee10.webapp;
|
package org.eclipse.jetty.ee10.webapp;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.nio.file.Path;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
import org.eclipse.jetty.server.Server;
|
import org.eclipse.jetty.server.Server;
|
||||||
import org.eclipse.jetty.toolchain.test.MavenTestingUtils;
|
import org.eclipse.jetty.toolchain.test.MavenTestingUtils;
|
||||||
|
import org.eclipse.jetty.toolchain.test.jupiter.WorkDir;
|
||||||
import org.eclipse.jetty.util.resource.FileSystemPool;
|
import org.eclipse.jetty.util.resource.FileSystemPool;
|
||||||
import org.junit.jupiter.api.AfterEach;
|
import org.junit.jupiter.api.AfterEach;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
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.containsInAnyOrder;
|
||||||
import static org.hamcrest.Matchers.empty;
|
import static org.hamcrest.Matchers.empty;
|
||||||
import static org.hamcrest.Matchers.equalToIgnoringCase;
|
import static org.hamcrest.Matchers.equalToIgnoringCase;
|
||||||
import static org.hamcrest.Matchers.not;
|
|
||||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
|
|
||||||
public class StandardDescriptorProcessorTest
|
public class StandardDescriptorProcessorTest
|
||||||
|
@ -53,12 +54,13 @@ public class StandardDescriptorProcessorTest
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testVisitSessionConfig() throws Exception
|
public void testVisitSessionConfig(WorkDir workDir) throws Exception
|
||||||
{
|
{
|
||||||
File webXml = MavenTestingUtils.getTestResourceFile("web-session-config.xml");
|
File webXml = MavenTestingUtils.getTestResourceFile("web-session-config.xml");
|
||||||
WebAppContext wac = new WebAppContext();
|
WebAppContext wac = new WebAppContext();
|
||||||
wac.setServer(_server);
|
wac.setServer(_server);
|
||||||
wac.setBaseResource(MavenTestingUtils.getTargetTestingPath("testSessionConfig"));
|
Path docroot = workDir.getEmptyPathDir();
|
||||||
|
wac.setBaseResource(docroot);
|
||||||
wac.setDescriptor(webXml.toURI().toURL().toString());
|
wac.setDescriptor(webXml.toURI().toURL().toString());
|
||||||
wac.start();
|
wac.start();
|
||||||
assertEquals(54, TimeUnit.SECONDS.toMinutes(wac.getSessionHandler().getMaxInactiveInterval()));
|
assertEquals(54, TimeUnit.SECONDS.toMinutes(wac.getSessionHandler().getMaxInactiveInterval()));
|
||||||
|
|
Loading…
Reference in New Issue