Merge remote-tracking branch 'origin/jetty-10.0.x' into jetty-11.0.x

This commit is contained in:
Jan Bartel 2021-06-10 21:27:05 +10:00
commit 3648b3916c
8 changed files with 0 additions and 134 deletions

View File

@ -49,7 +49,6 @@ import org.eclipse.jetty.util.IO;
import org.eclipse.jetty.util.security.Constraint;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.condition.DisabledOnJre;
import org.junit.jupiter.api.condition.JRE;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ArgumentsSource;
@ -60,10 +59,6 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;
// Apparently only JDK 11 is able to run these tests.
// See for example: https://bugs.openjdk.java.net/browse/JDK-8202439
// where apparently the compiler gets the AES CPU instructions wrong.
@DisabledOnJre({JRE.JAVA_8, JRE.JAVA_9, JRE.JAVA_10})
public class SPNEGOAuthenticationTest extends AbstractHttpClientServerTest
{
private static final Logger LOG = LoggerFactory.getLogger(SPNEGOAuthenticationTest.class);

View File

@ -47,7 +47,6 @@ import org.eclipse.jetty.util.IO;
import org.hamcrest.Matchers;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.DisabledIfSystemProperty;
import org.junit.jupiter.api.condition.DisabledOnJre;
import org.junit.jupiter.api.condition.JRE;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -1750,7 +1749,6 @@ public abstract class HttpServerTestBase extends HttpServerTestFixture
}
@Test
@DisabledOnJre({JRE.JAVA_8, JRE.JAVA_9, JRE.JAVA_10})
public void testShutdown() throws Exception
{
configureServer(new ReadExactHandler());
@ -1791,7 +1789,6 @@ public abstract class HttpServerTestBase extends HttpServerTestFixture
}
@Test
@DisabledOnJre({JRE.JAVA_8, JRE.JAVA_9, JRE.JAVA_10})
public void testChunkedShutdown() throws Exception
{
configureServer(new ReadExactHandler(4096));

View File

@ -34,14 +34,11 @@ import org.eclipse.jetty.util.resource.Resource;
import org.eclipse.jetty.util.ssl.SslContextFactory;
import org.hamcrest.Matchers;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.DisabledOnJre;
import org.junit.jupiter.api.condition.JRE;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.jupiter.api.Assertions.assertEquals;
// Only in JDK 11 is possible to use SSLSocket.shutdownOutput().
@DisabledOnJre({JRE.JAVA_8, JRE.JAVA_9, JRE.JAVA_10})
public class SSLReadEOFAfterResponseTest
{
@Test

View File

@ -22,7 +22,6 @@ import org.eclipse.jetty.toolchain.test.MavenTestingUtils;
import org.eclipse.jetty.util.MultiReleaseJarFile.VersionedJarEntry;
import org.hamcrest.Matchers;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.DisabledOnJre;
import org.junit.jupiter.api.condition.JRE;
import static org.hamcrest.MatcherAssert.assertThat;
@ -117,7 +116,6 @@ public class MultiReleaseJarFileTest
}
@Test
@DisabledOnJre(JRE.JAVA_8)
public void testClassLoaderJava9() throws Exception
{
try (URLClassLoader loader = new URLClassLoader(new URL[]{example.toURI().toURL()}))

View File

@ -19,8 +19,6 @@ import java.nio.file.Paths;
import org.eclipse.jetty.util.resource.Resource;
import org.hamcrest.Matchers;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.DisabledOnJre;
import org.junit.jupiter.api.condition.EnabledOnJre;
import org.junit.jupiter.api.condition.JRE;
import static org.hamcrest.MatcherAssert.assertThat;
@ -176,7 +174,6 @@ public class TypeUtilTest
}
@Test
@DisabledOnJre(JRE.JAVA_8)
public void testGetLocationJvmCoreJPMS()
{
// Class from JVM core
@ -185,29 +182,10 @@ public class TypeUtilTest
}
@Test
@DisabledOnJre(JRE.JAVA_8)
public void testGetLocationJavaLangThreadDeathJPMS()
{
// Class from JVM core
String expectedJavaBase = "/java.base";
assertThat(TypeUtil.getLocationOfClass(java.lang.ThreadDeath.class).toASCIIString(), containsString(expectedJavaBase));
}
@Test
@EnabledOnJre(JRE.JAVA_8)
public void testGetLocationJvmCoreJava8RT()
{
// Class from JVM core
String expectedJavaBase = "/rt.jar";
assertThat(TypeUtil.getLocationOfClass(String.class).toASCIIString(), containsString(expectedJavaBase));
}
@Test
@EnabledOnJre(JRE.JAVA_8)
public void testGetLocationJavaLangThreadDeathJava8RT()
{
// Class from JVM core
String expectedJavaBase = "/rt.jar";
assertThat(TypeUtil.getLocationOfClass(java.lang.ThreadDeath.class).toASCIIString(), containsString(expectedJavaBase));
}
}

View File

