Mantis - Resin
Viewing Issue Advanced Details
4162 feature always 08-04-10 16:11 06-18-12 17:01
reza  
ferg  
normal  
closed 4.0.10  
no change required  
none    
none  
0004162: Ability to Start Resin from IDE/JUnit Test
While using frameworks like HTTPUnit, it would be great to be able to automatically start and shut-down Resin like this:

@RunWith(ResinRunner.class) // Manages the embedded Resin life-cycle and should
// start the web/Servlet tier.
public class AlertServletTest {

  @Test
  public void testGetAlerts() {
    try {
      WebConversation webConversation = new WebConversation();
      webConversation.setHeaderField("Connection", "close");
      WebRequest webRequest = new GetMethodWebRequest(
          "http://localhost:8080/actionbazaar/alerts"); [^]
      webRequest.setParameter("user_id", "1111");
      WebResponse webResponse = webConversation.getResponse(webRequest);
      assertEquals(5, webResponse.getDOM().getElementsByTagName("alert")
                    .getLength());
    } catch (IOException e) {
      e.printStackTrace();
    } catch (SAXException e) {
      e.printStackTrace();
    }
  }
}

Just as in the case of bean container runner/EJB embedded container, the class-path should be scanned to automatically find and deploy web.xml, bean.xml, persistence.xml etc. It should also be possible to specially provide additive/alternative deployment descriptors, including resin.xml.

There are no notes attached to this issue.