Author: rdonkin
Date: Mon Dec  9 05:36:03 2013
New Revision: 1549394

URL: http://svn.apache.org/r1549394
Log:
Add testMethod.

Modified:
    
creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/walker/FileNameComparatorTest.java

Modified: 
creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/walker/FileNameComparatorTest.java
URL: 
http://svn.apache.org/viewvc/creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/walker/FileNameComparatorTest.java?rev=1549394&r1=1549393&r2=1549394&view=diff
==============================================================================
--- 
creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/walker/FileNameComparatorTest.java
 (original)
+++ 
creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/walker/FileNameComparatorTest.java
 Mon Dec  9 05:36:03 2013
@@ -37,11 +37,39 @@ public class FileNameComparatorTest {
         *             Signals that an I/O exception has occurred.
         */
        @Test
-       public void compare() throws IOException {
+       public void testCompare() throws IOException {
                FileNameComparator comparator = new FileNameComparator();
                final int compare = comparator.compare(
                                Resources.getResourceFile("elements/LICENSE"),
                                Resources.getResourceFile("elements/NOTICE"));
                assertTrue("LICENSE is before NOTICE", compare < 0);
        }
+
+       /**
+        * Test compare first file null.
+        * 
+        * @throws IOException
+        *             Signals that an I/O exception has occurred.
+        */
+       @Test
+       public void testCompareFirstFileNull() throws IOException {
+               FileNameComparator comparator = new FileNameComparator();
+               final int compare = comparator.compare(null,
+                               Resources.getResourceFile("elements/NOTICE"));
+               assertTrue("LICENSE is before NOTICE", compare > 0);
+       }
+
+       /**
+        * Test compare second file null.
+        * 
+        * @throws IOException
+        *             Signals that an I/O exception has occurred.
+        */
+       @Test
+       public void testCompareSecondFileNull() throws IOException {
+               FileNameComparator comparator = new FileNameComparator();
+               final int compare = comparator.compare(
+                               Resources.getResourceFile("elements/LICENSE"), 
null);
+               assertTrue("LICENSE is before NOTICE", compare < 0);
+       }
 }


Reply via email to