commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brit...@apache.org
Subject svn commit: r1680667 - /commons/proper/io/trunk/src/test/java/org/apache/commons/io/filefilter/IOFileFilterAbstractTestCase.java
Date Wed, 20 May 2015 19:58:25 GMT
Author: britter
Date: Wed May 20 19:58:25 2015
New Revision: 1680667

URL: http://svn.apache.org/r1680667
Log:
Format source code

Modified:
    commons/proper/io/trunk/src/test/java/org/apache/commons/io/filefilter/IOFileFilterAbstractTestCase.java

Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/filefilter/IOFileFilterAbstractTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/commons/io/filefilter/IOFileFilterAbstractTestCase.java?rev=1680667&r1=1680666&r2=1680667&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/java/org/apache/commons/io/filefilter/IOFileFilterAbstractTestCase.java
(original)
+++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/filefilter/IOFileFilterAbstractTestCase.java
Wed May 20 19:58:25 2015
@@ -22,138 +22,137 @@ import junit.framework.TestCase;
 
 public abstract class IOFileFilterAbstractTestCase extends TestCase {
 
-  public IOFileFilterAbstractTestCase(final String name) {
-    super(name);
-  }
-
-  public boolean assertFileFiltering(final int testNumber, final IOFileFilter filter, final
File file, final boolean expected)
-  throws Exception {
-    assertEquals(
-    "test " + testNumber + " Filter(File) " + filter.getClass().getName() + " not " + expected
+ " for " + file,
-    expected, filter.accept(file));
-    return true; // return is irrelevant
-  }
-
-  public boolean assertFilenameFiltering(final int testNumber, final IOFileFilter filter,
final File file, final boolean expected)
-  throws Exception {
-    // Assumes file has parent and is not passed as null
-      assertEquals(
-    "test " + testNumber + " Filter(File, String) " + filter.getClass().getName() + " not
" + expected + " for " + file,
-    expected, filter.accept(file.getParentFile(), file.getName()));
-    return true; // return is irrelevant
-  }
-
-  public void assertFiltering(final int testNumber, final IOFileFilter filter, final File
file, final boolean expected)
-  throws Exception {
-    // Note. This only tests the (File, String) version if the parent of
-    //       the File passed in is not null
-      assertEquals(
-    "test " + testNumber + " Filter(File) " + filter.getClass().getName() + " not " + expected
+ " for " + file,
-    expected, filter.accept(file));
+    public IOFileFilterAbstractTestCase(final String name) {
+        super(name);
+    }
 
-    if (file != null && file.getParentFile() != null) {
+    public boolean assertFileFiltering(final int testNumber, final IOFileFilter filter, final
File file, final boolean expected)
+            throws Exception {
         assertEquals(
-      "test " + testNumber + " Filter(File, String) " + filter.getClass().getName() + " not
" + expected + " for " + file,
-      expected, filter.accept(file.getParentFile(), file.getName()));
+                "test " + testNumber + " Filter(File) " + filter.getClass().getName() + "
not " + expected + " for " + file,
+                expected, filter.accept(file));
+        return true; // return is irrelevant
     }
-    else if (file == null) {
+
+    public boolean assertFilenameFiltering(final int testNumber, final IOFileFilter filter,
final File file, final boolean expected)
+            throws Exception {
+        // Assumes file has parent and is not passed as null
         assertEquals(
-      "test " + testNumber + " Filter(File, String) " + filter.getClass().getName() + " not
" + expected + " for null",
-      expected, filter.accept(file));
+                "test " + testNumber + " Filter(File, String) " + filter.getClass().getName()
+ " not " + expected + " for " + file,
+                expected, filter.accept(file.getParentFile(), file.getName()));
+        return true; // return is irrelevant
     }
-  }
 
-  public void assertTrueFiltersInvoked(final int testNumber, final TesterTrueFileFilter[]
filters, final boolean[] invoked) {
-    for(int i = 1; i < filters.length; i++) {
-      assertEquals("test " + testNumber + " filter " + i + " invoked", invoked[i-1], filters[i].isInvoked());
+    public void assertFiltering(final int testNumber, final IOFileFilter filter, final File
file, final boolean expected)
+            throws Exception {
+        // Note. This only tests the (File, String) version if the parent of
+        //       the File passed in is not null
+        assertEquals(
+                "test " + testNumber + " Filter(File) " + filter.getClass().getName() + "
not " + expected + " for " + file,
+                expected, filter.accept(file));
+
+        if (file != null && file.getParentFile() != null) {
+            assertEquals(
+                    "test " + testNumber + " Filter(File, String) " + filter.getClass().getName()
+ " not " + expected + " for " + file,
+                    expected, filter.accept(file.getParentFile(), file.getName()));
+        } else if (file == null) {
+            assertEquals(
+                    "test " + testNumber + " Filter(File, String) " + filter.getClass().getName()
+ " not " + expected + " for null",
+                    expected, filter.accept(file));
+        }
     }
-  }
 
-  public void assertFalseFiltersInvoked(final int testNumber, final TesterFalseFileFilter[]
filters, final boolean[] invoked) {
-    for(int i = 1; i < filters.length; i++) {
-      assertEquals("test " + testNumber + " filter " + i + " invoked", invoked[i-1], filters[i].isInvoked());
+    public void assertTrueFiltersInvoked(final int testNumber, final TesterTrueFileFilter[]
filters, final boolean[] invoked) {
+        for (int i = 1; i < filters.length; i++) {
+            assertEquals("test " + testNumber + " filter " + i + " invoked", invoked[i -
1], filters[i].isInvoked());
+        }
     }
-  }
 
-  public File determineWorkingDirectoryPath(final String key, final String defaultPath) {
-    // Look for a system property to specify the working directory
-    final String workingPathName = System.getProperty(key, defaultPath);
-    return new File(workingPathName);
-  }
+    public void assertFalseFiltersInvoked(final int testNumber, final TesterFalseFileFilter[]
filters, final boolean[] invoked) {
+        for (int i = 1; i < filters.length; i++) {
+            assertEquals("test " + testNumber + " filter " + i + " invoked", invoked[i -
1], filters[i].isInvoked());
+        }
+    }
 
-  public void resetFalseFilters(final TesterFalseFileFilter[] filters) {
-    for (final TesterFalseFileFilter filter : filters) {
-      if(filter != null) {
-        filter.reset();
-      }
+    public File determineWorkingDirectoryPath(final String key, final String defaultPath)
{
+        // Look for a system property to specify the working directory
+        final String workingPathName = System.getProperty(key, defaultPath);
+        return new File(workingPathName);
     }
-  }
 
-  public void resetTrueFilters(final TesterTrueFileFilter[] filters) {
-    for (final TesterTrueFileFilter filter : filters) {
-      if(filter != null) {
-        filter.reset();
-      }
+    public void resetFalseFilters(final TesterFalseFileFilter[] filters) {
+        for (final TesterFalseFileFilter filter : filters) {
+            if (filter != null) {
+                filter.reset();
+            }
+        }
     }
-  }
 
-  class TesterTrueFileFilter extends TrueFileFilter {
+    public void resetTrueFilters(final TesterTrueFileFilter[] filters) {
+        for (final TesterTrueFileFilter filter : filters) {
+            if (filter != null) {
+                filter.reset();
+            }
+        }
+    }
 
-    private static final long serialVersionUID = 1828930358172422914L;
-    private boolean invoked;
+    class TesterTrueFileFilter extends TrueFileFilter {
 
-    @Override
-    public boolean accept(final File file) {
-      setInvoked(true);
-      return super.accept(file);
-    }
+        private static final long serialVersionUID = 1828930358172422914L;
+        private boolean invoked;
 
-    @Override
-    public boolean accept(final File file, final String str) {
-      setInvoked(true);
-      return super.accept(file, str);
-    }
+        @Override
+        public boolean accept(final File file) {
+            setInvoked(true);
+            return super.accept(file);
+        }
 
-    public boolean isInvoked() {
-      return this.invoked;
-    }
+        @Override
+        public boolean accept(final File file, final String str) {
+            setInvoked(true);
+            return super.accept(file, str);
+        }
 
-    public void setInvoked(final boolean invoked) {
-      this.invoked = invoked;
-    }
+        public boolean isInvoked() {
+            return this.invoked;
+        }
 
-    public void reset() {
-      setInvoked(false);
+        public void setInvoked(final boolean invoked) {
+            this.invoked = invoked;
+        }
+
+        public void reset() {
+            setInvoked(false);
+        }
     }
-  }
 
-  class TesterFalseFileFilter extends FalseFileFilter {
+    class TesterFalseFileFilter extends FalseFileFilter {
 
-    private static final long serialVersionUID = -3603047664010401872L;
-    private boolean invoked;
+        private static final long serialVersionUID = -3603047664010401872L;
+        private boolean invoked;
 
-    @Override
-    public boolean accept(final File file) {
-      setInvoked(true);
-      return super.accept(file);
-    }
+        @Override
+        public boolean accept(final File file) {
+            setInvoked(true);
+            return super.accept(file);
+        }
 
-    @Override
-    public boolean accept(final File file, final String str) {
-      setInvoked(true);
-      return super.accept(file, str);
-    }
+        @Override
+        public boolean accept(final File file, final String str) {
+            setInvoked(true);
+            return super.accept(file, str);
+        }
 
-    public boolean isInvoked() {
-      return this.invoked;
-    }
+        public boolean isInvoked() {
+            return this.invoked;
+        }
 
-    public void setInvoked(final boolean invoked) {
-      this.invoked = invoked;
-    }
+        public void setInvoked(final boolean invoked) {
+            this.invoked = invoked;
+        }
 
-    public void reset() {
-      setInvoked(false);
+        public void reset() {
+            setInvoked(false);
+        }
     }
-  }
 }



Mime
View raw message