creadur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rdon...@apache.org
Subject svn commit: r1548694 - in /creadur/rat/branches/gsoc: apache-rat-api/src/main/java/org/apache/rat/api/domain/ apache-rat-api/src/test/java/org/apache/rat/api/domain/ apache-rat-core/src/main/java/org/apache/rat/analysis/license/ apache-rat-core/src/mai...
Date Fri, 06 Dec 2013 19:42:10 GMT
Author: rdonkin
Date: Fri Dec  6 19:42:09 2013
New Revision: 1548694

URL: http://svn.apache.org/r1548694
Log:
Convert GPL2License to use LicenseFamily constructor

Modified:
    creadur/rat/branches/gsoc/apache-rat-api/src/main/java/org/apache/rat/api/domain/RatLicenseFamily.java
    creadur/rat/branches/gsoc/apache-rat-api/src/test/java/org/apache/rat/api/domain/RatLicenseFamilyTest.java
    creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/license/GPL2License.java
    creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/api/MetaData.java
    creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/license/GPL2LicenseFamily.java

Modified: creadur/rat/branches/gsoc/apache-rat-api/src/main/java/org/apache/rat/api/domain/RatLicenseFamily.java
URL: http://svn.apache.org/viewvc/creadur/rat/branches/gsoc/apache-rat-api/src/main/java/org/apache/rat/api/domain/RatLicenseFamily.java?rev=1548694&r1=1548693&r2=1548694&view=diff
==============================================================================
--- creadur/rat/branches/gsoc/apache-rat-api/src/main/java/org/apache/rat/api/domain/RatLicenseFamily.java
(original)
+++ creadur/rat/branches/gsoc/apache-rat-api/src/main/java/org/apache/rat/api/domain/RatLicenseFamily.java
Fri Dec  6 19:42:09 2013
@@ -33,6 +33,10 @@ public enum RatLicenseFamily {
 			"GNU General Public License, version 1",
 			"GPL1 ",
 			"Note that GPL1 requires a NOTICE. All modifications require notes. See http://www.gnu.org/licenses/gpl-1.0.html."),
+	GPL2(
+			"GNU General Public License, version 2",
+			"GPL2 ",
+			"Note that GPL2 requires a NOTICE. All modifications require notes. See http://www.gnu.org/licenses/gpl-2.0.html."),
     W3C(
             "W3C Software Copyright",
             "W3C  ",

Modified: creadur/rat/branches/gsoc/apache-rat-api/src/test/java/org/apache/rat/api/domain/RatLicenseFamilyTest.java
URL: http://svn.apache.org/viewvc/creadur/rat/branches/gsoc/apache-rat-api/src/test/java/org/apache/rat/api/domain/RatLicenseFamilyTest.java?rev=1548694&r1=1548693&r2=1548694&view=diff
==============================================================================
--- creadur/rat/branches/gsoc/apache-rat-api/src/test/java/org/apache/rat/api/domain/RatLicenseFamilyTest.java
(original)
+++ creadur/rat/branches/gsoc/apache-rat-api/src/test/java/org/apache/rat/api/domain/RatLicenseFamilyTest.java
Fri Dec  6 19:42:09 2013
@@ -20,6 +20,7 @@ package org.apache.rat.api.domain;
 
 import static org.apache.rat.api.domain.RatLicenseFamily.APACHE;
 import static org.apache.rat.api.domain.RatLicenseFamily.GPL1;
+import static org.apache.rat.api.domain.RatLicenseFamily.GPL2;
 import static org.apache.rat.api.domain.RatLicenseFamily.W3C;
 import static org.apache.rat.api.domain.RatLicenseFamily.W3C_DOCUMENTATION;
 import static org.hamcrest.CoreMatchers.is;
@@ -96,4 +97,21 @@ public class RatLicenseFamilyTest {
 				GPL1.getNotes(),
 				is("Note that GPL1 requires a NOTICE. All modifications require notes. See http://www.gnu.org/licenses/gpl-1.0.html."));
 	}
+
+	@Test
+	public void testGPL2LicenseFamilyCategory() {
+		assertThat(GPL2.getCategory(), is("GPL2 "));
+	}
+
+	@Test
+	public void testGPL2LicenseFamilyName() {
+		assertThat(GPL2.getName(), is("GNU General Public License, version 2"));
+	}
+
+	@Test
+	public void testGPL2LicenseFamilyNotes() {
+		assertThat(
+				GPL2.getNotes(),
+				is("Note that GPL2 requires a NOTICE. All modifications require notes. See http://www.gnu.org/licenses/gpl-2.0.html."));
+	}
 }

Modified: creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/license/GPL2License.java
URL: http://svn.apache.org/viewvc/creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/license/GPL2License.java?rev=1548694&r1=1548693&r2=1548694&view=diff
==============================================================================
--- creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/license/GPL2License.java
(original)
+++ creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/license/GPL2License.java
Fri Dec  6 19:42:09 2013
@@ -18,7 +18,7 @@
  */
 package org.apache.rat.analysis.license;
 
