Address compiler warnings.
This commit is contained in:
parent
4e02db1272
commit
bf3f34c8b5
|
@ -53,8 +53,6 @@ import java.util.Vector;
|
||||||
import org.apache.commons.io.FileUtils;
|
import org.apache.commons.io.FileUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.h2.tools.SimpleResultSet;
|
import org.h2.tools.SimpleResultSet;
|
||||||
import org.h2.value.Value;
|
|
||||||
import org.h2.value.ValueArray;
|
|
||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
import org.junit.Ignore;
|
import org.junit.Ignore;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
@ -260,21 +258,25 @@ public class CSVPrinterTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testCloseWithFlushOff() throws IOException {
|
public void testCloseWithFlushOff() throws IOException {
|
||||||
final Writer writer = mock(Writer.class);
|
try (final Writer writer = mock(Writer.class)) {
|
||||||
final CSVFormat csvFormat = CSVFormat.DEFAULT;
|
final CSVFormat csvFormat = CSVFormat.DEFAULT;
|
||||||
final CSVPrinter csvPrinter = new CSVPrinter(writer, csvFormat);
|
@SuppressWarnings("resource")
|
||||||
csvPrinter.close(false);
|
final CSVPrinter csvPrinter = new CSVPrinter(writer, csvFormat);
|
||||||
verify(writer, never()).flush();
|
csvPrinter.close(false);
|
||||||
verify(writer, times(1)).close();
|
verify(writer, never()).flush();
|
||||||
|
verify(writer, times(1)).close();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testCloseWithFlushOn() throws IOException {
|
public void testCloseWithFlushOn() throws IOException {
|
||||||
final Writer writer = mock(Writer.class);
|
try (final Writer writer = mock(Writer.class)) {
|
||||||
final CSVFormat csvFormat = CSVFormat.DEFAULT;
|
final CSVFormat csvFormat = CSVFormat.DEFAULT;
|
||||||
final CSVPrinter csvPrinter = new CSVPrinter(writer, csvFormat);
|
@SuppressWarnings("resource")
|
||||||
csvPrinter.close(true);
|
final CSVPrinter csvPrinter = new CSVPrinter(writer, csvFormat);
|
||||||
verify(writer, times(1)).flush();
|
csvPrinter.close(true);
|
||||||
|
verify(writer, times(1)).flush();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
Loading…
Reference in New Issue