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

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

commit 013b67adbbac20040083350c2b0c7fa630dc8011
Author: Gary Gregory <gardgreg...@gmail.com>
AuthorDate: Tue Jul 26 09:03:55 2022 -0400

    Sort test members
---
 .../io/FileUtilsDeleteDirectoryBaseTest.java       | 10 +++---
 .../java/org/apache/commons/io/FileUtilsTest.java  |  4 +--
 .../java/org/apache/commons/io/IOUtilsTest.java    | 42 +++++++++++-----------
 .../commons/io/function/IOPredicateTest.java       | 16 ++++-----
 .../commons/io/output/WriterOutputStreamTest.java  | 10 +++---
 5 files changed, 41 insertions(+), 41 deletions(-)

diff --git 
a/src/test/java/org/apache/commons/io/FileUtilsDeleteDirectoryBaseTest.java 
b/src/test/java/org/apache/commons/io/FileUtilsDeleteDirectoryBaseTest.java
index 0d1283a9..94c1ec3d 100644
--- a/src/test/java/org/apache/commons/io/FileUtilsDeleteDirectoryBaseTest.java
+++ b/src/test/java/org/apache/commons/io/FileUtilsDeleteDirectoryBaseTest.java
@@ -37,6 +37,11 @@ public abstract class FileUtilsDeleteDirectoryBaseTest {
 
     protected abstract boolean setupSymlink(final File res, final File link) 
throws Exception;
 
+    @Test
+    public void testDeleteDirectoryNullArgument() {
+        assertThrows(NullPointerException.class, () -> 
FileUtils.deleteDirectory(null));
+    }
+
     @Test
     public void testDeleteDirWithASymlinkDir() throws Exception {
 
@@ -250,9 +255,4 @@ public abstract class FileUtilsDeleteDirectoryBaseTest {
         assertEquals(0, top.list().length);
     }
 
-    @Test
-    public void testDeleteDirectoryNullArgument() {
-        assertThrows(NullPointerException.class, () -> 
FileUtils.deleteDirectory(null));
-    }
-
 }
diff --git a/src/test/java/org/apache/commons/io/FileUtilsTest.java 
b/src/test/java/org/apache/commons/io/FileUtilsTest.java
index 1f0e07c0..0069683d 100644
--- a/src/test/java/org/apache/commons/io/FileUtilsTest.java
+++ b/src/test/java/org/apache/commons/io/FileUtilsTest.java
@@ -89,8 +89,6 @@ import org.junit.jupiter.api.Test;
 @SuppressWarnings({"deprecation", "ResultOfMethodCallIgnored"}) // unit tests 
include tests of many deprecated methods
 public class FileUtilsTest extends AbstractTempDirTest {
 
-    private static final String UTF_8 = StandardCharsets.UTF_8.name();
-
     /**
      * DirectoryWalker implementation that recursively lists all files and 
directories.
      */
@@ -133,6 +131,8 @@ public class FileUtilsTest extends AbstractTempDirTest {
         }
     }
 
+    private static final String UTF_8 = StandardCharsets.UTF_8.name();
+
     /** Test data. */
     private static final long DATE3 = 1000000002000L;
 
diff --git a/src/test/java/org/apache/commons/io/IOUtilsTest.java 
b/src/test/java/org/apache/commons/io/IOUtilsTest.java
index 9623fa8f..3e6c3a86 100644
--- a/src/test/java/org/apache/commons/io/IOUtilsTest.java
+++ b/src/test/java/org/apache/commons/io/IOUtilsTest.java
@@ -624,25 +624,6 @@ public class IOUtilsTest {
         testSingleEOL("1235", "1234", false);
     }
 
-    public void testSingleEOL(final String s1, final String s2, final boolean 
ifEquals) throws IOException {
-        assertEquals(ifEquals, IOUtils.contentEqualsIgnoreEOL(
-                new CharArrayReader(s1.toCharArray()),
-                new CharArrayReader(s2.toCharArray())
-        ), "failed at :{" + s1 + "," + s2 + "}");
-        assertEquals(ifEquals, IOUtils.contentEqualsIgnoreEOL(
-                new CharArrayReader(s2.toCharArray()),
-                new CharArrayReader(s1.toCharArray())
-        ), "failed at :{" + s2 + "," + s1 + "}");
-        assertTrue(IOUtils.contentEqualsIgnoreEOL(
-                new CharArrayReader(s1.toCharArray()),
-                new CharArrayReader(s1.toCharArray())
-        ),"failed at :{" + s1 + "," + s1 + "}");
-        assertTrue(IOUtils.contentEqualsIgnoreEOL(
-                new CharArrayReader(s2.toCharArray()),
-                new CharArrayReader(s2.toCharArray())
-        ), "failed at :{" + s2 + "," + s2 + "}");
-    }
-
     @Test
     public void testCopy_ByteArray_OutputStream() throws Exception {
         final File destination = TestUtils.newFile(temporaryFolder, 
"copy8.txt");
@@ -1160,8 +1141,6 @@ public class IOUtilsTest {
         assertEquals(fileSize, content.getBytes().length);
     }
 
-    // Tests from IO-305
-
     @Test
     public void 
testResourceToString_ExistingResourceAtSubPackage_WithClassLoader() throws 
Exception {
         final long fileSize = 
TestResources.getFile("FileUtilsTestDataCR.dat").length();
@@ -1172,6 +1151,8 @@ public class IOUtilsTest {
         assertEquals(fileSize, content.getBytes().length);
     }
 
+    // Tests from IO-305
+
     @Test
     public void testResourceToString_NonExistingResource() {
         assertThrows(IOException.class,
@@ -1259,6 +1240,25 @@ public class IOUtilsTest {
         assertThrows(NullPointerException.class, () -> 
IOUtils.resourceToURL(null, ClassLoader.getSystemClassLoader()));
     }
 
+    public void testSingleEOL(final String s1, final String s2, final boolean 
ifEquals) throws IOException {
+        assertEquals(ifEquals, IOUtils.contentEqualsIgnoreEOL(
+                new CharArrayReader(s1.toCharArray()),
+                new CharArrayReader(s2.toCharArray())
+        ), "failed at :{" + s1 + "," + s2 + "}");
+        assertEquals(ifEquals, IOUtils.contentEqualsIgnoreEOL(
+                new CharArrayReader(s2.toCharArray()),
+                new CharArrayReader(s1.toCharArray())
+        ), "failed at :{" + s2 + "," + s1 + "}");
+        assertTrue(IOUtils.contentEqualsIgnoreEOL(
+                new CharArrayReader(s1.toCharArray()),
+                new CharArrayReader(s1.toCharArray())
+        ),"failed at :{" + s1 + "," + s1 + "}");
+        assertTrue(IOUtils.contentEqualsIgnoreEOL(
+                new CharArrayReader(s2.toCharArray()),
+                new CharArrayReader(s2.toCharArray())
+        ), "failed at :{" + s2 + "," + s2 + "}");
+    }
+
     @Test
     public void testSkip_FileReader() throws Exception {
         try (Reader in = Files.newBufferedReader(testFilePath)) {
diff --git a/src/test/java/org/apache/commons/io/function/IOPredicateTest.java 
b/src/test/java/org/apache/commons/io/function/IOPredicateTest.java
index a2413b58..db7d6f9e 100644
--- a/src/test/java/org/apache/commons/io/function/IOPredicateTest.java
+++ b/src/test/java/org/apache/commons/io/function/IOPredicateTest.java
@@ -91,6 +91,14 @@ public class IOPredicateTest {
         assertFalse(IS_HIDDEN.test(PATH_FIXTURE));
     }
 
+    @Test
+    public void testFalse() throws IOException {
+        assertFalse(Constants.IO_PREDICATE_FALSE.test("A"));
+        // Make sure we keep the argument type
+        final IOPredicate<String> alwaysFalse = IOPredicate.alwaysFalse();
+        assertFalse(alwaysFalse.test("A"));
+    }
+
     @Test
     public void testIsEqualChecked() throws IOException {
         assertThrowsChecked(() -> 
IOPredicate.isEqual(THROWING_EQUALS).test("B"));
@@ -147,14 +155,6 @@ public class IOPredicateTest {
         assertTrue(Constants.IO_PREDICATE_TRUE.asPredicate().test("A"));
     }
 
-    @Test
-    public void testFalse() throws IOException {
-        assertFalse(Constants.IO_PREDICATE_FALSE.test("A"));
-        // Make sure we keep the argument type
-        final IOPredicate<String> alwaysFalse = IOPredicate.alwaysFalse();
-        assertFalse(alwaysFalse.test("A"));
-    }
-
     @Test
     public void testTrue() throws IOException {
         assertTrue(Constants.IO_PREDICATE_TRUE.test("A"));
diff --git 
a/src/test/java/org/apache/commons/io/output/WriterOutputStreamTest.java 
b/src/test/java/org/apache/commons/io/output/WriterOutputStreamTest.java
index 1a32e3ff..497334f4 100644
--- a/src/test/java/org/apache/commons/io/output/WriterOutputStreamTest.java
+++ b/src/test/java/org/apache/commons/io/output/WriterOutputStreamTest.java
@@ -79,6 +79,11 @@ public class WriterOutputStreamTest {
         testWithSingleByteWrite(LARGE_TEST_STRING, UTF_8);
     }
 
+    @Test
+    public void testNullCharsetDecoderWithSingleByteWrite() throws IOException 
{
+        testWithSingleByteWrite(TEST_STRING, (CharsetDecoder) null);
+    }
+
     @Test
     public void testNullCharsetNameWithSingleByteWrite() throws IOException {
         testWithSingleByteWrite(TEST_STRING, (String) null);
@@ -89,11 +94,6 @@ public class WriterOutputStreamTest {
         testWithSingleByteWrite(TEST_STRING, (Charset) null);
     }
 
-    @Test
-    public void testNullCharsetDecoderWithSingleByteWrite() throws IOException 
{
-        testWithSingleByteWrite(TEST_STRING, (CharsetDecoder) null);
-    }
-
     @Test
     public void testUTF16BEWithBufferedWrite() throws IOException {
         testWithBufferedWrite(TEST_STRING, UTF_16BE);

Reply via email to