From fd649b81d49fef2e6fb4f26a205ca35ca9dd76c6 Mon Sep 17 00:00:00 2001 From: kohsuke Date: Mon, 17 Mar 2008 02:07:21 +0000 Subject: [PATCH] Moved testng DTD from war to core, so that this resource can be accessed even when the code runs inside Maven process (#1426) I thought about leaving the look up from servlet in there, perhaps as a fallback, but realized that the behavior change between the master and the slaves are probably not desirable. git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@7810 71c3de6d-444a-0410-be80-ed276b4c234a --- core/src/main/java/hudson/tasks/junit/XMLEntityResolver.java | 2 +- {war => core/src/main}/resources/testng-1.0.dtd | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename {war => core/src/main}/resources/testng-1.0.dtd (100%) diff --git a/core/src/main/java/hudson/tasks/junit/XMLEntityResolver.java b/core/src/main/java/hudson/tasks/junit/XMLEntityResolver.java index 2b3cbbc79f..27e21adb3e 100644 --- a/core/src/main/java/hudson/tasks/junit/XMLEntityResolver.java +++ b/core/src/main/java/hudson/tasks/junit/XMLEntityResolver.java @@ -36,7 +36,7 @@ class XMLEntityResolver implements EntityResolver { LOGGER.fine("It's a TestNG document, will try to lookup DTD in classpath"); String dtdFileName = systemId.substring(TESTNG_NAMESPACE.length()); - URL url = Hudson.getInstance().servletContext.getResource('/' + dtdFileName); + URL url = getClass().getClassLoader().getResource(dtdFileName); if (url != null) return new InputSource(url.toString()); } diff --git a/war/resources/testng-1.0.dtd b/core/src/main/resources/testng-1.0.dtd similarity index 100% rename from war/resources/testng-1.0.dtd rename to core/src/main/resources/testng-1.0.dtd