}
@Test
public void testInit() throws ServletException {
StaticServlet staticServlet = new StaticServlet();
RequestChain servlet = new ServletContainer("/foo/*",staticServlet);
StagingServletContext context = new StagingServletContext(){
public String getMimeType(String file){
return null;
}
@Override
protected ServerResource getServerResource(String path) {
// TODO Auto-generated method stub
return null;
}
@Override
protected void valueBound(ServletContextAttributeEvent event) {
// TODO Auto-generated method stub
}
@Override
protected void valueReplaced(ServletContextAttributeEvent event) {
// TODO Auto-generated method stub
}
@Override
protected void valueUnbound(
ServletContextAttributeEvent servletContextAttributeEvent) {
// TODO Auto-generated method stub
}
};
servlet.init(context);
assertSame(context,staticServlet.getServletContext());
}