Package org.apache.shale.test.mock

Examples of org.apache.shale.test.mock.MockServletOutputStream.content()


        assertEquals("text/x-plain", response.getContentType());
        MockServletOutputStream stream =
          (MockServletOutputStream) response.getOutputStream();
        assertNotNull(stream);
        assertTrue(stream.size() > VALID_RESOURCE_CONTENT.length());
        byte content[] = stream.content();
        for (int i = 0; i < VALID_RESOURCE_CONTENT.length(); i++) {
            byte b = (byte) ((int) VALID_RESOURCE_CONTENT.charAt(i));
            assertEquals("Byte at position " + i, b, content[i]);
        }
       
View Full Code Here


      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    content.send(this.response);
    MockServletOutputStream mockStream = (MockServletOutputStream) response.getOutputStream();
    byte[] bs = mockStream.content();
    assertEquals("Test", new String(bs));
  }

  /**
   * Test method for {@link org.ajax4jsf.webapp.CacheContent#getWriter(java.io.Writer)}.
View Full Code Here

        assertEquals("application/x-binary", response.getContentType());
        MockServletOutputStream stream =
          (MockServletOutputStream) response.getOutputStream();
        assertNotNull(stream);
        assertEquals(10, stream.size());
        byte content[] = stream.content();
        for (int i = 0; i < 10; i++) {
            assertEquals("Byte at position " + i, (byte) i, content[i]);
        }
        assertTrue(facesContext.getResponseComplete());
View Full Code Here

        assertEquals("application/x-binary", response.getContentType());
        MockServletOutputStream stream =
          (MockServletOutputStream) response.getOutputStream();
        assertNotNull(stream);
        assertEquals(10, stream.size());
        byte content[] = stream.content();
        for (int i = 0; i < 10; i++) {
            assertEquals("Byte at position " + i, (byte) i, content[i]);
        }
        assertTrue(facesContext.getResponseComplete());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.