Skip to content
Closed
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
23 changes: 17 additions & 6 deletions test/jaxp/javax/xml/jaxp/unittest/common/catalog/DOMTest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand All @@ -22,8 +22,12 @@
*/
package common.catalog;

/**
* @test @bug 8306055
import java.net.ProxySelector;

/*
* @test
* @bug 8306055 8359337
* @summary verifies DOM's support of the JDK Catalog.
* @library /javax/xml/jaxp/libs /javax/xml/jaxp/unittest
* @modules java.xml/jdk.xml.internal
* @run driver common.catalog.DOMTest 0 // verifies default setting catalog.resolve=allow
Expand All @@ -36,11 +40,18 @@
* @run driver common.catalog.DOMTest 7 // verifies external DTD resolution with a custom Catalog while resolve=strict in API setting
* @run driver common.catalog.DOMTest 8 // verifies external parameter are resolved with a custom Catalog though resolve=strict in API setting
* @run driver common.catalog.DOMTest 9 // verifies XInclude are resolved with a custom Catalog though resolve=strict in API setting
* @summary verifies DOM's support of the JDK Catalog.
*/
public class DOMTest extends CatalogTestBase {
public static void main(String args[]) throws Exception {
new DOMTest().run(args[0]);
public static void main(String[] args) throws Exception {
final ProxySelector previous = ProxySelector.getDefault();
// disable proxy
ProxySelector.setDefault(ProxySelector.of(null));
try {
new DOMTest().run(args[0]);
} finally {
// reset to the previous proxy selector
ProxySelector.setDefault(previous);
}
}

public void run(String index) throws Exception {
Expand Down
24 changes: 17 additions & 7 deletions test/jaxp/javax/xml/jaxp/unittest/common/catalog/SAXTest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand All @@ -22,8 +22,12 @@
*/
package common.catalog;

/**
* @test @bug 8306055
import java.net.ProxySelector;

/*
* @test
* @bug 8306055 8359337
* @summary verifies DOM's support of the JDK Catalog.
* @library /javax/xml/jaxp/libs /javax/xml/jaxp/unittest
* @modules java.xml/jdk.xml.internal
* @run driver common.catalog.SAXTest 0 // verifies default setting catalog.resolve=allow
Expand All @@ -36,12 +40,18 @@
* @run driver common.catalog.SAXTest 7 // verifies external DTD resolution with a custom Catalog while resolve=strict in API setting
* @run driver common.catalog.SAXTest 8 // verifies external parameter are resolved with a custom Catalog though resolve=strict in API setting
* @run driver common.catalog.SAXTest 9 // verifies XInclude are resolved with a custom Catalog though resolve=strict in API setting
* @summary verifies DOM's support of the JDK Catalog.

*/
public class SAXTest extends CatalogTestBase {
public static void main(String args[]) throws Exception {
new SAXTest().run(args[0]);
public static void main(String[] args) throws Exception {
final ProxySelector previous = ProxySelector.getDefault();
// disable proxy
ProxySelector.setDefault(ProxySelector.of(null));
try {
new SAXTest().run(args[0]);
} finally {
// reset to the previous proxy selector
ProxySelector.setDefault(previous);
}
}

public void run(String index) throws Exception {
Expand Down
43 changes: 36 additions & 7 deletions test/jaxp/javax/xml/jaxp/unittest/common/dtd/DOMTest.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,33 @@
/*
* Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
* Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code 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 General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package common.dtd;

/**
* @test @bug 8306632
import java.net.ProxySelector;

/*
* @test
* @bug 8306632 8359337
* @summary verifies DOM's support of the property jdk.xml.dtd.support.
* @library /javax/xml/jaxp/libs /javax/xml/jaxp/unittest
* @modules java.xml/jdk.xml.internal
* @run driver common.dtd.DOMTest 0 // verifies default setting dtd.support=allow
Expand All @@ -15,11 +37,18 @@
* @run driver common.dtd.DOMTest 4 // verifies DTD=ignore
* @run driver common.dtd.DOMTest 5 // verifies disallow-doctype-decl=false
* @run driver common.dtd.DOMTest 6 // verifies disallow-doctype-decl=true
* @summary verifies DOM's support of the property jdk.xml.dtd.support.
*/
public class DOMTest extends DTDTestBase {
public static void main(String args[]) throws Exception {
new DOMTest().run(args[0]);
public static void main(String[] args) throws Exception {
final ProxySelector previous = ProxySelector.getDefault();
// disable proxy
ProxySelector.setDefault(ProxySelector.of(null));
try {
new DOMTest().run(args[0]);
} finally {
// reset to the previous proxy selector
ProxySelector.setDefault(previous);
}
}

public void run(String index) throws Exception {
Expand Down
43 changes: 36 additions & 7 deletions test/jaxp/javax/xml/jaxp/unittest/common/dtd/SAXTest.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,35 @@
/*
* Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
* Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code 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 General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package common.dtd;

import java.net.ProxySelector;

import common.util.TestBase;

/**
* @test @bug 8306632
/*
* @test
* @bug 8306632 8359337
* @summary verifies SAX's support of the property jdk.xml.dtd.support.
* @library /javax/xml/jaxp/libs /javax/xml/jaxp/unittest
* @modules java.xml/jdk.xml.internal
* @run driver common.dtd.SAXTest 0 // verifies default setting dtd.support=allow
Expand All @@ -17,11 +39,18 @@
* @run driver common.dtd.SAXTest 4 // verifies DTD=ignore
* @run driver common.dtd.SAXTest 5 // verifies disallow-doctype-decl=false
* @run driver common.dtd.SAXTest 6 // verifies disallow-doctype-decl=true
* @summary verifies SAX's support of the property jdk.xml.dtd.support.
*/
public class SAXTest extends DTDTestBase {
public static void main(String args[]) throws Exception {
new SAXTest().run(args[0]);
public static void main(String[] args) throws Exception {
final ProxySelector previous = ProxySelector.getDefault();
// disable proxy
ProxySelector.setDefault(ProxySelector.of(null));
try {
new SAXTest().run(args[0]);
} finally {
// reset to the previous proxy selector
ProxySelector.setDefault(previous);
}
}

public void run(String index) throws Exception {
Expand Down
19 changes: 15 additions & 4 deletions test/jaxp/javax/xml/jaxp/unittest/dom/DOMFeatureTest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2019, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand All @@ -25,10 +25,13 @@
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.ProxySelector;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import org.w3c.dom.Document;
Expand All @@ -40,10 +43,11 @@

/*
* @test
* @bug 8206132
* @library /javax/xml/jaxp/libs /javax/xml/jaxp/unittest
* @run testng dom.DOMFeatureTest
* @bug 8206132 8359337
* @summary Tests DOM features.
* @library /javax/xml/jaxp/libs /javax/xml/jaxp/unittest
* @comment we use othervm because the test configures a system wide ProxySelector
* @run testng/othervm dom.DOMFeatureTest
*/
public class DOMFeatureTest {

Expand Down Expand Up @@ -105,6 +109,13 @@ Object[][] getData1() throws Exception {
{true, XML3},
};
}

@BeforeClass
static void beforeClass() {
// disable proxy
ProxySelector.setDefault(ProxySelector.of(null));
}

/**
* Verifies the EntityExpansion feature.
* @param caseNo the case number
Expand Down