// Path: jsptest-generic/jsptest-compiler-api/src/main/java/net/sf/jsptest/compiler/api/JspExecution.java
// public interface JspExecution {
// 
//     String getRenderedResponse();
// }
// 
// Path: jsptest-jsp20/src/main/java/net/sf/jsptest/compiler/jsp20/mock/MockJspWriter.java
// public class MockJspWriter extends JspWriter {
// 
//     private Log log;
//     private PrintWriter writer;
//     private StringWriter stringWriter;
// 
//     public String getContents() {
//         return stringWriter.toString();
//     }
// 
//     public MockJspWriter() {
//         super(1024, true);
//         log = LogFactory.getLog(getClass());
//         stringWriter = new StringWriter();
//         writer = new PrintWriter(stringWriter, true);
//     }
// 
//     public void newLine() throws IOException {
//         writer.println();
//     }
// 
//     public void print(boolean x) throws IOException {
//         writer.print(x);
//     }
// 
//     public void print(char x) throws IOException {
//         writer.print(x);
//     }
// 
//     public void print(int x) throws IOException {
//         writer.print(x);
//     }
// 
//     public void print(long x) throws IOException {
//         writer.print(x);
//     }
// 
//     public void print(float x) throws IOException {
//         writer.print(x);
//     }
// 
//     public void print(double x) throws IOException {
//         writer.print(x);
//     }
// 
//     public void print(char[] x) throws IOException {
//         writer.print(x);
//     }
// 
//     public void print(String x) throws IOException {
//         writer.print(x);
//     }
// 
//     public void print(Object x) throws IOException {
//         writer.print(x);
//     }
// 
//     public void println() throws IOException {
//         writer.println();
//     }
// 
//     public void println(boolean x) throws IOException {
//         writer.println(x);
//     }
// 
//     public void println(char x) throws IOException {
//         writer.println(x);
//     }
// 
//     public void println(int x) throws IOException {
//         writer.println(x);
//     }
// 
//     public void println(long x) throws IOException {
//         writer.println(x);
//     }
// 
//     public void println(float x) throws IOException {
//         writer.println(x);
//     }
// 
//     public void println(double x) throws IOException {
//         writer.println(x);
//     }
// 
//     public void println(char[] x) throws IOException {
//         writer.println(x);
//     }
// 
//     public void println(String x) throws IOException {
//         writer.println(x);
//     }
// 
//     public void println(Object x) throws IOException {
//         writer.println(x);
//     }
// 
//     public void clear() throws IOException {
//         notImplemented("clear()");
//     }
// 
//     public void clearBuffer() throws IOException {
//         notImplemented("clearBuffer()");
//     }
// 
//     public void flush() throws IOException {
//         writer.flush();
//     }
// 
//     public void close() throws IOException {
//         writer.close();
//     }
// 
//     public int getRemaining() {
//         notImplemented("getRemaining()");
//         return 0;
//     }
// 
//     public void write(char[] x, int start, int length) throws IOException {
//         writer.write(x, start, length);
//     }
// 
//     private void notImplemented(String methodSignature) {
//         log.error(getClass().getName() + "#" + methodSignature + " not implemented");
//     }
// }


