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

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

Introduction

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

Prototype

@Override
    public void setNamespace(@Nullable String namespace) 

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 w  w .  ja  v a2 s. 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);
}