|
|
@@ -19,7 +19,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
|
|
|
*
|
|
|
* @author zsjz
|
|
|
*/
|
|
|
-class BcpLineReaderTest {
|
|
|
+class EdsLineReaderTest {
|
|
|
|
|
|
@TempDir
|
|
|
Path tempDir;
|
|
|
@@ -29,7 +29,7 @@ class BcpLineReaderTest {
|
|
|
Path file = writeFile("a", "b", "c");
|
|
|
List<List<String>> batches = new ArrayList<>();
|
|
|
|
|
|
- BcpLineReader.read(file, StandardCharsets.UTF_8, 1, 10, batches::add);
|
|
|
+ EdsLineReader.read(file, StandardCharsets.UTF_8, 1, 10, batches::add);
|
|
|
|
|
|
assertEquals(List.of(List.of("a", "b", "c")), batches);
|
|
|
}
|
|
|
@@ -39,7 +39,7 @@ class BcpLineReaderTest {
|
|
|
Path file = writeFile("a", "b", "c");
|
|
|
List<List<String>> batches = new ArrayList<>();
|
|
|
|
|
|
- BcpLineReader.read(file, StandardCharsets.UTF_8, 2, 10, batches::add);
|
|
|
+ EdsLineReader.read(file, StandardCharsets.UTF_8, 2, 10, batches::add);
|
|
|
|
|
|
assertEquals(List.of(List.of("b", "c")), batches);
|
|
|
}
|
|
|
@@ -49,7 +49,7 @@ class BcpLineReaderTest {
|
|
|
Path file = writeFile("a", "b", "c", "d", "e");
|
|
|
List<List<String>> batches = new ArrayList<>();
|
|
|
|
|
|
- BcpLineReader.read(file, StandardCharsets.UTF_8, 1, 2, batches::add);
|
|
|
+ EdsLineReader.read(file, StandardCharsets.UTF_8, 1, 2, batches::add);
|
|
|
|
|
|
assertEquals(List.of(List.of("a", "b"), List.of("c", "d"), List.of("e")), batches);
|
|
|
}
|
|
|
@@ -60,7 +60,7 @@ class BcpLineReaderTest {
|
|
|
List<List<String>> batches = new ArrayList<>();
|
|
|
AtomicInteger calls = new AtomicInteger();
|
|
|
|
|
|
- assertDoesNotThrow(() -> BcpLineReader.read(file, StandardCharsets.UTF_8, 1, 1, batch -> {
|
|
|
+ assertDoesNotThrow(() -> EdsLineReader.read(file, StandardCharsets.UTF_8, 1, 1, batch -> {
|
|
|
batches.add(batch);
|
|
|
if (calls.incrementAndGet() == 2) {
|
|
|
throw new IllegalStateException("stop");
|
|
|
@@ -75,7 +75,7 @@ class BcpLineReaderTest {
|
|
|
Path file = tempDir.resolve("not-exists.bcp");
|
|
|
List<List<String>> batches = new ArrayList<>();
|
|
|
|
|
|
- assertDoesNotThrow(() -> BcpLineReader.read(file, StandardCharsets.UTF_8, 1, 10, batches::add));
|
|
|
+ assertDoesNotThrow(() -> EdsLineReader.read(file, StandardCharsets.UTF_8, 1, 10, batches::add));
|
|
|
assertTrue(batches.isEmpty());
|
|
|
}
|
|
|
|