update to netty 4.1.108, add empty settings, add settings loader to server tests
This commit is contained in:
parent
f7ce68bada
commit
09b30ad7b6
17 changed files with 76 additions and 30 deletions
|
@ -1,3 +1,3 @@
|
||||||
group = org.xbib
|
group = org.xbib
|
||||||
name = net-http
|
name = net-http
|
||||||
version = 4.4.1
|
version = 4.4.2
|
||||||
|
|
|
@ -3,6 +3,7 @@ dependencies {
|
||||||
api libs.net.security
|
api libs.net.security
|
||||||
testImplementation project(':net-http-client-netty-secure')
|
testImplementation project(':net-http-client-netty-secure')
|
||||||
testImplementation project(':net-http-netty-boringssl')
|
testImplementation project(':net-http-netty-boringssl')
|
||||||
|
testImplementation libs.settings.datastructures.json
|
||||||
testImplementation libs.net.bouncycastle
|
testImplementation libs.net.bouncycastle
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,13 @@
|
||||||
import org.xbib.net.http.server.netty.HttpChannelInitializer;
|
import org.xbib.net.http.server.netty.HttpChannelInitializer;
|
||||||
import org.xbib.net.security.CertificateProvider;
|
import org.xbib.net.security.CertificateProvider;
|
||||||
import org.xbib.net.http.server.netty.ServerTransportProvider;
|
import org.xbib.net.http.server.netty.ServerTransportProvider;
|
||||||
|
import org.xbib.settings.SettingsLoader;
|
||||||
|
|
||||||
module org.xbib.net.http.server.netty.secure.test {
|
module org.xbib.net.http.server.netty.secure.test {
|
||||||
requires transitive org.junit.jupiter.api;
|
requires transitive org.junit.jupiter.api;
|
||||||
requires io.netty.transport;
|
requires io.netty.transport;
|
||||||
requires io.netty.common;
|
requires io.netty.common;
|
||||||
|
requires org.xbib.settings.datastructures;
|
||||||
requires org.xbib.net;
|
requires org.xbib.net;
|
||||||
requires org.xbib.net.http;
|
requires org.xbib.net.http;
|
||||||
requires org.xbib.net.http.server;
|
requires org.xbib.net.http.server;
|
||||||
|
@ -19,6 +21,7 @@ module org.xbib.net.http.server.netty.secure.test {
|
||||||
requires org.xbib.net.bouncycastle;
|
requires org.xbib.net.bouncycastle;
|
||||||
exports org.xbib.net.http.server.netty.secure.test;
|
exports org.xbib.net.http.server.netty.secure.test;
|
||||||
opens org.xbib.net.http.server.netty.secure.test;
|
opens org.xbib.net.http.server.netty.secure.test;
|
||||||
|
uses SettingsLoader;
|
||||||
uses HttpChannelInitializer;
|
uses HttpChannelInitializer;
|
||||||
uses ServerTransportProvider;
|
uses ServerTransportProvider;
|
||||||
uses CertificateProvider;
|
uses CertificateProvider;
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
org.xbib.settings.datastructures.json.JsonSettingsLoader
|
|
@ -3,6 +3,7 @@ dependencies {
|
||||||
api libs.netty.codec.http2
|
api libs.netty.codec.http2
|
||||||
testImplementation project(':net-http-client-netty')
|
testImplementation project(':net-http-client-netty')
|
||||||
testImplementation project(':net-http-template-groovy')
|
testImplementation project(':net-http-template-groovy')
|
||||||
|
testImplementation libs.settings.datastructures.json
|
||||||
testImplementation libs.datastructures.json.tiny
|
testImplementation libs.datastructures.json.tiny
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,14 @@
|
||||||
|
import org.xbib.net.http.server.netty.HttpChannelInitializer;
|
||||||
|
import org.xbib.net.http.server.netty.ServerTransportProvider;
|
||||||
|
import org.xbib.settings.SettingsLoader;
|
||||||
|
|
||||||
module org.xbib.net.http.server.netty.test {
|
module org.xbib.net.http.server.netty.test {
|
||||||
requires transitive org.junit.jupiter.api;
|
requires transitive org.junit.jupiter.api;
|
||||||
requires io.netty.transport;
|
requires io.netty.transport;
|
||||||
requires io.netty.common;
|
requires io.netty.common;
|
||||||
requires org.xbib.datastructures.api;
|
requires org.xbib.datastructures.api;
|
||||||
requires org.xbib.datastructures.json.tiny;
|
requires org.xbib.datastructures.json.tiny;
|
||||||
|
requires org.xbib.settings.datastructures;
|
||||||
requires org.xbib.net;
|
requires org.xbib.net;
|
||||||
requires org.xbib.net.http;
|
requires org.xbib.net.http;
|
||||||
requires org.xbib.net.http.server;
|
requires org.xbib.net.http.server;
|
||||||
|
@ -16,4 +21,7 @@ module org.xbib.net.http.server.netty.test {
|
||||||
opens org.xbib.net.http.server.netty.test;
|
opens org.xbib.net.http.server.netty.test;
|
||||||
opens org.xbib.net.http.server.netty.test.pipelining;
|
opens org.xbib.net.http.server.netty.test.pipelining;
|
||||||
opens org.xbib.net.http.server.netty.test.simple;
|
opens org.xbib.net.http.server.netty.test.simple;
|
||||||
|
uses SettingsLoader;
|
||||||
|
uses HttpChannelInitializer;
|
||||||
|
uses ServerTransportProvider;
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
org.xbib.settings.datastructures.json.JsonSettingsLoader
|
|
@ -1,6 +1,7 @@
|
||||||
dependencies {
|
dependencies {
|
||||||
api project(':net-http-server-simple')
|
api project(':net-http-server-simple')
|
||||||
api libs.net.security
|
api libs.net.security
|
||||||
|
testImplementation libs.settings.datastructures.json
|
||||||
testImplementation libs.net.bouncycastle
|
testImplementation libs.net.bouncycastle
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
|
import org.xbib.settings.SettingsLoader;
|
||||||
|
|
||||||
module org.xbib.net.http.server.simple.secure.test {
|
module org.xbib.net.http.server.simple.secure.test {
|
||||||
requires transitive org.junit.jupiter.api;
|
requires transitive org.junit.jupiter.api;
|
||||||
|
requires org.xbib.settings.datastructures;
|
||||||
requires org.xbib.net;
|
requires org.xbib.net;
|
||||||
requires org.xbib.net.http;
|
requires org.xbib.net.http;
|
||||||
requires org.xbib.net.http.server;
|
requires org.xbib.net.http.server;
|
||||||
|
@ -9,4 +12,5 @@ module org.xbib.net.http.server.simple.secure.test {
|
||||||
uses org.xbib.net.security.CertificateProvider;
|
uses org.xbib.net.security.CertificateProvider;
|
||||||
exports org.xbib.net.http.server.simple.secure.test;
|
exports org.xbib.net.http.server.simple.secure.test;
|
||||||
opens org.xbib.net.http.server.simple.secure.test;
|
opens org.xbib.net.http.server.simple.secure.test;
|
||||||
|
uses SettingsLoader;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
dependencies {
|
dependencies {
|
||||||
api project(':net-http-server')
|
api project(':net-http-server')
|
||||||
|
testImplementation libs.settings.datastructures.json
|
||||||
}
|
}
|
||||||
|
|
||||||
test {
|
test {
|
||||||
|
|
|
@ -1,9 +1,13 @@
|
||||||
|
import org.xbib.settings.SettingsLoader;
|
||||||
|
|
||||||
module org.xbib.net.http.server.simple.test {
|
module org.xbib.net.http.server.simple.test {
|
||||||
requires transitive org.junit.jupiter.api;
|
requires transitive org.junit.jupiter.api;
|
||||||
|
requires org.xbib.settings.datastructures;
|
||||||
requires org.xbib.net;
|
requires org.xbib.net;
|
||||||
requires org.xbib.net.http;
|
requires org.xbib.net.http;
|
||||||
requires org.xbib.net.http.server;
|
requires org.xbib.net.http.server;
|
||||||
requires org.xbib.net.http.server.simple;
|
requires org.xbib.net.http.server.simple;
|
||||||
exports org.xbib.net.http.server.simple.test;
|
exports org.xbib.net.http.server.simple.test;
|
||||||
opens org.xbib.net.http.server.simple.test;
|
opens org.xbib.net.http.server.simple.test;
|
||||||
|
uses SettingsLoader;
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
org.xbib.settings.datastructures.json.JsonSettingsLoader
|
|
@ -22,6 +22,12 @@ import org.xbib.settings.Settings;
|
||||||
|
|
||||||
public interface Application extends SessionListener, Resolver<Path>, Closeable {
|
public interface Application extends SessionListener, Resolver<Path>, Closeable {
|
||||||
|
|
||||||
|
String getName();
|
||||||
|
|
||||||
|
String getProfile();
|
||||||
|
|
||||||
|
Path getHome();
|
||||||
|
|
||||||
Collection<HttpDomain> getDomains();
|
Collection<HttpDomain> getDomains();
|
||||||
|
|
||||||
Set<HttpAddress> getAddresses();
|
Set<HttpAddress> getAddresses();
|
||||||
|
@ -32,8 +38,6 @@ public interface Application extends SessionListener, Resolver<Path>, Closeable
|
||||||
|
|
||||||
MimeTypeService getMimeService();
|
MimeTypeService getMimeService();
|
||||||
|
|
||||||
Path getHome();
|
|
||||||
|
|
||||||
String getContextPath();
|
String getContextPath();
|
||||||
|
|
||||||
Settings getSettings();
|
Settings getSettings();
|
||||||
|
|
|
@ -93,6 +93,21 @@ public class BaseApplication implements Application {
|
||||||
applicationModuleList.add(applicationModule);
|
applicationModuleList.add(applicationModule);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName() {
|
||||||
|
return builder.name;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getProfile() {
|
||||||
|
return builder.profile;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Path getHome() {
|
||||||
|
return builder.home;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Locale getLocale() {
|
public Locale getLocale() {
|
||||||
return builder.locale;
|
return builder.locale;
|
||||||
|
@ -108,11 +123,6 @@ public class BaseApplication implements Application {
|
||||||
return builder.mimeTypeService;
|
return builder.mimeTypeService;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Path getHome() {
|
|
||||||
return builder.home;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getContextPath() {
|
public String getContextPath() {
|
||||||
return builder.contextPath;
|
return builder.contextPath;
|
||||||
|
|
|
@ -18,16 +18,16 @@ public class BaseApplicationBuilder implements ApplicationBuilder {
|
||||||
private static final Set<String> DEFAULT_SUFFIXES =
|
private static final Set<String> DEFAULT_SUFFIXES =
|
||||||
Set.of("css", "js", "ico", "png", "jpg", "jpeg", "gif", "woff2");
|
Set.of("css", "js", "ico", "png", "jpg", "jpeg", "gif", "woff2");
|
||||||
|
|
||||||
private String name;
|
protected String name;
|
||||||
|
|
||||||
private String profile;
|
protected String profile;
|
||||||
|
|
||||||
|
protected Path home;
|
||||||
|
|
||||||
protected ClassLoader classLoader;
|
protected ClassLoader classLoader;
|
||||||
|
|
||||||
protected Settings settings;
|
protected Settings settings;
|
||||||
|
|
||||||
protected Path home;
|
|
||||||
|
|
||||||
protected String contextPath;
|
protected String contextPath;
|
||||||
|
|
||||||
protected String secret;
|
protected String secret;
|
||||||
|
@ -59,15 +59,19 @@ public class BaseApplicationBuilder implements ApplicationBuilder {
|
||||||
this.profile = profile;
|
this.profile = profile;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
|
public BaseApplicationBuilder setHome(Path home) {
|
||||||
|
this.home = home;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public BaseApplicationBuilder setSettings(Settings settings) {
|
public BaseApplicationBuilder setSettings(Settings settings) {
|
||||||
this.settings = settings;
|
this.settings = settings;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
public BaseApplicationBuilder setClassLoader(ClassLoader classLoader) {
|
||||||
public BaseApplicationBuilder setHome(Path home) {
|
this.classLoader = classLoader;
|
||||||
this.home = home;
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -128,12 +132,21 @@ public class BaseApplicationBuilder implements ApplicationBuilder {
|
||||||
@Override
|
@Override
|
||||||
public Application build() {
|
public Application build() {
|
||||||
Objects.requireNonNull(httpRouter, "http router must not be null");
|
Objects.requireNonNull(httpRouter, "http router must not be null");
|
||||||
if (this.classLoader == null) {
|
if (this.name == null) {
|
||||||
this.classLoader = getClass().getClassLoader();
|
this.name = System.getProperty("application.name", "application");
|
||||||
|
}
|
||||||
|
if (this.profile == null) {
|
||||||
|
this.profile = System.getProperty("application.profile", "developer");
|
||||||
}
|
}
|
||||||
if (this.home == null) {
|
if (this.home == null) {
|
||||||
this.home = Paths.get(System.getProperty("application.home", "."));
|
this.home = Paths.get(System.getProperty("application.home", "."));
|
||||||
}
|
}
|
||||||
|
if (this.settings == null) {
|
||||||
|
this.settings = Settings.emptySettings();
|
||||||
|
}
|
||||||
|
if (this.classLoader == null) {
|
||||||
|
this.classLoader = getClass().getClassLoader();
|
||||||
|
}
|
||||||
if (this.contextPath == null) {
|
if (this.contextPath == null) {
|
||||||
this.contextPath = "/";
|
this.contextPath = "/";
|
||||||
}
|
}
|
||||||
|
@ -146,12 +159,6 @@ public class BaseApplicationBuilder implements ApplicationBuilder {
|
||||||
if (this.zoneId == null) {
|
if (this.zoneId == null) {
|
||||||
this.zoneId = ZoneId.systemDefault();
|
this.zoneId = ZoneId.systemDefault();
|
||||||
}
|
}
|
||||||
if (name == null) {
|
|
||||||
name = System.getProperty("application.name", "application");
|
|
||||||
}
|
|
||||||
if (profile == null) {
|
|
||||||
profile = System.getProperty("application.profile", "developer");
|
|
||||||
}
|
|
||||||
if (this.mimeTypeService == null) {
|
if (this.mimeTypeService == null) {
|
||||||
this.mimeTypeService = new MimeTypeService();
|
this.mimeTypeService = new MimeTypeService();
|
||||||
}
|
}
|
||||||
|
|
|
@ -215,11 +215,11 @@ public abstract class DefaultMarkupTemplate extends BaseTemplate {
|
||||||
}
|
}
|
||||||
|
|
||||||
public String bootstrapCss() {
|
public String bootstrapCss() {
|
||||||
return contextPath("webjars/bootstrap/5.2.3/css/bootstrap.min.css");
|
return contextPath("webjars/bootstrap/5.1.0/css/bootstrap.min.css");
|
||||||
}
|
}
|
||||||
|
|
||||||
public String bootstrapJs() {
|
public String bootstrapJs() {
|
||||||
return contextPath("webjars/bootstrap/5.2.3/js/bootstrap.min.js");
|
return contextPath("webjars/bootstrap/5.1.0/js/bootstrap.min.js");
|
||||||
}
|
}
|
||||||
|
|
||||||
public String jqueryJs() {
|
public String jqueryJs() {
|
||||||
|
|
|
@ -2,9 +2,9 @@ dependencyResolutionManagement {
|
||||||
versionCatalogs {
|
versionCatalogs {
|
||||||
libs {
|
libs {
|
||||||
version('gradle', '8.5')
|
version('gradle', '8.5')
|
||||||
version('groovy', '4.0.16')
|
version('groovy', '4.0.20')
|
||||||
version('netty', '4.1.107.Final')
|
version('netty', '4.1.108.Final')
|
||||||
version('netty-tcnative', '2.0.62.Final')
|
version('netty-tcnative', '2.0.65.Final')
|
||||||
version('datastructures', '5.0.7')
|
version('datastructures', '5.0.7')
|
||||||
version('net', '4.3.0')
|
version('net', '4.3.0')
|
||||||
library('netty-codec-http2', 'io.netty', 'netty-codec-http2').versionRef('netty')
|
library('netty-codec-http2', 'io.netty', 'netty-codec-http2').versionRef('netty')
|
||||||
|
@ -18,8 +18,7 @@ dependencyResolutionManagement {
|
||||||
library('jna', 'net.java.dev.jna', 'jna').version('5.14.0')
|
library('jna', 'net.java.dev.jna', 'jna').version('5.14.0')
|
||||||
library('groovy-templates', 'org.apache.groovy', 'groovy-templates').versionRef('groovy')
|
library('groovy-templates', 'org.apache.groovy', 'groovy-templates').versionRef('groovy')
|
||||||
library('j2html', 'org.xbib', 'j2html').version('2.0.0')
|
library('j2html', 'org.xbib', 'j2html').version('2.0.0')
|
||||||
library('htmlflow', 'com.github.xmlet', 'htmlflow').version('4.0')
|
library('webjars-bootstrap', 'org.webjars', 'bootstrap').version('5.1.0')
|
||||||
library('webjars-bootstrap', 'org.webjars', 'bootstrap').version('5.2.3')
|
|
||||||
library('webjars-jquery', 'org.webjars', 'jquery').version('3.6.4')
|
library('webjars-jquery', 'org.webjars', 'jquery').version('3.6.4')
|
||||||
library('webjars-fontawesome', 'org.webjars', 'font-awesome').version('6.3.0')
|
library('webjars-fontawesome', 'org.webjars', 'font-awesome').version('6.3.0')
|
||||||
library('net', 'org.xbib', 'net').versionRef('net')
|
library('net', 'org.xbib', 'net').versionRef('net')
|
||||||
|
|
Loading…
Reference in a new issue