This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch release
in repository https://gitbox.apache.org/repos/asf/commons-io.git


The following commit(s) were added to refs/heads/release by this push:
     new 9980492  Revert changes -- wrong branch
     new 761605b  Merge branch 'release' of 
https://gitbox.apache.org/repos/asf/commons-io into release
9980492 is described below

commit 9980492ba364a78aa920d305ef8b15d069f5dd95
Author: Sebb <s...@apache.org>
AuthorDate: Thu Jul 30 13:22:39 2020 +0100

    Revert changes -- wrong branch
---
 .../java/org/apache/commons/io/FileSystemUtilsTestCase.java |  2 +-
 src/test/java/org/apache/commons/io/IOUtilsTestCase.java    | 13 ++++++++++++-
 .../commons/io/input/CharacterSetFilterReaderTest.java      |  1 +
 .../io/input/ReversedLinesFileReaderTestParamBlockSize.java |  2 --
 .../org/apache/commons/io/input/SequenceReaderTest.java     |  1 -
 src/test/java/org/apache/commons/io/input/TailerTest.java   |  4 +++-
 6 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/src/test/java/org/apache/commons/io/FileSystemUtilsTestCase.java 
b/src/test/java/org/apache/commons/io/FileSystemUtilsTestCase.java
index 07ef715..b07742f 100644
--- a/src/test/java/org/apache/commons/io/FileSystemUtilsTestCase.java
+++ b/src/test/java/org/apache/commons/io/FileSystemUtilsTestCase.java
@@ -36,11 +36,11 @@ import org.junit.jupiter.api.Test;
  * This is used to test FileSystemUtils.
  *
  */
