Introduce LoopbackBlobStore
(fix test case names, previously breaking surefire XML output)
@@ -221,7 +221,7 @@ public class LoopbackBlobStoreTest {
assertEquals(numberOfBytesRead,
expectedNumberOfBytesRead);
assertEquals(expectedBufferContent,
- actualInputStreamAsString);
+ encodeBufferFreeSpace(actualInputStreamAsString));
}
}
}
@@ -281,25 +281,25 @@ public class LoopbackBlobStoreTest {
new Object[]{
"IDX1", 4, 0, 0, 4, "", 0},
new Object[]{
- "IDX1", 4, 4, 0, 4, "\0\0\0\0", 0},
+ "IDX1", 4, 4, 0, 4, "####", 0},
new Object[]{
- "IDX1", 0, 5, 0, 4, "IDX1\0", 4},
+ "IDX1", 0, 5, 0, 4, "IDX1#", 4},
new Object[]{
- "IDX1", 1, 4, 0, 3, "DX1\0", 3},
+ "IDX1", 1, 4, 0, 3, "DX1#", 3},
new Object[]{
- "IDX1", 1, 4, 0, 4, "DX1\0", 3},
+ "IDX1", 1, 4, 0, 4, "DX1#", 3},
new Object[]{
- "ID2XXXXXXXXXXXYYZYZYYXYZYZYXYZQ", 10, 20, 3, 10, "\0\0\0XXXXYYZYZY\0\0\0\0\0\0\0", 10},
+ "ID2XXXXXXXXXXXYYZYZYYXYZYZYXYZQ", 10, 20, 3, 10, "###XXXXYYZYZY#######", 10},
new Object[]{
- "ID2XXXXXXXXXXXYYZY", 10, 20, 3, 10, "\0\0\0XXXXYYZY\0\0\0\0\0\0\0\0\0", 8},
+ "ID2XXXXXXXXXXXYYZY", 10, 20, 3, 10, "###XXXXYYZY#########", 8},
new Object[]{
- "ID2XXXXXXXXXXXYYZY", 10, 20, 3, 10, "\0\0\0XXXXYYZY\0\0\0\0\0\0\0\0\0", 8},
+ "ID2XXXXXXXXXXXYYZY", 10, 20, 3, 10, "###XXXXYYZY#########", 8},
new Object[]{
- "ID2XXXXXXXXXXXYYZY", 10, 11, 3, 10, "\0\0\0XXXXYYZY", 8},
+ "ID2XXXXXXXXXXXYYZY", 10, 11, 3, 10, "###XXXXYYZY", 8},
new Object[]{
- "ID2XXXXXXXXXXXYYZY", 10, 11, 2, 10, "\0\0XXXXYYZY\0", 8},
+ "ID2XXXXXXXXXXXYYZY", 10, 11, 2, 10, "##XXXXYYZY#", 8},
new Object[]{
- "ID2XXXXXXXXXXXYYZY", 10, 11, 1, 10, "\0XXXXYYZY\0\0", 8},
+ "ID2XXXXXXXXXXXYYZY", 10, 11, 1, 10, "#XXXXYYZY##", 8},
};
}
@@ -346,6 +346,10 @@ public class LoopbackBlobStoreTest {
};
}
+ private String encodeBufferFreeSpace(final String actualInputStreamAsString) {
+ return actualInputStreamAsString.replace('\0', '#');
+ }
+
private InputStream adaptToUtf8InputStream(final String string)
throws IOException {
return IOUtils.toInputStream(string,
