Author: pete.muir(a)jboss.org
Date: 2008-05-28 09:18:20 -0400 (Wed, 28 May 2008)
New Revision: 8294
Modified:
trunk/src/main/org/jboss/seam/mock/MockServletContext.java
Log:
Sometimes web.xml isn't present
Modified: trunk/src/main/org/jboss/seam/mock/MockServletContext.java
===================================================================
--- trunk/src/main/org/jboss/seam/mock/MockServletContext.java 2008-05-28 12:58:55 UTC
(rev 8293)
+++ trunk/src/main/org/jboss/seam/mock/MockServletContext.java 2008-05-28 13:18:20 UTC
(rev 8294)
@@ -35,9 +35,16 @@
{
try
{
- webInfRoot = new
File(getClass().getResource("/WEB-INF/web.xml").toURI()).getParentFile();
- webInfClassesRoot = new File(webInfRoot.getParentFile().getPath() +
"/classes");
- webappRoot = webInfRoot.getParentFile();
+ URL webxml = getClass().getResource("/WEB-INF/web.xml");
+ if (webxml != null)
+ {
+ webInfRoot = new File(webxml.toURI()).getParentFile();
+ if (webInfRoot != null)
+ {
+ webInfClassesRoot = new File(webInfRoot.getParentFile().getPath() +
"/classes");
+ webappRoot = webInfRoot.getParentFile();
+ }
+ }
}
catch (URISyntaxException e)
{
Show replies by date