[seam-commits] Seam SVN: r8294 - trunk/src/main/org/jboss/seam/mock.
seam-commits at lists.jboss.org
seam-commits at lists.jboss.org
Wed May 28 09:18:20 EDT 2008
Author: pete.muir at 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)
{
More information about the seam-commits
mailing list