Package ro.isdc.wro.util.io

Examples of ro.isdc.wro.util.io.NullOutputStream


      // mock request
      final HttpServletRequest request = Mockito.mock(HttpServletRequest.class);
      Mockito.when(request.getRequestURI()).thenReturn(group);
      // mock response
      final HttpServletResponse response = Mockito.mock(HttpServletResponse.class);
      Mockito.when(response.getOutputStream()).thenReturn(new DelegatingServletOutputStream(new NullOutputStream()));

      // init context
      final WroConfiguration config = Context.get().getConfig();
      Context.set(Context.webContext(request, response, Mockito.mock(FilterConfig.class)), config);
      // perform processing
View Full Code Here


    when(mockUriLocatorFactory.locate(Mockito.anyString())).thenReturn(WroUtil.EMPTY_STREAM);

    when(mockRequest.getAttribute(Mockito.anyString())).thenReturn(null);
    when(mockManagerFactory.create()).thenReturn(new BaseWroManagerFactory().create());
    when(mockFilterConfig.getServletContext()).thenReturn(mockServletContext);
    when(mockResponse.getOutputStream()).thenReturn(new DelegatingServletOutputStream(new NullOutputStream()));

    victim = new WroFilter() {
      @Override
      protected void onException(final Exception e, final HttpServletResponse response, final FilterChain chain) {
        throw WroRuntimeException.wrap(e);
View Full Code Here

      throws Exception {
    victim = new GzipFilter();
    MockitoAnnotations.initMocks(this);
    when(mockRequest.getInputStream()).thenReturn(
        new DelegatingServletInputStream(new ByteArrayInputStream("".getBytes())));
    when(mockResponse.getOutputStream()).thenReturn(new DelegatingServletOutputStream(new NullOutputStream()));
    // mock chaining
    Mockito.doAnswer(new Answer<Void>() {
      public Void answer(final InvocationOnMock invocation)
          throws Throwable {
        final ServletRequest request = (ServletRequest) invocation.getArguments()[0];
View Full Code Here

TOP

Related Classes of ro.isdc.wro.util.io.NullOutputStream

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.