< prev index next >
test/javax/xml/jaxp/libs/catalog/ResolutionChecker.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 2015, 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.
--- 1,7 ----
/*
! * Copyright (c) 2015, 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*** 22,32 ****
*/
package catalog;
import javax.xml.catalog.CatalogResolver;
- import javax.xml.catalog.CatalogUriResolver;
import org.testng.Assert;
/*
* Utilities for checking catalog resolution.
--- 22,31 ----
*** 63,82 ****
/*
* Checks the resolution result for specified URI references
* with the specified base location.
*/
! static void checkUriResolution(CatalogUriResolver resolver,
String href, String base, String matchedUri) {
Assert.assertEquals(resolver.resolve(href, base).getSystemId(),
matchedUri);
}
/*
* Checks the resolution result for specified URI references.
*/
! static void checkUriResolution(CatalogUriResolver resolver,
String href, String matchedUri) {
checkUriResolution(resolver, href, null, matchedUri);
}
/* ********** Checks no match is found ********** */
--- 62,81 ----
/*
* Checks the resolution result for specified URI references
* with the specified base location.
*/
! static void checkUriResolution(CatalogResolver resolver,
String href, String base, String matchedUri) {
Assert.assertEquals(resolver.resolve(href, base).getSystemId(),
matchedUri);
}
/*
* Checks the resolution result for specified URI references.
*/
! static void checkUriResolution(CatalogResolver resolver,
String href, String matchedUri) {
checkUriResolution(resolver, href, null, matchedUri);
}
/* ********** Checks no match is found ********** */
*** 90,102 ****
"http://extId/noMatch/docNoMatch.dtd");
}
/*
* With strict resolution, if no match is found,
! * CatalogUriResolver should throw CatalogException.
*/
! static void checkNoMatch(CatalogUriResolver resolver) {
resolver.resolve("http://uri/noMatch/docNoMatch.dtd", getNotSpecified(null));
}
/* ********** Checks expected exception ********** */
--- 89,101 ----
"http://extId/noMatch/docNoMatch.dtd");
}
/*
* With strict resolution, if no match is found,
! * CatalogResolver should throw CatalogException.
*/
! static void checkNoUriMatch(CatalogResolver resolver) {
resolver.resolve("http://uri/noMatch/docNoMatch.dtd", getNotSpecified(null));
}
/* ********** Checks expected exception ********** */
*** 137,147 ****
/*
* Checks the expected exception during the resolution for specified
* URI reference with a specified base location.
*/
static <T extends Throwable> void expectExceptionOnUri(
! CatalogUriResolver resolver, String href, String base,
Class<T> expectedExceptionClass) {
expectThrows(expectedExceptionClass, () -> {
resolver.resolve(href, base);
});
}
--- 136,146 ----
/*
* Checks the expected exception during the resolution for specified
* URI reference with a specified base location.
*/
static <T extends Throwable> void expectExceptionOnUri(
! CatalogResolver resolver, String href, String base,
Class<T> expectedExceptionClass) {
expectThrows(expectedExceptionClass, () -> {
resolver.resolve(href, base);
});
}
*** 149,159 ****
/*
* Checks the expected exception during the resolution for specified
* URI reference without any specified base location.
*/
static <T extends Throwable> void expectExceptionOnUri(
! CatalogUriResolver resolver, String href,
Class<T> expectedExceptionClass) {
expectExceptionOnUri(resolver, href, null, expectedExceptionClass);
}
// The TestNG distribution in current JTREG build doesn't support
--- 148,158 ----
/*
* Checks the expected exception during the resolution for specified
* URI reference without any specified base location.
*/
static <T extends Throwable> void expectExceptionOnUri(
! CatalogResolver resolver, String href,
Class<T> expectedExceptionClass) {
expectExceptionOnUri(resolver, href, null, expectedExceptionClass);
}
// The TestNG distribution in current JTREG build doesn't support
< prev index next >