--- old/test/javax/xml/jaxp/unittest/stream/FactoryFindTest.java 2016-07-21 20:34:22.984027778 -0700 +++ new/test/javax/xml/jaxp/unittest/stream/FactoryFindTest.java 2016-07-21 20:34:22.846027778 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2016, 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 @@ -36,24 +36,25 @@ import javax.xml.stream.XMLOutputFactory; import org.testng.Assert; -import org.testng.annotations.BeforeClass; +import org.testng.annotations.Listeners; import org.testng.annotations.Test; /* * @summary Test SaTX factory using factory property and using ContextClassLoader. */ +@Listeners({jaxp.library.FilePolicy.class}) public class FactoryFindTest { boolean myClassLoaderUsed = false; final static String FACTORY_KEY = "javax.xml.stream.XMLInputFactory"; - @BeforeClass - public void setup(){ - policy.PolicyUtil.changePolicy(getClass().getResource("FactoryFindTest.policy").getFile()); - } +// @BeforeClass +// public void setup(){ +// policy.PolicyUtil.changePolicy(getClass().getResource("FactoryFindTest.policy").getFile()); +// } - @Test + @Test(enabled=false) public void testFactoryFindUsingStaxProperties() { // If property is defined, will take precendence so this test // is ignored :( @@ -107,6 +108,7 @@ Thread.currentThread().setContextClassLoader(new MyClassLoader()); factory = XMLInputFactory.newInstance(); + // because it's decided by having sm or not in FactoryFind code if (System.getSecurityManager() == null) Assert.assertTrue(myClassLoaderUsed); else