BATCH-1959: Fixed whitespace issues
This commit is contained in:
@@ -112,7 +112,7 @@ public class FlatFileItemWriterTests {
|
||||
private String readLine() throws IOException {
|
||||
return readLine("UTF-8");
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Read a line from the output file, if the reader has not been created, recreate. This method is only necessary
|
||||
* because running the tests in a UNIX environment locks the file if it's open for writing.
|
||||
@@ -124,8 +124,8 @@ public class FlatFileItemWriterTests {
|
||||
}
|
||||
|
||||
return reader.readLine();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* Properly close the output file reader.
|
||||
*/
|
||||
@@ -136,7 +136,7 @@ public class FlatFileItemWriterTests {
|
||||
reader = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testWriteWithMultipleOpen() throws Exception {
|
||||
writer.open(executionContext);
|
||||
@@ -242,7 +242,7 @@ public class FlatFileItemWriterTests {
|
||||
@Test
|
||||
public void testWriteWithConverter() throws Exception {
|
||||
writer.setLineAggregator(new LineAggregator<String>() {
|
||||
@Override
|
||||
@Override
|
||||
public String aggregate(String item) {
|
||||
return "FOO:" + item;
|
||||
}
|
||||
@@ -263,7 +263,7 @@ public class FlatFileItemWriterTests {
|
||||
@Test
|
||||
public void testWriteWithConverterAndString() throws Exception {
|
||||
writer.setLineAggregator(new LineAggregator<String>() {
|
||||
@Override
|
||||
@Override
|
||||
public String aggregate(String item) {
|
||||
return "FOO:" + item;
|
||||
}
|
||||
@@ -301,7 +301,7 @@ public class FlatFileItemWriterTests {
|
||||
|
||||
writer.setFooterCallback(new FlatFileFooterCallback() {
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public void writeFooter(Writer writer) throws IOException {
|
||||
writer.write("footer");
|
||||
}
|
||||
@@ -356,7 +356,7 @@ public class FlatFileItemWriterTests {
|
||||
|
||||
writer.open(executionContext);
|
||||
new TransactionTemplate(transactionManager).execute(new TransactionCallback() {
|
||||
@Override
|
||||
@Override
|
||||
public Object doInTransaction(TransactionStatus status) {
|
||||
try {
|
||||
writer.write(Collections.singletonList(TEST_STRING));
|
||||
@@ -377,7 +377,7 @@ public class FlatFileItemWriterTests {
|
||||
|
||||
writer.setFooterCallback(new FlatFileFooterCallback() {
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public void writeFooter(Writer writer) throws IOException {
|
||||
writer.write("footer");
|
||||
}
|
||||
@@ -389,7 +389,7 @@ public class FlatFileItemWriterTests {
|
||||
PlatformTransactionManager transactionManager = new ResourcelessTransactionManager();
|
||||
|
||||
new TransactionTemplate(transactionManager).execute(new TransactionCallback() {
|
||||
@Override
|
||||
@Override
|
||||
public Object doInTransaction(TransactionStatus status) {
|
||||
try {
|
||||
// write some lines
|
||||
@@ -412,7 +412,7 @@ public class FlatFileItemWriterTests {
|
||||
writer.open(executionContext);
|
||||
|
||||
new TransactionTemplate(transactionManager).execute(new TransactionCallback() {
|
||||
@Override
|
||||
@Override
|
||||
public Object doInTransaction(TransactionStatus status) {
|
||||
try {
|
||||
// write more lines
|
||||
@@ -440,7 +440,7 @@ public class FlatFileItemWriterTests {
|
||||
assertEquals(8, executionContext.getLong(ClassUtils.getShortName(FlatFileItemWriter.class) + ".written"));
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
// BATCH-1959
|
||||
public void testTransactionalRestartWithMultiByteCharacterUTF8() throws Exception {
|
||||
@@ -457,7 +457,7 @@ public class FlatFileItemWriterTests {
|
||||
writer.setEncoding(encoding);
|
||||
writer.setFooterCallback(new FlatFileFooterCallback() {
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public void writeFooter(Writer writer) throws IOException {
|
||||
writer.write("footer");
|
||||
}
|
||||
@@ -469,7 +469,7 @@ public class FlatFileItemWriterTests {
|
||||
PlatformTransactionManager transactionManager = new ResourcelessTransactionManager();
|
||||
|
||||
new TransactionTemplate(transactionManager).execute(new TransactionCallback() {
|
||||
@Override
|
||||
@Override
|
||||
public Object doInTransaction(TransactionStatus status) {
|
||||
try {
|
||||
// write some lines
|
||||
@@ -492,7 +492,7 @@ public class FlatFileItemWriterTests {
|
||||
writer.open(executionContext);
|
||||
|
||||
new TransactionTemplate(transactionManager).execute(new TransactionCallback() {
|
||||
@Override
|
||||
@Override
|
||||
public Object doInTransaction(TransactionStatus status) {
|
||||
try {
|
||||
// write more lines
|
||||
@@ -517,7 +517,7 @@ public class FlatFileItemWriterTests {
|
||||
assertEquals("footer", readLine(encoding));
|
||||
|
||||
// 8 lines were written to the file in total
|
||||
assertEquals(8, executionContext.getLong(ClassUtils.getShortName(FlatFileItemWriter.class) + ".written"));
|
||||
assertEquals(8, executionContext.getLong(ClassUtils.getShortName(FlatFileItemWriter.class) + ".written"));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -604,7 +604,7 @@ public class FlatFileItemWriterTests {
|
||||
public void testWriteFooter() throws Exception {
|
||||
writer.setFooterCallback(new FlatFileFooterCallback() {
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public void writeFooter(Writer writer) throws IOException {
|
||||
writer.write("a\nb");
|
||||
}
|
||||
@@ -622,7 +622,7 @@ public class FlatFileItemWriterTests {
|
||||
public void testWriteHeader() throws Exception {
|
||||
writer.setHeaderCallback(new FlatFileHeaderCallback() {
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public void writeHeader(Writer writer) throws IOException {
|
||||
writer.write("a\nb");
|
||||
}
|
||||
@@ -642,7 +642,7 @@ public class FlatFileItemWriterTests {
|
||||
@Test
|
||||
public void testWriteWithAppendAfterHeaders() throws Exception {
|
||||
writer.setHeaderCallback(new FlatFileHeaderCallback() {
|
||||
@Override
|
||||
@Override
|
||||
public void writeHeader(Writer writer) throws IOException {
|
||||
writer.write("a\nb");
|
||||
}
|
||||
@@ -668,7 +668,7 @@ public class FlatFileItemWriterTests {
|
||||
public void testWriteHeaderAndDeleteOnExit() throws Exception {
|
||||
writer.setHeaderCallback(new FlatFileHeaderCallback() {
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public void writeHeader(Writer writer) throws IOException {
|
||||
writer.write("a\nb");
|
||||
}
|
||||
@@ -693,12 +693,12 @@ public class FlatFileItemWriterTests {
|
||||
writer.write(Collections.singletonList("test2"));
|
||||
assertEquals("test2", readLine());
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testWriteHeaderAndDeleteOnExitReopen() throws Exception {
|
||||
writer.setHeaderCallback(new FlatFileHeaderCallback() {
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public void writeHeader(Writer writer) throws IOException {
|
||||
writer.write("a\nb");
|
||||
}
|
||||
@@ -716,8 +716,8 @@ public class FlatFileItemWriterTests {
|
||||
assertEquals("a", readLine());
|
||||
assertEquals("b", readLine());
|
||||
assertEquals("test2", readLine());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDeleteOnExitNoRecordsWrittenAfterRestart() throws Exception {
|
||||
writer.setShouldDeleteIfEmpty(true);
|
||||
@@ -735,7 +735,7 @@ public class FlatFileItemWriterTests {
|
||||
public void testWriteHeaderAfterRestartOnFirstChunk() throws Exception {
|
||||
writer.setHeaderCallback(new FlatFileHeaderCallback() {
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public void writeHeader(Writer writer) throws IOException {
|
||||
writer.write("a\nb");
|
||||
}
|
||||
@@ -761,7 +761,7 @@ public class FlatFileItemWriterTests {
|
||||
public void testWriteHeaderAfterRestartOnSecondChunk() throws Exception {
|
||||
writer.setHeaderCallback(new FlatFileHeaderCallback() {
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public void writeHeader(Writer writer) throws IOException {
|
||||
writer.write("a\nb");
|
||||
}
|
||||
@@ -800,7 +800,7 @@ public class FlatFileItemWriterTests {
|
||||
|
||||
writer.setLineAggregator(new LineAggregator<String>() {
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public String aggregate(String item) {
|
||||
if (item.equals("2")) {
|
||||
throw new RuntimeException("aggregation failed on " + item);
|
||||
|
||||
Reference in New Issue
Block a user