FAIL "disables loading DTD from unsecured Urls" is reported when XML file need load local files
See original GitHub issueTestNG Version
Note: only the latest version is supported 7.0.0
Expected behavior
My suite XML file is as below: https://github.com/cbeust/testng/files/3849970/00_simple_s3.txt
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "https://testng.org/testng-1.0.dtd"
[<!ENTITY raw_listeners SYSTEM "testng/_listener/raw_listeners_no_compact.xml">]>
<suite name = "OSS Simple Test" configfailurepolicy = "continue">
<test name = "Simple upload and download" preserve-order = "true">
<classes>
<class name = "com.jcloud.test.jss.object.s3.HttpOnlyTest"/>
</classes>
</test>
&raw_listeners;
</suite>
when I run this suite file with TestNG7.0, it is always report " TestNG by default disables loading DTD from unsecured Urls. If you need to explicitly load the DTD from a http url, please do so by using the JVM argument [-Dtestng.dtd.http=true"
I debug it and find the Parser report FAIL when met <!ENTITY raw_listeners SYSTEM "testng/_listener/raw_listeners_no_compact.xml">
, especially “testng/_listener/raw_listeners_no_compact.xml”
Actual behavior
HTTPS is needed is introduced in pull request #2023 but it should not report FAIL (disables loading DTD from unsecured Urls) when XML file need load local files
Is the issue reproductible on runner?
100% reproductible
- Shell
- [X ] Maven
- Gradle
- Ant
- Eclipse
- [ X] IntelliJ
- NetBeans
Test case sample
Please, share the test case (as small as possible) which shows the issue
Issue Analytics
- State:
- Created 4 years ago
- Comments:13
Top GitHub Comments
I found a solution for me, I hope it works for you, you just have to change
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
by the following<!DOCTYPE suite SYSTEM "https://testng.org/testng-1.0.dtd">
just change http to https, compile and test, good luck!@gvasanka make sure you are on
7.3.0
and addhttps
to your dtd url in suite file. That should suffice.