From 041437f3eea416bef2c5486480935cbc5c78a8c6 Mon Sep 17 00:00:00 2001 From: Arjen Poutsma Date: Mon, 18 Jul 2016 17:08:46 +0200 Subject: [PATCH] Fixed DataBufferUtilsTest on Windows DataBufferUtilsTests checked for newline characters before, resulting in failures on Windows. --- .../buffer/support/DataBufferUtilsTests.java | 21 ++++++++++--------- .../buffer/support/DataBufferUtilsTests.txt | 5 +---- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/spring-core/src/test/java/org/springframework/core/io/buffer/support/DataBufferUtilsTests.java b/spring-core/src/test/java/org/springframework/core/io/buffer/support/DataBufferUtilsTests.java index fdb2d68f3d..caf24b4c61 100644 --- a/spring-core/src/test/java/org/springframework/core/io/buffer/support/DataBufferUtilsTests.java +++ b/spring-core/src/test/java/org/springframework/core/io/buffer/support/DataBufferUtilsTests.java @@ -42,15 +42,15 @@ public class DataBufferUtilsTests extends AbstractDataBufferAllocatingTestCase { .toURI(); FileChannel channel = FileChannel.open(Paths.get(uri), StandardOpenOption.READ); - Flux flux = DataBufferUtils.read(channel, this.bufferFactory, 4); + Flux flux = DataBufferUtils.read(channel, this.bufferFactory, 3); TestSubscriber .subscribe(flux) .assertNoError() .assertComplete() .assertValuesWith( - stringConsumer("foo\n"), stringConsumer("bar\n"), - stringConsumer("baz\n"), stringConsumer("qux\n")); + stringConsumer("foo"), stringConsumer("bar"), + stringConsumer("baz"), stringConsumer("qux")); assertFalse(channel.isOpen()); } @@ -61,16 +61,17 @@ public class DataBufferUtilsTests extends AbstractDataBufferAllocatingTestCase { .toURI(); FileChannel channel = FileChannel.open(Paths.get(uri), StandardOpenOption.READ); - Flux flux = DataBufferUtils.read(channel, this.bufferFactory, 3); + Flux flux = DataBufferUtils.read(channel, this.bufferFactory, 2); TestSubscriber .subscribe(flux) .assertNoError() .assertComplete() .assertValuesWith( - stringConsumer("foo"), stringConsumer("\nba"), - stringConsumer("r\nb"), stringConsumer("az\n"), - stringConsumer("qux"), stringConsumer("\n")); + stringConsumer("fo"), stringConsumer("ob"), + stringConsumer("ar"), stringConsumer("ba"), + stringConsumer("zq"), stringConsumer("ux") + ); assertFalse(channel.isOpen()); } @@ -80,15 +81,15 @@ public class DataBufferUtilsTests extends AbstractDataBufferAllocatingTestCase { InputStream is = DataBufferUtilsTests.class .getResourceAsStream("DataBufferUtilsTests.txt"); - Flux flux = DataBufferUtils.read(is, this.bufferFactory, 4); + Flux flux = DataBufferUtils.read(is, this.bufferFactory, 3); TestSubscriber .subscribe(flux) .assertNoError() .assertComplete() .assertValuesWith( - stringConsumer("foo\n"), stringConsumer("bar\n"), - stringConsumer("baz\n"), stringConsumer("qux\n")); + stringConsumer("foo"), stringConsumer("bar"), + stringConsumer("baz"), stringConsumer("qux")); } @Test diff --git a/spring-core/src/test/resources/org/springframework/core/io/buffer/support/DataBufferUtilsTests.txt b/spring-core/src/test/resources/org/springframework/core/io/buffer/support/DataBufferUtilsTests.txt index ab9b661144..d66e359855 100644 --- a/spring-core/src/test/resources/org/springframework/core/io/buffer/support/DataBufferUtilsTests.txt +++ b/spring-core/src/test/resources/org/springframework/core/io/buffer/support/DataBufferUtilsTests.txt @@ -1,4 +1 @@ -foo -bar -baz -qux +foobarbazqux \ No newline at end of file