title: Problem using MockRoundtrip class
body: <p>I have following code:</p>
  
  <pre><code>@Test
   public void testSaveValid() throws Exception {
    MockRoundtrip trip = new MockRoundtrip(mockServletContext,
      ContactFormActionBean.class, mockSession);
  
    trip.setParameter("contact.email", "test@test.com");
    trip.setParameter("contact.phoneNumber", "654-456-4567");
    trip.execute("save");
  
    ContactFormActionBean bean =
     trip.getActionBean(ContactFormActionBean.class);
  
    assertEquals(0,
      bean.getContext().getValidationErrors().size());
  
    PhoneNumber pn = bean.getContact().getPhoneNumber();
    assertEquals("654", pn.getAreaCode());
    assertEquals("456", pn.getPrefix());
    assertEquals("4567", pn.getSuffix());
  
    assertTrue(
      trip.getDestination().startsWith("/ContactList.action"));
   }
  </code></pre>
  
  <p>I encounter this error:</p>
  
  <pre><code>net.sourceforge.stripes.exception.StripesServletException: Unhandled exception in exception handler.
   at net.sourceforge.stripes.exception.DefaultExceptionHandler.handle(DefaultExceptionHandler.java:158)
   at net.sourceforge.stripes.controller.StripesFilter.doFilter(StripesFilter.java:249)
   at net.sourceforge.stripes.mock.MockFilterChain.doFilter(MockFilterChain.java:63)
   at net.sourceforge.stripes.mock.MockServletContext.acceptRequest(MockServletContext.java:255)
   at net.sourceforge.stripes.mock.MockRoundtrip.execute(MockRoundtrip.java:195)
   at net.sourceforge.stripes.mock.MockRoundtrip.execute(MockRoundtrip.java:207)
   at stripesbook.test.stripesmock.ContactFormActionBeanTest.testSaveValid(ContactFormActionBeanTest.java:96)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:585)
   at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
   at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
   at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
   at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
   at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
   at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
   at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
   at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
   at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
   at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
   at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
   at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
   at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
   at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
   at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
   at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
   at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
   at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
   at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
  </code></pre>
  
  <p>If I delete </p>
  
  <pre><code>trip.setParameter("contact.email", "test@test.com");
  trip.setParameter("contact.phoneNumber", "654-456-4567");
  </code></pre>
  
  <p>I won't get any errors but will get following message from jUnit:</p>
  
  <pre><code>java.lang.AssertionError: expected:&lt;0&gt; but was:&lt;1&gt;
  </code></pre>
  
  <p>which seems logical.
  This is my ContactFormActionBean class</p>
  
  <pre><code>public class ContactFormActionBean extends ContactBaseActionBean {
  private static final String FORM="/WEB-INF/jsp/contact_form.jsp";
  
  @DefaultHandler
  public Resolution form() {
      return new ForwardResolution(FORM);
  }
  public Resolution save() {
      Contact contact = getContact();
      contact.setUser(getUser());
      contactDao.save(contact);
      contactDao.commit();
      getContext().getMessages().add(
          getLocalizableMessage("contactSaved", contact)
      );
      return new RedirectResolution(ContactListActionBean.class);
  }
  @ValidationMethod(on="save")
  public void validateEmailUnique(ValidationErrors errors) {
      String email = getContact().getEmail();
      Contact other = contactDao.findByEmail(email, getUser());
      if (other != null &amp;&amp; !other.equals(getContact())) {
          errors.add("contact.email", new LocalizableError(
            getClass().getName()+".contactEmailAlreadyUsed", other));
      }
      }
  }
  </code></pre>
  
  <p>Why this error happens?</p>
  
  <p>[ADDED]</p>
  
  <p>This is my Setup() function where I configure mockServletContext before running any test functions:</p>
  
  <pre><code>... 
      private static MockServletContext mockServletContext;
      private static MockHttpSession mockSession;
  
      @BeforeClass
      public static void setup() throws Exception {
          mockServletContext = new MockServletContext("webmail");
  
          Map&lt;String,String&gt; params = new HashMap&lt;String,String&gt;();
          params.put("ActionResolver.Packages", "stripesbook.action");
  
          params.put("Extension.Packages", "stripesbook.ext,"
                  + "net.sourceforge.stripes.integration.spring");
  
          mockServletContext.addFilter(StripesFilter.class,
                  "StripesFilter", params);
  
          mockServletContext.setServlet(DispatcherServlet.class,
                  "DispatcherServlet", null);
  
          mockSession = new MockHttpSession(mockServletContext);
  
  
          mockServletContext.addInitParameter("contextConfigLocation",
          "/WEB-INF/applicationContext-test.xml");
  
          ContextLoaderListener springContextLoader =
              new ContextLoaderListener();
          springContextLoader.contextInitialized(
                  new ServletContextEvent(mockServletContext));
          // Load mock user
          MockRoundtrip trip = new MockRoundtrip(mockServletContext,
                  MockDataLoaderActionBean.class, mockSession);
          trip.execute();
  
          // Login mock user
          trip = new MockRoundtrip(mockServletContext,
                  LoginActionBean.class, mockSession);
          trip.setParameter("username", "freddy");
          trip.setParameter("password", "nadia");
          trip.execute("login");
      }
  ...
  </code></pre>
  
  <p>I think there could be some config problems cause when I remove </p>
  
  <pre><code>&lt;classpathentry kind="src" path="src/main/webapp" /&gt; 
  </code></pre>
  
  <p>from class path I get different error :</p>
  
  <pre><code>org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from ServletContext resource [/WEB-INF/applicationContext-test.xml]; nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/applicationContext-test.xml]
  </code></pre>