-import org.apache.rat.api.MetaData;
+import static org.apache.rat.api.domain.RatLicenseFamily.GPL2;
 
 /**
  * Licence matches GPL2 or later.
@@ -33,8 +33,7 @@ public class GPL2License extends FullTex
      * 
      */
 	public GPL2License() {
-		super(MetaData.RAT_LICENSE_FAMILY_CATEGORY_DATUM_GPL2,
-				MetaData.RAT_LICENSE_FAMILY_NAME_DATUM_GPL_VERSION_2, "",
+		super(GPL2.licenseFamily(),
 				FIRST_LICENSE_LINE);
 	}
 }

Modified: creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/api/MetaData.java
URL: http://svn.apache.org/viewvc/creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/api/MetaData.java?rev=1548694&r1=1548693&r2=1548694&view=diff
==============================================================================
--- creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/api/MetaData.java
(original)
+++ creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/api/MetaData.java
Fri Dec  6 19:42:09 2013
@@ -67,8 +67,6 @@ public class MetaData {
     public static final String RAT_LICENSE_FAMILY_CATEGORY_VALUE_OASIS = "OASIS";
     public static final String RAT_LICENSE_FAMILY_CATEGORY_VALUE_DOJO = "DOJO ";
     public static final String RAT_LICENSE_FAMILY_CATEGORY_VALUE_TMF = "TMF  ";
-    public static final String RAT_LICENSE_FAMILY_CATEGORY_VALUE_GPL1 = "GPL1 ";
-    public static final String RAT_LICENSE_FAMILY_CATEGORY_VALUE_GPL2 = "GPL2 ";
     public static final String RAT_LICENSE_FAMILY_CATEGORY_VALUE_GPL3 = "GPL3 ";
     public static final String RAT_LICENSE_FAMILY_CATEGORY_VALUE_MIT = "MIT  ";
     public static final String RAT_LICENSE_FAMILY_CATEGORY_VALUE_CDDL1 = "CDDL1";
@@ -88,9 +86,6 @@ public class MetaData {
     public static final Datum RAT_LICENSE_FAMILY_CATEGORY_DATUM_TMF = new Datum(
             RAT_URL_LICENSE_FAMILY_CATEGORY,
             RAT_LICENSE_FAMILY_CATEGORY_VALUE_TMF);
-    public static final Datum RAT_LICENSE_FAMILY_CATEGORY_DATUM_GPL2 = new Datum(
-            RAT_URL_LICENSE_FAMILY_CATEGORY,
-            RAT_LICENSE_FAMILY_CATEGORY_VALUE_GPL2);
     public static final Datum RAT_LICENSE_FAMILY_CATEGORY_DATUM_GPL3 = new Datum(
             RAT_URL_LICENSE_FAMILY_CATEGORY,
             RAT_LICENSE_FAMILY_CATEGORY_VALUE_GPL3);
@@ -119,8 +114,6 @@ public class MetaData {
     public static final Datum RAT_LICENSE_FAMILY_NAME_DATUM_MODIFIED_BSD_LICENSE = new Datum(
             RAT_URL_LICENSE_FAMILY_NAME,
             RAT_LICENSE_FAMILY_NAME_VALUE_MODIFIED_BSD_LICENSE);
-    public static final Datum RAT_LICENSE_FAMILY_NAME_DATUM_GPL_VERSION_2 = new Datum(
-            RAT_URL_LICENSE_FAMILY_NAME, RAT_LICENSE_FAMILY_CATEGORY_VALUE_GPL2);
     public static final Datum RAT_LICENSE_FAMILY_NAME_DATUM_GPL_VERSION_3 = new Datum(
             RAT_URL_LICENSE_FAMILY_NAME,
             RAT_LICENSE_FAMILY_NAME_VALUE_GPL_VERSION_3);

Modified: creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/license/GPL2LicenseFamily.java
URL: http://svn.apache.org/viewvc/creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/license/GPL2LicenseFamily.java?rev=1548694&r1=1548693&r2=1548694&view=diff
==============================================================================
--- creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/license/GPL2LicenseFamily.java
(original)
+++ creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/license/GPL2LicenseFamily.java
Fri Dec  6 19:42:09 2013
@@ -18,14 +18,14 @@
  */ 
 package org.apache.rat.license;
 
-import org.apache.rat.api.MetaData;
+import static org.apache.rat.api.domain.RatLicenseFamily.GPL2;
 
 /**
  * Base implementation for GPLv3 or later.
  */
 public class GPL2LicenseFamily extends SimpleLicenseFamily {
     public GPL2LicenseFamily() {
-        super(MetaData.RAT_LICENSE_FAMILY_NAME_VALUE_GPL_VERSION_2);
+		super(GPL2.getName());
     }
 
 }



Mime
View raw message