List of usage examples for com.liferay.portal.kernel.servlet HttpHeaders CONTENT_RANGE
String CONTENT_RANGE
To view the source code for com.liferay.portal.kernel.servlet HttpHeaders CONTENT_RANGE.
Click Source Link
From source file:com.liferay.document.library.webserver.test.WebServerRangeTest.java
License:Open Source License
@Test public void testSingleRangeByte() throws Exception { MockHttpServletResponse mockHttpServletResponse = testRange("bytes=10-10"); Assert.assertEquals("1", mockHttpServletResponse.getHeader(HttpHeaders.CONTENT_LENGTH)); Assert.assertEquals("bytes 10-10/80", mockHttpServletResponse.getHeader(HttpHeaders.CONTENT_RANGE)); Assert.assertEquals("B", mockHttpServletResponse.getContentAsString()); }
From source file:com.liferay.document.library.webserver.test.WebServerRangeTest.java
License:Open Source License
@Test public void testSingleRangeFirst() throws Exception { MockHttpServletResponse mockHttpServletResponse = testRange("bytes=0-9"); Assert.assertEquals("10", mockHttpServletResponse.getHeader(HttpHeaders.CONTENT_LENGTH)); Assert.assertEquals("bytes 0-9/80", mockHttpServletResponse.getHeader(HttpHeaders.CONTENT_RANGE)); Assert.assertEquals("A123456789", mockHttpServletResponse.getContentAsString()); }
From source file:com.liferay.document.library.webserver.test.WebServerRangeTest.java
License:Open Source License
@Test public void testSingleRangeLast() throws Exception { MockHttpServletResponse mockHttpServletResponse = testRange("bytes=70-79"); Assert.assertEquals("10", mockHttpServletResponse.getHeader(HttpHeaders.CONTENT_LENGTH)); Assert.assertEquals("bytes 70-79/80", mockHttpServletResponse.getHeader(HttpHeaders.CONTENT_RANGE)); Assert.assertArrayEquals(_UNICODE_DATA.getBytes(), mockHttpServletResponse.getContentAsByteArray()); }