@ -18,9 +18,7 @@ import java.net.URI;
import org.eclipse.jetty.util.IO;
import org.eclipse.jetty.util.TypeUtil;
import org.hamcrest.Matchers;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.DisabledOnJre;
import org.junit.jupiter.api.condition.JRE;
import static org.hamcrest.MatcherAssert.assertThat;
@ -31,58 +29,6 @@ import static org.hamcrest.Matchers.startsWith;
public class JrtResourceTest
{
@Test
@DisabledOnJre(JRE.JAVA_8)
@Disabled("Not supported on Java 9+ Module API")
public void testResourceFromUriForString()
throws Exception
{
URI stringLoc = TypeUtil.getLocationOfClass(String.class);
Resource resource = Resource.newResource(stringLoc);
assertThat(resource.exists(), is(true));
assertThat(resource.isDirectory(), is(false));
assertThat(IO.readBytes(resource.getInputStream()).length, Matchers.greaterThan(0));
assertThat(IO.readBytes(resource.getInputStream()).length, is((int)resource.length()));
assertThat(resource.getWeakETag("-xxx"), startsWith("W/\""));
assertThat(resource.getWeakETag("-xxx"), endsWith("-xxx\""));
}
@Test
@DisabledOnJre(JRE.JAVA_8)
@Disabled("Not supported on Java 9+ Module API")
public void testResourceFromStringForString()
throws Exception
{
URI stringLoc = TypeUtil.getLocationOfClass(String.class);
Resource resource = Resource.newResource(stringLoc.toASCIIString());
assertThat(resource.exists(), is(true));
assertThat(resource.isDirectory(), is(false));
assertThat(IO.readBytes(resource.getInputStream()).length, Matchers.greaterThan(0));
assertThat(IO.readBytes(resource.getInputStream()).length, is((int)resource.length()));
assertThat(resource.getWeakETag("-xxx"), startsWith("W/\""));
assertThat(resource.getWeakETag("-xxx"), endsWith("-xxx\""));
}
@Test
@DisabledOnJre(JRE.JAVA_8)
@Disabled("Not supported on Java 9+ Module API")
public void testResourceFromURLForString()
throws Exception
{
URI stringLoc = TypeUtil.getLocationOfClass(String.class);
Resource resource = Resource.newResource(stringLoc.toURL());
assertThat(resource.exists(), is(true));
assertThat(resource.isDirectory(), is(false));
assertThat(IO.readBytes(resource.getInputStream()).length, Matchers.greaterThan(0));
assertThat(IO.readBytes(resource.getInputStream()).length, is((int)resource.length()));
assertThat(resource.getWeakETag("-xxx"), startsWith("W/\""));
assertThat(resource.getWeakETag("-xxx"), endsWith("-xxx\""));
}
@Test
@DisabledOnJre(JRE.JAVA_8)
public void testResourceModule()
throws Exception
{
@ -94,7 +40,6 @@ public class JrtResourceTest
}
@Test
@DisabledOnJre(JRE.JAVA_8)
public void testResourceAllModules()
throws Exception
{

View File

@ -25,7 +25,6 @@ import org.eclipse.jetty.webapp.ClassMatcher.Entry;
import org.hamcrest.Matchers;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.DisabledOnJre;
import org.junit.jupiter.api.condition.EnabledOnJre;
import org.junit.jupiter.api.condition.JRE;
@ -124,7 +123,6 @@ public class ClassMatcherTest
@SuppressWarnings("restriction")
@Test
@DisabledOnJre(JRE.JAVA_8)
public void testIncludedLocations() throws Exception
{
// jar from JVM classloader
@ -160,7 +158,6 @@ public class ClassMatcherTest
@SuppressWarnings("restriction")
@Test
@DisabledOnJre(JRE.JAVA_8)
public void testIncludedLocationsOrModule() throws Exception
{
// jar from JVM classloader
@ -199,44 +196,6 @@ public class ClassMatcherTest
@SuppressWarnings("restriction")
@Test
@EnabledOnJre(JRE.JAVA_8)
public void testExcludeLocations() throws Exception
{
// jar from JVM classloader
URI locString = TypeUtil.getLocationOfClass(String.class);
// System.err.println(locString);
// a jar from maven repo jar
URI locJunit = TypeUtil.getLocationOfClass(Test.class);
// System.err.println(locJunit);
// class file
URI locTest = TypeUtil.getLocationOfClass(ClassMatcherTest.class);
// System.err.println(locTest);
ClassMatcher pattern = new ClassMatcher();
// include everything
pattern.include(".");
assertThat(pattern.match(String.class), Matchers.is(true));
assertThat(pattern.match(Test.class), Matchers.is(true));
assertThat(pattern.match(ClassMatcherTest.class), Matchers.is(true));
// Add directory for both JVM classes
pattern.exclude(locString.toString());
// Add jar for individual class and classes directory
pattern.exclude(locJunit.toString(), locTest.toString());
assertThat(pattern.match(String.class), Matchers.is(false));
assertThat(pattern.match(Test.class), Matchers.is(false));
assertThat(pattern.match(ClassMatcherTest.class), Matchers.is(false));
}
@SuppressWarnings("restriction")
@Test
@DisabledOnJre(JRE.JAVA_8)
public void testExcludeLocationsOrModule() throws Exception
{
// jar from JVM classloader

View File

@ -186,7 +186,6 @@ public class DistributionTests extends AbstractJettyHomeTest
}
@Test
@DisabledOnJre(JRE.JAVA_8)
public void testSimpleWebAppWithJSPOnModulePath() throws Exception
{
String jettyVersion = System.getProperty("jettyVersion");
@ -226,14 +225,12 @@ public class DistributionTests extends AbstractJettyHomeTest
}
@Test
@DisabledOnJre(JRE.JAVA_8)
public void testSimpleWebAppWithJSPOverH2C() throws Exception
{
testSimpleWebAppWithJSPOverHTTP2(false);
}
@Test
@DisabledOnJre(JRE.JAVA_8)
public void testSimpleWebAppWithJSPOverH2() throws Exception
{
testSimpleWebAppWithJSPOverHTTP2(true);