import java.io.IOException;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import javax.servlet.jsp.JspFactory;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.PageContext;
import junit.framework.TestCase;
import net.sf.jsptest.compiler.api.JspExecution;
import net.sf.jsptest.compiler.jsp20.mock.MockJspWriter;
        };
    }

    public void testHttpMethodIsPassedToTheServletInstance() throws Exception {
        simulateRequest("GET");
        assertOutputContains("httpMethod=GET");
        simulateRequest("POST");
        assertOutputContains("httpMethod=POST");
    }

    public void testRequestParametersArePassedToTheServletInstance() throws Exception {
        simulateRequest();
        assertOutputContains("REQPARM=PARAMVAL");
    }
    
    public void testRequestAttributesArePassedToTheServletInstance() throws Exception {
        simulateRequest();
        assertOutputContains("REQATTR=REQVALUE");
    }

    public void testSessionAttributesArePassedToTheServletInstance() throws Exception {
        simulateRequest();
        assertOutputContains("SESATTR=SESVALUE");
    }

    private void simulateRequest() {
        simulateRequest("GET");
    }

    private void simulateRequest(String method) {
// Path: jsptest-generic/jsptest-compiler-api/src/main/java/net/sf/jsptest/compiler/api/JspExecution.java
// public interface JspExecution {
// 
//     String getRenderedResponse();
// }
// 
// Path: jsptest-jsp20/src/main/java/net/sf/jsptest/compiler/jsp20/mock/MockJspWriter.java
// public class MockJspWriter extends JspWriter {
// 
//     private Log log;
//     private PrintWriter writer;
//     private StringWriter stringWriter;
// 
//     public String getContents() {
//         return stringWriter.toString();
//     }
// 
//     public MockJspWriter() {
//         super(1024, true);
//         log = LogFactory.getLog(getClass());
//         stringWriter = new StringWriter();
//         writer = new PrintWriter(stringWriter, true);
//     }
// 
//     public void newLine() throws IOException {
//         writer.println();
//     }
// 
//     public void print(boolean x) throws IOException {
//         writer.print(x);
//     }
// 
//     public void print(char x) throws IOException {
//         writer.print(x);
//     }
// 
//     public void print(int x) throws IOException {
//         writer.print(x);
//     }
// 
//     public void print(long x) throws IOException {
//         writer.print(x);
//     }
// 
//     public void print(float x) throws IOException {
//         writer.print(x);
//     }
// 
//     public void print(double x) throws IOException {
//         writer.print(x);
//     }
// 
//     public void print(char[] x) throws IOException {
//         writer.print(x);
//     }
// 
//     public void print(String x) throws IOException {
//         writer.print(x);
//     }
// 
//     public void print(Object x) throws IOException {
//         writer.print(x);
//     }
// 
//     public void println() throws IOException {
//         writer.println();
//     }
// 
//     public void println(boolean x) throws IOException {
//         writer.println(x);
//     }
// 
//     public void println(char x) throws IOException {
//         writer.println(x);
//     }
// 
//     public void println(int x) throws IOException {
//         writer.println(x);
//     }
// 
//     public void println(long x) throws IOException {
//         writer.println(x);
//     }
// 
//     public void println(float x) throws IOException {
//         writer.println(x);
//     }
// 
//     public void println(double x) throws IOException {
//         writer.println(x);
//     }
// 
//     public void println(char[] x) throws IOException {
//         writer.println(x);
//     }
// 
//     public void println(String x) throws IOException {
//         writer.println(x);
//     }
// 
//     public void println(Object x) throws IOException {
//         writer.println(x);
//     }
// 
//     public void clear() throws IOException {
//         notImplemented("clear()");
//     }
// 
//     public void clearBuffer() throws IOException {
//         notImplemented("clearBuffer()");
//     }
// 
//     public void flush() throws IOException {
//         writer.flush();
//     }
// 
//     public void close() throws IOException {
//         writer.close();
//     }
// 
//     public int getRemaining() {
//         notImplemented("getRemaining()");
//         return 0;
//     }
// 
//     public void write(char[] x, int start, int length) throws IOException {
//         writer.write(x, start, length);
//     }
// 
//     private void notImplemented(String methodSignature) {
//         log.error(getClass().getName() + "#" + methodSignature + " not implemented");
//     }
// }


// Path: jsptest-jsp20/src/test/java/net/sf/jsptest/compiler/jsp20/TestJspImpl.java
import java.io.IOException;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import javax.servlet.jsp.JspFactory;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.PageContext;
import junit.framework.TestCase;
import net.sf.jsptest.compiler.api.JspExecution;
import net.sf.jsptest.compiler.jsp20.mock.MockJspWriter;

        };
    }

    public void testHttpMethodIsPassedToTheServletInstance() throws Exception {
        simulateRequest("GET");
        assertOutputContains("httpMethod=GET");
        simulateRequest("POST");
        assertOutputContains("httpMethod=POST");
    }

    public void testRequestParametersArePassedToTheServletInstance() throws Exception {
        simulateRequest();
        assertOutputContains("REQPARM=PARAMVAL");
    }
    
    public void testRequestAttributesArePassedToTheServletInstance() throws Exception {
        simulateRequest();
        assertOutputContains("REQATTR=REQVALUE");
    }

    public void testSessionAttributesArePassedToTheServletInstance() throws Exception {
        simulateRequest();
        assertOutputContains("SESATTR=SESVALUE");
    }

    private void simulateRequest() {
        simulateRequest("GET");
    }

    private void simulateRequest(String method) {
        JspExecution execution = jspImpl.request(method, requestAttributes, sessionAttributes, requestParameters);