"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "flow-server/src/test/java/com/vaadin/flow/internal/ResponseWriterTest.java" between
vaadin-flow-4.0.5.tar.gz and vaadin-flow-4.0.6.tar.gz

About: Vaadin flow is a Java framework binding Vaadin web components to Java.

ResponseWriterTest.java  (vaadin-flow-4.0.5):ResponseWriterTest.java  (vaadin-flow-4.0.6)
skipping to change at line 378 skipping to change at line 378
assertResponse(Arrays.copyOfRange(fileJsContents, 10, 12)); assertResponse(Arrays.copyOfRange(fileJsContents, 10, 12));
assertResponseHeaders( assertResponseHeaders(
new Pair<>("Accept-Ranges", "bytes"), new Pair<>("Accept-Ranges", "bytes"),
new Pair<>("Content-Range", new Pair<>("Content-Range",
"bytes 10-11/" + fileJsContents.length)); "bytes 10-11/" + fileJsContents.length));
Assert.assertEquals(2L, responseContentLength.get()); Assert.assertEquals(2L, responseContentLength.get());
assertStatus(206); assertStatus(206);
} }
@Test @Test
public void writeByteRangeStartOmitted() throws IOException {
makePathsAvailable(PATH_JS);
mockRequestHeaders(new Pair<>("Range", "bytes=-10"));
assertResponse(
Arrays.copyOfRange(fileJsContents, 0, 11));
assertResponseHeaders(
new Pair<>("Accept-Ranges", "bytes"),
new Pair<>("Content-Range",
"bytes 0-10/" + fileJsContents.length));
Assert.assertEquals(11L, responseContentLength.get());
assertStatus(206);
}
@Test
public void writeByteRangeEndOmitted() throws IOException {
makePathsAvailable(PATH_JS);
mockRequestHeaders(new Pair<>("Range", "bytes=10-"));
assertResponse(
Arrays.copyOfRange(fileJsContents, 10, fileJsContents.length));
assertResponseHeaders(
new Pair<>("Accept-Ranges", "bytes"),
new Pair<>("Content-Range",
"bytes 10-15/" + fileJsContents.length));
Assert.assertEquals(6L, responseContentLength.get());
assertStatus(206);
}
@Test
public void writeByteRangePastFileSize() throws IOException { public void writeByteRangePastFileSize() throws IOException {
makePathsAvailable(PATH_JS); makePathsAvailable(PATH_JS);
mockRequestHeaders(new Pair<>("Range", "bytes=10-100000")); mockRequestHeaders(new Pair<>("Range", "bytes=10-100000"));
assertResponse( assertResponse(
Arrays.copyOfRange(fileJsContents, 10, fileJsContents.length)); Arrays.copyOfRange(fileJsContents, 10, fileJsContents.length));
assertResponseHeaders( assertResponseHeaders(
new Pair<>("Accept-Ranges", "bytes"), new Pair<>("Accept-Ranges", "bytes"),
new Pair<>("Content-Range", new Pair<>("Content-Range",
"bytes 10-15/" + fileJsContents.length)); "bytes 10-15/" + fileJsContents.length));
Assert.assertEquals(6L, responseContentLength.get()); Assert.assertEquals(6L, responseContentLength.get());
skipping to change at line 408 skipping to change at line 436
@Test @Test
public void writeByteRangeMalformed() throws IOException { public void writeByteRangeMalformed() throws IOException {
makePathsAvailable(PATH_JS); makePathsAvailable(PATH_JS);
mockRequestHeaders(new Pair<>("Range", "f-d-d___")); mockRequestHeaders(new Pair<>("Range", "f-d-d___"));
assertResponse(new byte[] {}); assertResponse(new byte[] {});
assertStatus(416); assertStatus(416);
} }
@Test @Test
public void writeByteRangeBothEndsOpen() throws IOException {
makePathsAvailable(PATH_JS);
mockRequestHeaders(new Pair<>("Range", "-"));
assertResponse(new byte[] {});
assertStatus(416);
}
@Test
public void writeByteRangeMultiPartSequential() throws IOException { public void writeByteRangeMultiPartSequential() throws IOException {
makePathsAvailable(PATH_JS); makePathsAvailable(PATH_JS);
mockRequestHeaders(new Pair<>("Range", "bytes=1-4, 5-6, 10-12")); mockRequestHeaders(new Pair<>("Range", "bytes=1-4, 5-6, 10-12"));
// "File.js contents" // "File.js contents"
// ^0123456789ABCDEF^ // ^0123456789ABCDEF^
assertMultipartResponse(PATH_JS, Arrays.asList( assertMultipartResponse(PATH_JS, Arrays.asList(
new Pair<>(new String[] {"Content-Range: bytes 1-4/16"}, new Pair<>(new String[] {"Content-Range: bytes 1-4/16"},
"ile.".getBytes()), "ile.".getBytes()),
new Pair<>(new String[] {"Content-Range: bytes 5-6/16"}, new Pair<>(new String[] {"Content-Range: bytes 5-6/16"},
"js".getBytes()), "js".getBytes()),
 End of changes. 2 change blocks. 
0 lines changed or deleted 36 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)