+@SuppressWarnings("deprecation") // testing deprecated class
 public class FileSystemUtilsTestCase {
 
     //-----------------------------------------------------------------------
     @Test
-    @SuppressWarnings("deprecation") // testing decrecated code
     public void testGetFreeSpace_String() throws Exception {
         // test coverage, as we can't check value
         if (File.separatorChar == '/') {
diff --git a/src/test/java/org/apache/commons/io/IOUtilsTestCase.java 
b/src/test/java/org/apache/commons/io/IOUtilsTestCase.java
index 4a50246..4dfc9c8 100644
--- a/src/test/java/org/apache/commons/io/IOUtilsTestCase.java
+++ b/src/test/java/org/apache/commons/io/IOUtilsTestCase.java
@@ -137,6 +137,7 @@ public class IOUtilsTestCase {
         }
     }
 
+    @SuppressWarnings("squid:S2699") // Suppress "Add at least one assertion 
to this test case"
     @Test public void testCloseQuietly_AllCloseableIOException() {
         final Closeable closeable = () -> {
             throw new IOException();
@@ -144,12 +145,14 @@ public class IOUtilsTestCase {
         IOUtils.closeQuietly(closeable, null, closeable);
     }
 
+    @SuppressWarnings("squid:S2699") // Suppress "Add at least one assertion 
to this test case"
     @Test public void testCloseQuietly_CloseableIOException() {
         IOUtils.closeQuietly((Closeable) () -> {
             throw new IOException();
         });
     }
 
+    @SuppressWarnings("squid:S2699") // Suppress "Add at least one assertion 
to this test case"
     @Test public void testCloseQuietly_Selector() {
         Selector selector = null;
         try {
@@ -160,6 +163,7 @@ public class IOUtilsTestCase {
         }
     }
 
+    @SuppressWarnings("squid:S2699") // Suppress "Add at least one assertion 
to this test case"
     @Test public void testCloseQuietly_SelectorIOException() {
         final Selector selector = new SelectorAdapter() {
             @Override
@@ -170,11 +174,13 @@ public class IOUtilsTestCase {
         IOUtils.closeQuietly(selector);
     }
 
+    @SuppressWarnings("squid:S2699") // Suppress "Add at least one assertion 
to this test case"
     @Test public void testCloseQuietly_SelectorNull() {
         final Selector selector = null;
         IOUtils.closeQuietly(selector);
     }
 
+    @SuppressWarnings("squid:S2699") // Suppress "Add at least one assertion 
to this test case"
     @Test public void testCloseQuietly_SelectorTwice() {
         Selector selector = null;
         try {
@@ -186,11 +192,13 @@ public class IOUtilsTestCase {
         }
     }
 
+    @SuppressWarnings("squid:S2699") // Suppress "Add at least one assertion 
to this test case"
     @Test public void testCloseQuietly_ServerSocket() throws IOException {
         IOUtils.closeQuietly((ServerSocket) null);
         IOUtils.closeQuietly(new ServerSocket());
     }
 
+    @SuppressWarnings("squid:S2699") // Suppress "Add at least one assertion 
to this test case"
     @Test public void testCloseQuietly_ServerSocketIOException() throws 
IOException {
         IOUtils.closeQuietly(new ServerSocket() {
             @Override
@@ -200,11 +208,13 @@ public class IOUtilsTestCase {
         });
     }
 
+    @SuppressWarnings("squid:S2699") // Suppress "Add at least one assertion 
to this test case"
     @Test public void testCloseQuietly_Socket() {
         IOUtils.closeQuietly((Socket) null);
         IOUtils.closeQuietly(new Socket());
     }
 
+    @SuppressWarnings("squid:S2699") // Suppress "Add at least one assertion 
to this test case"
     @Test public void testCloseQuietly_SocketIOException() {
         IOUtils.closeQuietly(new Socket() {
             @Override
@@ -230,7 +240,6 @@ public class IOUtilsTestCase {
 
     @Test public void testContentEquals_InputStream_InputStream() throws 
Exception {
         {
-            final ByteArrayInputStream input1 = new 
ByteArrayInputStream("".getBytes(StandardCharsets.UTF_8));
             assertTrue(IOUtils.contentEquals((InputStream) null, null));
         }
         {
@@ -1266,10 +1275,12 @@ public class IOUtilsTestCase {
         assertTrue(exceptionOccurred);
     }
 
+    @SuppressWarnings("squid:S2699") // Suppress "Add at least one assertion 
to this test case"
     @Test public void testResourceToString_NullCharset() throws Exception {
         IOUtils.resourceToString("/test-file-utf8.bin", null);
     }
 
+    @SuppressWarnings("squid:S2699") // Suppress "Add at least one assertion 
to this test case"
     @Test public void testResourceToString_NullCharset_WithClassLoader() 
throws Exception {
         IOUtils.resourceToString("test-file-utf8.bin", null, 
ClassLoader.getSystemClassLoader());
     }
diff --git 
a/src/test/java/org/apache/commons/io/input/CharacterSetFilterReaderTest.java 
b/src/test/java/org/apache/commons/io/input/CharacterSetFilterReaderTest.java
index dc92449..680021b 100644
--- 
a/src/test/java/org/apache/commons/io/input/CharacterSetFilterReaderTest.java
+++ 
b/src/test/java/org/apache/commons/io/input/CharacterSetFilterReaderTest.java
@@ -59,6 +59,7 @@ public class CharacterSetFilterReaderTest {
             codePoints.add(Integer.valueOf('a'));
             final CharacterSetFilterReader reader = new 
CharacterSetFilterReader(input, codePoints);
             assertEquals(-1, reader.read());
+            reader.close();
         }
     }
 
diff --git 
a/src/test/java/org/apache/commons/io/input/ReversedLinesFileReaderTestParamBlockSize.java
 
b/src/test/java/org/apache/commons/io/input/ReversedLinesFileReaderTestParamBlockSize.java
index 963674a..b9ac601 100644
--- 
a/src/test/java/org/apache/commons/io/input/ReversedLinesFileReaderTestParamBlockSize.java
+++ 
b/src/test/java/org/apache/commons/io/input/ReversedLinesFileReaderTestParamBlockSize.java
@@ -37,8 +37,6 @@ public class ReversedLinesFileReaderTestParamBlockSize {
     private static final String UTF_8 = "UTF-8";
     private static final String ISO_8859_1 = "ISO-8859-1";
 
-    private static final int[] BLOCK_SIZES = {1, 3, 8, 256, 4096};
-
     // small and uneven block sizes are not used in reality but are good to 
show that the algorithm is solid
     public static IntStream blockSizes() {
         return IntStream.of(1, 3, 8, 256, 4096);
diff --git a/src/test/java/org/apache/commons/io/input/SequenceReaderTest.java 
b/src/test/java/org/apache/commons/io/input/SequenceReaderTest.java
index 965f85c..72be358 100644
--- a/src/test/java/org/apache/commons/io/input/SequenceReaderTest.java
+++ b/src/test/java/org/apache/commons/io/input/SequenceReaderTest.java
@@ -19,7 +19,6 @@ package org.apache.commons.io.input;
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertThrows;
 import static org.junit.jupiter.api.Assertions.assertFalse;
-import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.io.IOException;
 import java.io.Reader;
diff --git a/src/test/java/org/apache/commons/io/input/TailerTest.java 
b/src/test/java/org/apache/commons/io/input/TailerTest.java
index 3755456..3864cd2 100644
--- a/src/test/java/org/apache/commons/io/input/TailerTest.java
+++ b/src/test/java/org/apache/commons/io/input/TailerTest.java
@@ -69,6 +69,7 @@ public class TailerTest {
     }
 
     @Test
+    @SuppressWarnings("squid:S2699") // Suppress "Add at least one assertion 
to this test case"
     public void testLongFile() throws Exception {
         final long delay = 50;
 
@@ -84,7 +85,7 @@ public class TailerTest {
         final TestTailerListener listener = new TestTailerListener();
         tailer = new Tailer(file, listener, delay, false);
 
-        final long start = System.currentTimeMillis();
+        // final long start = System.currentTimeMillis();
 
         final Thread thread = new Thread(tailer);
         thread.start();
@@ -99,6 +100,7 @@ public class TailerTest {
     }
 
     @Test
+    @SuppressWarnings("squid:S2699") // Suppress "Add at least one assertion 
to this test case"
     public void testBufferBreak() throws Exception {
         final long delay = 50;
 

Reply via email to