[seam-commits] Seam SVN: r9270 - trunk/src/main/org/jboss/seam/mock.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Sun Oct 12 09:52:17 EDT 2008


Author: pete.muir at jboss.org
Date: 2008-10-12 09:52:15 -0400 (Sun, 12 Oct 2008)
New Revision: 9270

Modified:
   trunk/src/main/org/jboss/seam/mock/MockServletContext.java
Log:
Shouldn't choke on not being able to find web.xml

Modified: trunk/src/main/org/jboss/seam/mock/MockServletContext.java
===================================================================
--- trunk/src/main/org/jboss/seam/mock/MockServletContext.java	2008-10-12 11:12:48 UTC (rev 9269)
+++ trunk/src/main/org/jboss/seam/mock/MockServletContext.java	2008-10-12 13:52:15 UTC (rev 9270)
@@ -21,12 +21,16 @@
 
 import org.dom4j.DocumentException;
 import org.dom4j.Element;
+import org.jboss.seam.log.LogProvider;
+import org.jboss.seam.log.Logging;
 import org.jboss.seam.util.IteratorEnumeration;
 import org.jboss.seam.util.XML;
 
 public class MockServletContext implements ServletContext
 {
 
+   private transient LogProvider log = Logging.getLogProvider(MockServletContext.class);
+   
    private Map<String, String> initParameters = new HashMap<String, String>();
    private Map<String, Object> attributes = new HashMap<String, Object>();
    
@@ -57,7 +61,7 @@
       }
       catch (URISyntaxException e)
       {
-         throw new IllegalStateException(e);
+         log.warn("Unable to find web.xml", e);
       }
    }
    
@@ -257,7 +261,14 @@
 
    public String getRealPath(String relativePath)
    {
-      return webappRoot.getAbsolutePath() + relativePath;
+      if (webappRoot != null)
+      {
+         return webappRoot.getAbsolutePath() + relativePath;
+      }
+      else
+      {
+         return relativePath;
+      }
    }
 
    public String getServerInfo()




More information about the seam-commits mailing list