Example usage for org.springframework.web.servlet SimpleWebApplicationContext refresh

List of usage examples for org.springframework.web.servlet SimpleWebApplicationContext refresh

Introduction

In this page you can find the example usage for org.springframework.web.servlet SimpleWebApplicationContext refresh.

Prototype

@Override
    public void refresh() throws BeansException 

Source Link

Usage

From source file:org.openmrs.web.taglib.OpenmrsMessageTagTest.java

@Before
public void createMockPageContext() throws Exception {

    MockServletContext sc = new MockServletContext();
    SimpleWebApplicationContext wac = new SimpleWebApplicationContext();
    wac.setServletContext(sc);//from w  ww . j a  va  2s .c o  m
    wac.setNamespace("test");
    wac.refresh();

    MockHttpServletRequest request = new MockHttpServletRequest(sc);
    request.addPreferredLocale(Context.getLocale());
    MockHttpServletResponse response = new MockHttpServletResponse();

    request.setAttribute(DispatcherServlet.WEB_APPLICATION_CONTEXT_ATTRIBUTE, wac);

    openmrsMessageTag = new OpenmrsMessageTag();
    mockPageContext = new MockPageContext(sc, request, response);
    openmrsMessageTag.setPageContext(mockPageContext);
}