creadur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rdon...@apache.org
Subject svn commit: r1548819 - /creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/analysis/license/OASISLicenseTest.java
Date Sat, 07 Dec 2013 08:52:42 GMT
Author: rdonkin
Date: Sat Dec  7 08:52:41 2013
New Revision: 1548819

URL: http://svn.apache.org/r1548819
Log:
Rename Test, Only one assert for each test.

Modified:
    creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/analysis/license/OASISLicenseTest.java

Modified: creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/analysis/license/OASISLicenseTest.java
URL: http://svn.apache.org/viewvc/creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/analysis/license/OASISLicenseTest.java?rev=1548819&r1=1548818&r2=1548819&view=diff
==============================================================================
--- creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/analysis/license/OASISLicenseTest.java
(original)
+++ creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/analysis/license/OASISLicenseTest.java
Sat Dec  7 08:52:41 2013
@@ -27,7 +27,6 @@ import java.io.StringReader;
 
 import org.apache.rat.api.Document;
 import org.apache.rat.document.MockLocation;
-import org.apache.rat.test.utils.Resources;
 import org.junit.Before;
 import org.junit.Test;
 
@@ -61,43 +60,25 @@ public class OASISLicenseTest {
     }
 
     @Test
-    public void match() throws IOException {
-        BufferedReader bufferedReader = new BufferedReader(new StringReader(LICENSE));
-        String line = bufferedReader.readLine();
+	public void testMatchOASISLicense() throws IOException {
+		BufferedReader bufferedReader = new BufferedReader(new StringReader(
+				LICENSE));
+		String line = bufferedReader.readLine();
         boolean result = false;
         final Document subject = new MockLocation("subject");
         while (line != null) {
             result = license.match(subject, line);
-            line = bufferedReader.readLine();
+			line = bufferedReader.readLine();
         }
         assertTrue("OASIS license should be matched", result);
-        license.reset();
-        result = license.match(subject, "New line");
-        assertFalse("After reset, content should build up again", result);
     }
 
     @Test
-    public void noMatch() throws IOException {
-        BufferedReader bufferedReader = Resources.getBufferedResourceReader("elements/Source.java");
-        String line = bufferedReader.readLine();
-        boolean result = false;
-        final Document subject = new MockLocation("subject");
-        while (line != null) {
-            result = license.match(subject, line);
-            line = bufferedReader.readLine();
-        }
-        assertFalse("OASIS license should not be matched", result);
+	public void testNonMatchOASISLicense() throws IOException {
+		final Document subject = new MockLocation("subject");
         license.reset();
-    }
-    
-    @Test(timeout=2000) // may need to be adjusted if many more files are added
-    public void goodFiles() throws IOException {
-        DirectoryScanner.filesInDir("oasis/good", license, true);
-    }
-   
-    @Test(timeout=2000) // may need to be adjusted if many more files are added
-    public void baddFiles() throws IOException {
-        DirectoryScanner.filesInDir("oasis/bad", license, false);
+		boolean result = license.match(subject, "New line");
+		assertFalse("After reset, content should build up again", result);
     }
    
 }



Mime
View raw message