Skip to content

Commit a700e5b

Browse files
author
Vladimir Kotal
committed
change Jakarta EE namespace to suit Tomcat 10
fixes #3718
1 parent aa18fa2 commit a700e5b

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

tools/setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
test=pytest
33

44
[tool:pytest]
5-
addopts = -v --color=yes --numprocesses=auto
5+
addopts = -vv --color=yes --numprocesses=auto
66
testpaths = src/test/python

tools/src/main/python/opengrok_tools/utils/xml.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def insert_file(input_xml, insert_xml_file):
3737
"""
3838

3939
# This avoids resulting XML to have namespace prefixes in elements.
40-
ET.register_namespace('', "http://xmlns.jcp.org/xml/ns/javaee")
40+
ET.register_namespace('', "https://jakarta.ee/xml/ns/jakartaee")
4141

4242
root = ET.fromstring(input_xml)
4343
try:

tools/src/test/python/new.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version='1.0' encoding='utf8'?>
2-
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="3.1" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd">
2+
<web-app 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-app_5_0.xsd" version="5.0">
33

44
<display-name>OpenGrok</display-name>
55
<description>A wicked fast source browser</description>
@@ -42,4 +42,4 @@
4242
<auth-method>BASIC</auth-method>
4343
</login-config>
4444

45-
</web-app>
45+
</web-app>

tools/src/test/python/test_xml.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def test_xml_insert():
4040
os.path.join(DIR_PATH, "insert.xml"))
4141
with open(os.path.join(DIR_PATH, "new.xml")) as expected_xml:
4242
# TODO: this should really be comparing XML trees
43-
assert out == expected_xml.read()
43+
assert out.strip() == expected_xml.read().strip()
4444

4545

4646
def test_invalid_xml():

tools/src/test/python/web.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
2+
<web-app xmlns="https://jakarta.ee/xml/ns/jakartaee"
33
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
version="3.1"
5-
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
6-
http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd">
4+
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee
5+
https://jakarta.ee/xml/ns/jakartaee/web-app_5_0.xsd"
6+
version="5.0">
77

88
<display-name>OpenGrok</display-name>
99
<description>A wicked fast source browser</description>

0 commit comments

Comments
 (0)