Review request for JDK-8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests

huizhe wang at
Wed Dec 3 03:52:52 UTC 2014

I agree with Lance's suggestion on utilizing the @BeforeMethod methods 
to instantiate factories, or DocumentBuilder where there's no change in 
state on the DocumentBuilderFactory (that is, no set** in any of the 
tests, such as DocumentBuilderImpl01), or using DataProvider.

However, if you do make the changes, you may need to reset the factory 
or force the tests to run in order. In case of SAXParserTest03, all 
three test cases do spf.setValidating(true) so it can be done in 
@BeforeMethod. But then test 02 and 03 test NamespaceAware, without 
ordering or setting it to false (default) explicitly in test01, it may 
affect test 01.

In other cases, for example DocumentBuilderFactory01, you'd need to set 
the feature back to default within a test in order to not cause negative 
impact on other tests.

As Lance said, these suggestions should not prevent you pushing it in 
the current state. But it may be an helpful exercise if you'd want to 
get familiar with the package.


On 12/2/2014 6:33 AM, Lance Andersen wrote:
> Hi Frank,
> I think this looks good overall.
> I might suggest that you consider utilizing the @BeforeMethod methods 
> further, For example is you could move
> SAXParserFactory spf = SAXParserFactory.newInstance();
> spf.setValidating(true);
>  to your @BeforeMethod, or consider using a DataProvider that is 
> accessible from all classes to reduce some code duplication which will 
> make maintenance a bit easier.
> I am not sure how much more additional info failUnexpected adds, but 
> you could omit this if you choose and just have the test method throw 
> Exception and you will get your failure.
> Again the above are suggestions, but should not prevent you pushing 
> this to the workspace
> Best
> Lance
> On Dec 1, 2014, at 9:57 PM, Frank Yuan <frank.yuan at 
> <mailto:frank.yuan at>> wrote:
>> Hi, Joe and All
>> We are working on moving internal jaxp functional tests to open jdk repo.
>> This is the parsers suite. Would you please review these test?  Any 
>> comment
>> will be appreciated.
>> bug:
>> webrev: 
>> <>
>> Thanks,
>> Frank
> <>
> <><>
> <>Lance 
> Andersen| Principal Member of Technical Staff | +1.781.442.2037
> Oracle Java Engineering
> 1 Network Drive
> Burlington, MA 01803
> Lance.Andersen at <mailto:Lance.Andersen at>

More information about the core-libs-dev mailing list