13 * accompanied this code).
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 package catalog;
25
26 import static catalog.CatalogTestUtils.catalogResolver;
27 import static catalog.CatalogTestUtils.catalogUriResolver;
28 import static catalog.ResolutionChecker.checkPubIdResolution;
29 import static catalog.ResolutionChecker.checkSysIdResolution;
30 import static catalog.ResolutionChecker.checkUriResolution;
31
32 import javax.xml.catalog.CatalogResolver;
33 import javax.xml.catalog.CatalogUriResolver;
34
35 import org.testng.annotations.DataProvider;
36 import org.testng.annotations.Listeners;
37 import org.testng.annotations.Test;
38
39 /*
40 * @test
41 * @bug 8077931
42 * @library /javax/xml/jaxp/libs
43 * @run testng/othervm -DrunSecMngr=true catalog.NextCatalogTest
44 * @run testng/othervm catalog.NextCatalogTest
45 * @summary Get matched URIs from system, public and uri entries respectively,
46 * but some of the entries are defined in none-current catalog files.
47 */
48 @Listeners({jaxp.library.FilePolicy.class})
49 public class NextCatalogTest {
50
51 private static final String CATALOG_NEXTCATALOGLEFT
52 = "nextCatalog-left.xml";
53 private static final String CATALOG_NEXTCATALOGRIGHT
137 { "http://remote/dtd/uri/docBob.dtd",
138 "http://local/base/dtd/docBobLeftURI.dtd" },
139
140 // The matched URI of the specified URI reference is defined in
141 // a two-level next catalog file.
142 { "http://remote/dtd/uri/docCarl.dtd",
143 "http://local/base/dtd/docCarlURI.dtd" },
144
145 // Multiple catalog files, which are defined as next catalog,
146 // have the matched uri entries of the specified URI reference.
147 // But finally, the returned matched URI is the first found.
148 { "http://remote/dtd/uri/docDuplicate.dtd",
149 "http://local/base/dtd/docDuplicateLeftURI.dtd" } };
150 }
151
152 private CatalogResolver createEntityResolver() {
153 return catalogResolver(CATALOG_NEXTCATALOGLEFT,
154 CATALOG_NEXTCATALOGRIGHT);
155 }
156
157 private CatalogUriResolver createUriResolver() {
158 return catalogUriResolver(CATALOG_NEXTCATALOGLEFT,
159 CATALOG_NEXTCATALOGRIGHT);
160 }
161 }
162
|
13 * accompanied this code).
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 package catalog;
25
26 import static catalog.CatalogTestUtils.catalogResolver;
27 import static catalog.CatalogTestUtils.catalogUriResolver;
28 import static catalog.ResolutionChecker.checkPubIdResolution;
29 import static catalog.ResolutionChecker.checkSysIdResolution;
30 import static catalog.ResolutionChecker.checkUriResolution;
31
32 import javax.xml.catalog.CatalogResolver;
33
34 import org.testng.annotations.DataProvider;
35 import org.testng.annotations.Listeners;
36 import org.testng.annotations.Test;
37
38 /*
39 * @test
40 * @bug 8077931
41 * @library /javax/xml/jaxp/libs
42 * @run testng/othervm -DrunSecMngr=true catalog.NextCatalogTest
43 * @run testng/othervm catalog.NextCatalogTest
44 * @summary Get matched URIs from system, public and uri entries respectively,
45 * but some of the entries are defined in none-current catalog files.
46 */
47 @Listeners({jaxp.library.FilePolicy.class})
48 public class NextCatalogTest {
49
50 private static final String CATALOG_NEXTCATALOGLEFT
51 = "nextCatalog-left.xml";
52 private static final String CATALOG_NEXTCATALOGRIGHT
136 { "http://remote/dtd/uri/docBob.dtd",
137 "http://local/base/dtd/docBobLeftURI.dtd" },
138
139 // The matched URI of the specified URI reference is defined in
140 // a two-level next catalog file.
141 { "http://remote/dtd/uri/docCarl.dtd",
142 "http://local/base/dtd/docCarlURI.dtd" },
143
144 // Multiple catalog files, which are defined as next catalog,
145 // have the matched uri entries of the specified URI reference.
146 // But finally, the returned matched URI is the first found.
147 { "http://remote/dtd/uri/docDuplicate.dtd",
148 "http://local/base/dtd/docDuplicateLeftURI.dtd" } };
149 }
150
151 private CatalogResolver createEntityResolver() {
152 return catalogResolver(CATALOG_NEXTCATALOGLEFT,
153 CATALOG_NEXTCATALOGRIGHT);
154 }
155
156 private CatalogResolver createUriResolver() {
157 return catalogUriResolver(CATALOG_NEXTCATALOGLEFT,
158 CATALOG_NEXTCATALOGRIGHT);
159 }
160 }
|