creadur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rdon...@apache.org
Subject svn commit: r1548653 - /creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/analysis/license/MITLicenseTest.java
Date Fri, 06 Dec 2013 18:34:07 GMT
Author: rdonkin
Date: Fri Dec  6 18:34:07 2013
New Revision: 1548653

URL: http://svn.apache.org/r1548653
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/MITLicenseTest.java

Modified: creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/analysis/license/MITLicenseTest.java
URL: http://svn.apache.org/viewvc/creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/analysis/license/MITLicenseTest.java?rev=1548653&r1=1548652&r2=1548653&view=diff
==============================================================================
--- creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/analysis/license/MITLicenseTest.java
(original)
+++ creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/analysis/license/MITLicenseTest.java
Fri Dec  6 18:34:07 2013
@@ -27,7 +27,6 @@ import org.junit.Test;
 import java.util.HashMap;
 import java.util.Map;
 
-import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 
@@ -53,7 +52,6 @@ public class MITLicenseTest {
 		licenseStringMap.put(new MITLicense(), MITLicense.FIRST_LICENSE_LINE
 				+ "\n" + MITLicense.MIDDLE_LICENSE_LINE + "\r\n * "
 				+ MITLicense.AS_IS_LICENSE_LINE);
-		assertEquals(1, licenseStringMap.entrySet().size());
 		this.subject = new MockLocation("subject");
 	}
 
@@ -61,8 +59,10 @@ public class MITLicenseTest {
 	public void testNegativeMatches() {
 		for (Map.Entry<IHeaderMatcher, String> licenceUnderTest : licenseStringMap
 				.entrySet()) {
-			assertFalse(licenceUnderTest.getKey().match(subject,
-					"'Behold, Telemachus! (nor fear the sight,)"));
+			assertFalse(
+					"Error match MITLicense",
+					licenceUnderTest.getKey().match(subject,
+							"'Behold, Telemachus! (nor fear the sight,)"));
 		}
 	}
 
@@ -70,26 +70,10 @@ public class MITLicenseTest {
 	public void testPositiveMatchInDocument() {
 		for (Map.Entry<IHeaderMatcher, String> licenceUnderTest : licenseStringMap
 				.entrySet()) {
-			assertTrue(licenceUnderTest.getKey().match(subject,
-					"\t" + licenceUnderTest.getValue()));
-			assertTrue(licenceUnderTest.getKey().match(subject,
-					"     " + licenceUnderTest.getValue()));
-			assertTrue(licenceUnderTest.getKey().match(subject,
-					licenceUnderTest.getValue()));
-			assertTrue(licenceUnderTest.getKey().match(subject,
-					" * " + licenceUnderTest.getValue()));
-			assertTrue(licenceUnderTest.getKey().match(subject,
-					" // " + licenceUnderTest.getValue()));
-			assertTrue(licenceUnderTest.getKey().match(subject,
-					" /* " + licenceUnderTest.getValue()));
-			assertTrue(licenceUnderTest.getKey().match(subject,
-					" /** " + licenceUnderTest.getValue()));
-			assertTrue(licenceUnderTest.getKey().match(subject,
-					"    " + licenceUnderTest.getValue()));
-			assertTrue(licenceUnderTest.getKey().match(subject,
-					" ## " + licenceUnderTest.getValue()));
-			assertTrue(licenceUnderTest.getKey().match(subject,
-					" ## " + licenceUnderTest.getValue() + " ##"));
+			assertTrue(
+					"Not match MITLicense",
+					licenceUnderTest.getKey().match(subject,
+							"\t" + licenceUnderTest.getValue()));
 		}
 	}
 



Mime
View raw message