Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public enum Version implements org.jboss.metadata.parser.util.Version<Version> {
JBOSS_WEB_14_0(org.jboss.metadata.parser.servlet.Version.SERVLET_4_0, 14, 0),
JBOSS_WEB_14_1(org.jboss.metadata.parser.servlet.Version.SERVLET_4_0, 14, 1),
JBOSS_WEB_15_0(org.jboss.metadata.parser.servlet.Version.SERVLET_6_0, 15, 0),
JBOSS_WEB_15_1(org.jboss.metadata.parser.servlet.Version.SERVLET_6_1, 15, 1),
;
// The corresponding servlet version
private final org.jboss.metadata.parser.servlet.Version servletVersion;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ public enum Version implements org.jboss.metadata.parser.util.Version<Version> {
SERVLET_4_0(4, 0, "http://xmlns.jcp.org/xml/ns/javaee/web-app_%d_%d.xsd"),
SERVLET_5_0(5, 0),
SERVLET_6_0(6, 0),
SERVLET_6_1(6, 1),
;
public static final Version LATEST = Version.SERVLET_6_0;
public static final Version LATEST = Version.SERVLET_6_1;
private static final Map<String, Version> VERSIONS = EnumSet.allOf(Version.class).stream().collect(Collectors.toMap(Version::toString, Function.identity()));
private static final Map<String, Version> SYSTEM_IDS = EnumSet.allOf(Version.class).stream().collect(Collectors.toMap(Version::getSystemId, Function.identity()));

Expand Down
516 changes: 516 additions & 0 deletions web/src/main/resources/schema/jboss-web_15_1.xsd

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* Copyright The JBoss Metadata Authors
* SPDX-License-Identifier: Apache-2.0
*/

package org.jboss.test.metadata.web;


import javax.xml.stream.XMLStreamException;

import org.jboss.metadata.parser.jbossweb.JBossWebMetaDataParser;
import org.jboss.metadata.property.PropertyReplacers;
import org.jboss.metadata.web.jboss.JBossWebMetaData;
import org.jboss.test.metadata.javaee.AbstractJavaEEEverythingTest;
import org.junit.Assert;

public class JBossWeb151UnitTestCase extends AbstractJavaEEEverythingTest {

public void testReplicationConfig() throws Exception {
try {
JBossWebMetaDataParser.parse(getReader(), PropertyReplacers.noop());
Assert.fail("<replication-config/> is no longer valid");
} catch (XMLStreamException e) {
// Expected
}
}

@SuppressWarnings("deprecation")
public void testClustering() throws Exception {
JBossWebMetaData metaData = JBossWebMetaDataParser.parse(getReader(), PropertyReplacers.noop());
Assert.assertNull(metaData.getReplicationConfig());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* Copyright The JBoss Metadata Authors
* SPDX-License-Identifier: Apache-2.0
*/
package org.jboss.test.metadata.web;

import java.util.List;

import org.jboss.metadata.merge.javaee.spec.JavaEEVersion;
import org.jboss.metadata.web.spec.AttributeValueMetaData;
import org.jboss.metadata.web.spec.WebMetaData;

/**
* Test all entries of Jakarta EE 11 web-app.
*
* @author Eduardo Martins
*
*/
public class WebApp11EverythingUnitTestCase extends WebApp6EverythingUnitTestCase {

public void testEverything() throws Exception {
WebMetaData webApp = unmarshal();
assertEverything(webApp, Mode.SPEC, JavaEEVersion.V11);
}

protected void assertCookieAttributes(List<AttributeValueMetaData> attributes) {
assertNotNull("cookie attributes not set", attributes);
assertEquals(2, attributes.size());
assertEquals("SameSite", attributes.get(0).getAttributeName());
assertEquals("None", attributes.get(0).getAttributeValue());
assertEquals("foo", attributes.get(1).getAttributeName());
assertEquals("bar", attributes.get(1).getAttributeValue());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* Copyright The JBoss Metadata Authors
* SPDX-License-Identifier: Apache-2.0
*/
package org.jboss.test.metadata.web;

import org.jboss.metadata.merge.javaee.spec.JavaEEVersion;
import org.jboss.metadata.web.spec.WebFragmentMetaData;

/**
* Test all entries of Jakarta EE 11 web-fragment.
*
* @author Eduardo Martins
*
*/
public class WebApp11FragmentUnitTestCase extends WebApp6FragmentUnitTestCase {

public void testEverything() throws Exception {
WebFragmentMetaData webApp = unmarshal();
assertEverything(webApp, Mode.SPEC, JavaEEVersion.V11);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright The JBoss Metadata Authors
~ SPDX-License-Identifier: Apache-2.0
-->

<jboss-web version="15.1" xmlns="urn:jboss:jakartaee:1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:jboss:jakartaee:1.0 https://www.jboss.org/schema/jbossas/jboss-web_15_1.xsd">

<max-active-sessions>10</max-active-sessions>

</jboss-web>
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright The JBoss Metadata Authors
~ SPDX-License-Identifier: Apache-2.0
-->

<jboss-web version="15.1" xmlns="urn:jboss:jakartaee:1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:jboss:jakartaee:1.0 https://www.jboss.org/j2ee/schema/jboss-web_15_1.xsd">

<replication-config>
<cache-name>testCache</cache-name>
<replication-granularity>SESSION</replication-granularity>
</replication-config>

</jboss-web>
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<web-fragment xmlns="https://jakarta.ee/xml/ns/jakartaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-fragment_6_0.xsd"
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-fragment_6_1.xsd"
version="6.1" id="web-fragment-everything">

<ordering>
Expand Down