JspWrapper(String path, RequestDispatcher requestDispatcher) {
		super();
		assert path != null;
		assert requestDispatcher != null;
		// quand ce RequestDispatcher est utilisé, le compteur est affiché
		// sauf si le paramètre displayed-counters dit le contraire
		JSP_COUNTER.setDisplayed(!COUNTER_HIDDEN);
		JSP_COUNTER.setUsed(true);
		this.path = path;
		this.requestDispatcher = requestDispatcher;
	}
@Test
	public void testJspWrapper() throws ServletException, IOException {
		assertNotNull("getJspCounter", JspWrapper.getJspCounter());

		final ServletContext servletContext = createNiceMock(ServletContext.class);
		final HttpServletRequest request = createNiceMock(HttpServletRequest.class);
		final HttpServletResponse response = createNiceMock(HttpServletResponse.class);
		final RequestDispatcher requestDispatcher = createNiceMock(RequestDispatcher.class);
		final RequestDispatcher requestDispatcherWithError = createNiceMock(
				RequestDispatcher.class);
		final RequestDispatcher requestDispatcherWithException = createNiceMock(
				RequestDispatcher.class);
		final String url1 = "test.jsp";
		final String url2 = "test.jsp?param=test2";
		final String url3 = "test.jsp?param=test3";
		final String url4 = null;
		expect(servletContext.getMajorVersion()).andReturn(5).anyTimes();
		expect(request.getRequestDispatcher(url1)).andReturn(requestDispatcher);
		expect(request.getRequestDispatcher(url2)).andReturn(requestDispatcherWithError);
		requestDispatcherWithError.forward(request, response);
		expectLastCall().andThrow(new UnknownError("erreur dans forward"));
		expect(request.getRequestDispatcher(url3)).andReturn(requestDispatcherWithException);
		requestDispatcherWithException.forward(request, response);
		expectLastCall().andThrow(new IllegalStateException("erreur dans forward"));
		expect(request.getRequestDispatcher(url4)).andReturn(null);

		replay(request);
		replay(response);
		replay(requestDispatcher);
		replay(requestDispatcherWithError);
		replay(requestDispatcherWithException);
		replay(servletContext);
		Parameters.initialize(servletContext);
		final HttpServletRequest wrappedRequest = JspWrapper.createHttpRequestWrapper(request,
				response);
		final RequestDispatcher wrappedRequestDispatcher = wrappedRequest
				.getRequestDispatcher(url1);
		wrappedRequestDispatcher.toString();
		wrappedRequestDispatcher.include(wrappedRequest, response);
		final RequestDispatcher wrappedRequestDispatcher2 = wrappedRequest
				.getRequestDispatcher(url2);
		try {
			wrappedRequestDispatcher2.forward(request, response);
		} catch (final UnknownError e) {
			assertNotNull("ok", e);
		}
		final RequestDispatcher wrappedRequestDispatcher3 = wrappedRequest
				.getRequestDispatcher(url3);
		try {
			wrappedRequestDispatcher3.forward(request, response);
		} catch (final IllegalStateException e) {
			assertNotNull("ok", e);
		}
		final RequestDispatcher wrappedRequestDispatcher4 = wrappedRequest
				.getRequestDispatcher(url4);
		assertNull("getRequestDispatcher(null)", wrappedRequestDispatcher4);
		verify(request);
		verify(response);
		verify(requestDispatcher);
		// verify ne marche pas ici car on fait une Error, verify(requestDispatcherWithError);
		verify(requestDispatcherWithException);
		verify(servletContext);
	}