14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 import static org.testng.Assert.assertEquals;
25 import static org.testng.Assert.assertTrue;
26
27 import java.io.File;
28 import java.net.URL;
29 import java.net.URLClassLoader;
30 import java.nio.file.Files;
31 import java.nio.file.Path;
32 import java.nio.file.Paths;
33
34 import jdk.testlibrary.CompilerUtils;
35
36 import org.testng.Assert;
37 import org.testng.annotations.BeforeTest;
38 import org.testng.annotations.Test;
39 import org.xml.sax.XMLReader;
40 import org.xml.sax.helpers.XMLReaderFactory;
41
42 /*
43 * @test
44 * @library /javax/xml/jaxp/libs
45 * @build jdk.testlibrary.*
46 * @run testng XMLReaderFactoryTest
47 * @bug 8152912 8015099 8156119
48 * @summary Tests XMLReaderFactory can work as ServiceLoader compliant, as well as backward compatible
49 */
50
51 @Test
52 public class XMLReaderFactoryTest {
53 private static final String TEST_SRC = System.getProperty("test.src");
54
55 private static final Path SRC_DIR = Paths.get(TEST_SRC, "src").resolve("xmlprovider3");
56 private static final Path CLASSES_DIR = Paths.get("classes");
57 private static final Path LEGACY_DIR = CLASSES_DIR.resolve("legacy");
58 private static final Path SERVICE_DIR = CLASSES_DIR.resolve("service");
59
60 // resources to copy to the class path
61 private static final String LEGACY_SERVICE_FILE = "legacy/META-INF/services/org.xml.sax.driver";
62 private static final String SERVICE_FILE = "service/META-INF/services/org.xml.sax.XMLReader";
63
64 /*
65 * Compile class and copy service files
|
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 import static org.testng.Assert.assertEquals;
25 import static org.testng.Assert.assertTrue;
26
27 import java.io.File;
28 import java.net.URL;
29 import java.net.URLClassLoader;
30 import java.nio.file.Files;
31 import java.nio.file.Path;
32 import java.nio.file.Paths;
33
34 import jdk.test.lib.compiler.CompilerUtils;
35
36 import org.testng.Assert;
37 import org.testng.annotations.BeforeTest;
38 import org.testng.annotations.Test;
39 import org.xml.sax.XMLReader;
40 import org.xml.sax.helpers.XMLReaderFactory;
41
42 /*
43 * @test
44 * @library /test/lib
45 * @run testng XMLReaderFactoryTest
46 * @bug 8152912 8015099 8156119
47 * @summary Tests XMLReaderFactory can work as ServiceLoader compliant, as well as backward compatible
48 */
49
50 @Test
51 public class XMLReaderFactoryTest {
52 private static final String TEST_SRC = System.getProperty("test.src");
53
54 private static final Path SRC_DIR = Paths.get(TEST_SRC, "src").resolve("xmlprovider3");
55 private static final Path CLASSES_DIR = Paths.get("classes");
56 private static final Path LEGACY_DIR = CLASSES_DIR.resolve("legacy");
57 private static final Path SERVICE_DIR = CLASSES_DIR.resolve("service");
58
59 // resources to copy to the class path
60 private static final String LEGACY_SERVICE_FILE = "legacy/META-INF/services/org.xml.sax.driver";
61 private static final String SERVICE_FILE = "service/META-INF/services/org.xml.sax.XMLReader";
62
63 /*
64 * Compile class and copy service files
|