Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[18.x] WFLY-12173 Bump the Undertow subsystem model version and schema to version 10 #12346

Merged
merged 1 commit into from Aug 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -44,12 +44,14 @@ enum Namespace {
UNDERTOW_6_0("urn:jboss:domain:undertow:6.0"),
UNDERTOW_7_0("urn:jboss:domain:undertow:7.0"),
UNDERTOW_8_0("urn:jboss:domain:undertow:8.0"),
UNDERTOW_9_0("urn:jboss:domain:undertow:9.0");
UNDERTOW_9_0("urn:jboss:domain:undertow:9.0"),
UNDERTOW_10_0("urn:jboss:domain:undertow:10.0");
;

/**
* The current namespace version.
*/
public static final Namespace CURRENT = UNDERTOW_9_0;
public static final Namespace CURRENT = UNDERTOW_10_0;

private final String name;

Expand Down
Expand Up @@ -79,7 +79,7 @@ public class UndertowExtension implements Extension {
static final AccessConstraintDefinition LISTENER_CONSTRAINT = new SensitiveTargetAccessConstraintDefinition(
new SensitivityClassification(SUBSYSTEM_NAME, "web-connector", false, false, false));

private static final ModelVersion CURRENT_MODEL_VERSION = ModelVersion.create(9, 0, 0);
private static final ModelVersion CURRENT_MODEL_VERSION = ModelVersion.create(10, 0, 0);


public static StandardResourceDescriptionResolver getResolver(final String... keyPrefix) {
Expand All @@ -104,6 +104,7 @@ public void initializeParsers(ExtensionParsingContext context) {
context.setSubsystemXmlMapping(SUBSYSTEM_NAME, Namespace.UNDERTOW_7_0.getUriString(), UndertowSubsystemParser_7_0::new);
context.setSubsystemXmlMapping(SUBSYSTEM_NAME, Namespace.UNDERTOW_8_0.getUriString(), UndertowSubsystemParser_8_0::new);
context.setSubsystemXmlMapping(SUBSYSTEM_NAME, Namespace.UNDERTOW_9_0.getUriString(), UndertowSubsystemParser_9_0::new);
context.setSubsystemXmlMapping(SUBSYSTEM_NAME, Namespace.UNDERTOW_10_0.getUriString(), UndertowSubsystemParser_10_0::new);
}

@Override
Expand All @@ -116,7 +117,7 @@ public void initialize(ExtensionContext context) {
deployments.registerSubModel(DeploymentServletDefinition.INSTANCE);
deployments.registerSubModel(DeploymentWebSocketDefinition.INSTANCE);

subsystem.registerXMLElementWriter(UndertowSubsystemParser_9_0::new);
subsystem.registerXMLElementWriter(UndertowSubsystemParser_10_0::new);
}

}

Large diffs are not rendered by default.

1,068 changes: 1,068 additions & 0 deletions undertow/src/main/resources/schema/wildfly-undertow_10_0.xsd

Large diffs are not rendered by default.

Expand Up @@ -24,7 +24,7 @@
<!-- See src/resources/configuration/ReadMe.txt for how the configuration assembly works -->
<config>
<extension-module>org.wildfly.extension.undertow</extension-module>
<subsystem xmlns="urn:jboss:domain:undertow:9.0" default-server="default-server" default-virtual-host="default-host" default-servlet-container="default" statistics-enabled="${wildfly.undertow.statistics-enabled:${wildfly.statistics-enabled:false}}">
<subsystem xmlns="urn:jboss:domain:undertow:10.0" default-server="default-server" default-virtual-host="default-host" default-servlet-container="default" statistics-enabled="${wildfly.undertow.statistics-enabled:${wildfly.statistics-enabled:false}}">
<buffer-cache name="default" />
<server name="default-server">
<http-listener name="default" socket-binding="http" redirect-socket="https" enable-http2="true" />
Expand Down
Expand Up @@ -24,7 +24,7 @@
<!-- See src/resources/configuration/ReadMe.txt for how the configuration assembly works -->
<config>
<extension-module>org.wildfly.extension.undertow</extension-module>
<subsystem xmlns="urn:jboss:domain:undertow:9.0" default-server="default-server" default-virtual-host="default-host" default-servlet-container="default" default-security-domain="other" statistics-enabled="${wildfly.undertow.statistics-enabled:${wildfly.statistics-enabled:false}}">
<subsystem xmlns="urn:jboss:domain:undertow:10.0" default-server="default-server" default-virtual-host="default-host" default-servlet-container="default" default-security-domain="other" statistics-enabled="${wildfly.undertow.statistics-enabled:${wildfly.statistics-enabled:false}}">
<buffer-cache name="default" />
<server name="default-server">
<?AJP?>
Expand Down
@@ -0,0 +1,66 @@
/*
* JBoss, Home of Professional Open Source.
* Copyright 2019, Red Hat, Inc., and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/

package org.wildfly.extension.undertow;

import java.io.IOException;

import org.jboss.as.subsystem.test.KernelServices;
import org.jboss.as.subsystem.test.KernelServicesBuilder;
import org.junit.Test;

public class UndertowSubsystem100TestCase extends AbstractUndertowSubsystemTestCase {

private final String virtualHostName = "some-server";
private final int flag = 1;

@Override
protected String getSubsystemXml() throws IOException {
return readResource("undertow-10.0.xml");
}

@Override
protected String getSubsystemXsdPath() throws Exception {
return "schema/wildfly-undertow_10_0.xsd";
}

@Override
protected String[] getSubsystemTemplatePaths() {
return new String[] { "/subsystem-templates/undertow.xml" };
}

@Test
@Override
public void testSchemaOfSubsystemTemplates() throws Exception {
super.testSchemaOfSubsystemTemplates();
}

@Test
public void testRuntime() throws Exception {
setProperty();
KernelServicesBuilder builder = createKernelServicesBuilder(RUNTIME).setSubsystemXml(getSubsystemXml());
KernelServices mainServices = builder.build();
testRuntime(mainServices, virtualHostName, flag);
testRuntimeOther(mainServices);
testRuntimeLast(mainServices);
}
}
Expand Up @@ -68,15 +68,15 @@ protected KernelServices standardSubsystemTest(String configId, boolean compareX
public void testRuntime() throws Exception {

setProperty();
KernelServicesBuilder builder = createKernelServicesBuilder(UndertowSubsystemTestCase.RUNTIME)
KernelServicesBuilder builder = createKernelServicesBuilder(AbstractUndertowSubsystemTestCase.RUNTIME)
.setSubsystemXml(getSubsystemXml());
KernelServices mainServices = builder.build();
testRuntime(mainServices, virtualHostName, flag);
}

@Override
protected AdditionalInitialization createAdditionalInitialization() {
return UndertowSubsystemTestCase.DEFAULT;
return AbstractUndertowSubsystemTestCase.DEFAULT;
}

}
Expand Up @@ -67,7 +67,7 @@ protected KernelServices standardSubsystemTest(String configId, boolean compareX
@Test
public void testRuntime() throws Exception {
setProperty();
KernelServicesBuilder builder = createKernelServicesBuilder(UndertowSubsystemTestCase.RUNTIME)
KernelServicesBuilder builder = createKernelServicesBuilder(AbstractUndertowSubsystemTestCase.RUNTIME)
.setSubsystemXml(getSubsystemXml());
KernelServices mainServices = builder.build();
testRuntime(mainServices, virtualHostName, flag);
Expand All @@ -76,7 +76,7 @@ public void testRuntime() throws Exception {

@Override
protected AdditionalInitialization createAdditionalInitialization() {
return UndertowSubsystemTestCase.DEFAULT;
return AbstractUndertowSubsystemTestCase.DEFAULT;
}

}
Expand Up @@ -65,14 +65,14 @@ public void testSubsystem() throws Exception {
@Test
public void testRuntime() throws Exception {
setProperty();
KernelServicesBuilder builder = createKernelServicesBuilder(UndertowSubsystemTestCase.RUNTIME)
KernelServicesBuilder builder = createKernelServicesBuilder(AbstractUndertowSubsystemTestCase.RUNTIME)
.setSubsystemXml(getSubsystemXml());
KernelServices mainServices = builder.build();
testRuntime(mainServices, virtualHostName, flag);
}

@Override
protected AdditionalInitialization createAdditionalInitialization() {
return UndertowSubsystemTestCase.DEFAULT;
return AbstractUndertowSubsystemTestCase.DEFAULT;
}
}
Expand Up @@ -67,7 +67,7 @@ protected KernelServices standardSubsystemTest(String configId, boolean compareX
@Test
public void testRuntime() throws Exception {
setProperty();
KernelServicesBuilder builder = createKernelServicesBuilder(UndertowSubsystemTestCase.RUNTIME)
KernelServicesBuilder builder = createKernelServicesBuilder(AbstractUndertowSubsystemTestCase.RUNTIME)
.setSubsystemXml(getSubsystemXml());
KernelServices mainServices = builder.build();
testRuntime(mainServices, virtualHostName, flag);
Expand All @@ -77,7 +77,7 @@ public void testRuntime() throws Exception {

@Override
protected AdditionalInitialization createAdditionalInitialization() {
return UndertowSubsystemTestCase.DEFAULT;
return AbstractUndertowSubsystemTestCase.DEFAULT;
}

}
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
* Copyright 2017, Red Hat, Inc., and individual contributors
* Copyright 2019, Red Hat, Inc., and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
Expand Down Expand Up @@ -33,7 +33,7 @@
*
* @author <a href="mailto:tomaz.cerar@redhat.com">Tomaz Cerar</a>
*/
public class UndertowSubsystemTestCase extends AbstractUndertowSubsystemTestCase {
public class UndertowSubsystem90TestCase extends AbstractUndertowSubsystemTestCase {

private final String virtualHostName = "some-server";
private final int flag = 1;
Expand All @@ -49,15 +49,8 @@ protected String getSubsystemXsdPath() throws Exception {
}

@Override
protected String[] getSubsystemTemplatePaths() throws IOException {
return new String[]{"/subsystem-templates/undertow.xml"};
}


@Test
@Override
public void testSchemaOfSubsystemTemplates() throws Exception {
super.testSchemaOfSubsystemTemplates();
protected KernelServices standardSubsystemTest(String configId, boolean compareXml) throws Exception {
return super.standardSubsystemTest(configId, false);
}

@Test
Expand Down