Search in sources :

Example 1 with MockJspWriter

use of org.springframework.mock.web.MockJspWriter in project logging-log4j2 by apache.

the class DumpTagTest method setUp.

@Before
public void setUp() {
    this.output = new ByteArrayOutputStream();
    this.writer = new OutputStreamWriter(this.output, UTF8);
    this.context = new MockPageContext() {

        private final MockJspWriter jspWriter = new MockJspWriter(writer);

        @Override
        public JspWriter getOut() {
            return this.jspWriter;
        }
    };
    this.tag = new DumpTag();
    this.tag.setPageContext(this.context);
}
Also used : MockPageContext(org.springframework.mock.web.MockPageContext) MockJspWriter(org.springframework.mock.web.MockJspWriter) OutputStreamWriter(java.io.OutputStreamWriter) ByteArrayOutputStream(java.io.ByteArrayOutputStream) JspWriter(javax.servlet.jsp.JspWriter) MockJspWriter(org.springframework.mock.web.MockJspWriter) Before(org.junit.Before)

Aggregations

ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 OutputStreamWriter (java.io.OutputStreamWriter)1 JspWriter (javax.servlet.jsp.JspWriter)1 Before (org.junit.Before)1 MockJspWriter (org.springframework.mock.web.MockJspWriter)1 MockPageContext (org.springframework.mock.web.MockPageContext)1