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

This commit is contained in:
Joakim Erdfelt 2021-02-18 16:09:32 -06:00
commit 399e64875e
No known key found for this signature in database
GPG Key ID: 2D0E1FB8FE4B68B4
4 changed files with 23 additions and 14 deletions

View File

@ -1,12 +0,0 @@
# DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html
[description]
Enables test setup
[depend]
http
[xml]
etc/test-jetty.xml

View File

@ -1528,10 +1528,14 @@ public class StartArgs
{
JavaVersion ver = JavaVersion.parse(value);
properties.setProperty("java.version.platform", Integer.toString(ver.getPlatform()), source);
// @deprecated - below will be removed in Jetty 10.x
properties.setProperty("java.version.major", Integer.toString(ver.getMajor()), "Deprecated");
properties.setProperty("java.version.minor", Integer.toString(ver.getMinor()), "Deprecated");
properties.setProperty("java.version.micro", Integer.toString(ver.getMicro()), "Deprecated");
// ALPN feature exists
properties.setProperty("runtime.feature.alpn", Boolean.toString(isMethodAvailable(javax.net.ssl.SSLParameters.class, "getApplicationProtocols", null)), source);
}
catch (Throwable x)
{
@ -1548,6 +1552,19 @@ public class StartArgs
}
}
private boolean isMethodAvailable(Class<?> clazz, String methodName, Class<?>[] params)
{
try
{
clazz.getMethod(methodName, params);
return true;
}
catch (NoSuchMethodException e)
{
return false;
}
}
public void setRun(boolean run)
{
this.run = run;

View File

@ -138,6 +138,7 @@ public class ConfigurationAssert
"jetty.base.uri".equals(name) ||
"user.dir".equals(name) ||
prop.source.equals(Props.ORIGIN_SYSPROP) ||
name.startsWith("runtime.feature.") ||
name.startsWith("java."))
{
// strip these out from assertion, to make assertions easier.

View File

@ -220,8 +220,11 @@ public class MainTest
{
Path distPath = MavenTestingUtils.getTestResourceDir("dist-home").toPath().toRealPath();
Path homePath = MavenTestingUtils.getTargetTestingPath().resolve("dist home with spaces");
IO.copy(distPath.toFile(), homePath.toFile());
Files.createFile(homePath.resolve("lib/a library.jar"));
if (!Files.exists(homePath))
{
IO.copy(distPath.toFile(), homePath.toFile());
Files.createFile(homePath.resolve("lib/a library.jar"));
}
List<String> cmdLineArgs = new ArrayList<>();
cmdLineArgs.add("user.dir=" + homePath);