creadur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rdon...@apache.org
Subject svn commit: r1548692 - 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:37:38 GMT
Author: rdonkin
Date: Fri Dec  6 19:37:37 2013
New Revision: 1548692

URL: http://svn.apache.org/r1548692
Log:
Convert GPL1License 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/GPL1License.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/GPL1LicenseFamily.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=1548692&r1=1548691&r2=1548692&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:37:37 2013
@@ -29,7 +29,10 @@ public enum RatLicenseFamily {
 			"Apache License Version 2.0",
 			"AL   ",
 			"Note that APACHE requires a NOTICE. All modifications require notes. See http://www.apache.org/licenses/LICENSE-2.0."),
-
+	GPL1(
+			"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."),
     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=1548692&r1=1548691&r2=1548692&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:37:37 2013
@@ -19,6 +19,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.W3C;
 import static org.apache.rat.api.domain.RatLicenseFamily.W3C_DOCUMENTATION;
 import static org.hamcrest.CoreMatchers.is;
@@ -78,4 +79,21 @@ public class RatLicenseFamilyTest {
 				APACHE.getNotes(),
 				is("Note that APACHE requires a NOTICE. All modifications require notes. See http://www.apache.org/licenses/LICENSE-2.0."));
 	}
+
+	@Test
+	public void testGPL1LicenseFamilyCategory() {
+		assertThat(GPL1.getCategory(), is("GPL1 "));
+	}
+
+	@Test
+	public void testGPL1LicenseFamilyName() {
+		assertThat(GPL1.getName(), is("GNU General Public License, version 1"));
+	}
+
+	@Test
+	public void testGPL1LicenseFamilyNotes() {
+		assertThat(
+				GPL1.getNotes(),
+				is("Note that GPL1 requires a NOTICE. All modifications require notes. See http://www.gnu.org/licenses/gpl-1.0.html."));
+	}
 }

Modified: creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/license/GPL1License.java
URL: http://svn.apache.org/viewvc/creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/license/GPL1License.java?rev=1548692&r1=1548691&r2=1548692&view=diff
==============================================================================
--- creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/license/GPL1License.java
(original)
+++ creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/license/GPL1License.java
Fri Dec  6 19:37:37 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.GPL1;
 
 /**
  * Licence matches GPL1 or later.
@@ -33,8 +33,7 @@ public class GPL1License extends FullTex
      * 
      */
 	public GPL1License() {
-		super(MetaData.RAT_LICENSE_FAMILY_CATEGORY_DATUM_GPL1,
-				MetaData.RAT_LICENSE_FAMILY_NAME_DATUM_GPL_VERSION_1, "",
+		super(GPL1.licenseFamily(),
 				FIRST_LICENSE_LINE);
 	}
 }
\ No newline at end of file

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=1548692&r1=1548691&r2=1548692&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:37:37 2013
@@ -88,9 +88,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_GPL1 = new Datum(
-            RAT_URL_LICENSE_FAMILY_CATEGORY,
-            RAT_LICENSE_FAMILY_CATEGORY_VALUE_GPL1);
     public static final Datum RAT_LICENSE_FAMILY_CATEGORY_DATUM_GPL2 = new Datum(
             RAT_URL_LICENSE_FAMILY_CATEGORY,
             RAT_LICENSE_FAMILY_CATEGORY_VALUE_GPL2);
@@ -110,7 +107,6 @@ public class MetaData {
     public static final String RAT_LICENSE_FAMILY_NAME_VALUE_W3C_DOCUMENT_COPYRIGHT = "W3C
Document Copyright";
     public static final String RAT_LICENSE_FAMILY_NAME_VALUE_OASIS_OPEN_LICENSE = "OASIS
Open License";
     public static final String RAT_LICENSE_FAMILY_NAME_VALUE_MODIFIED_BSD_LICENSE = "Modified
BSD License";
-    public static final String RAT_LICENSE_FAMILY_NAME_VALUE_GPL_VERSION_1 = "GNU General
Public License, version 1";
     public static final String RAT_LICENSE_FAMILY_NAME_VALUE_GPL_VERSION_2 = "GNU General
Public License, version 2";
     public static final String RAT_LICENSE_FAMILY_NAME_VALUE_GPL_VERSION_3 = "GNU General
Public License, version 3";
     public static final String RAT_LICENSE_FAMILY_NAME_VALUE_MIT = "The MIT License";
@@ -123,8 +119,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_1 = new Datum(
-            RAT_URL_LICENSE_FAMILY_NAME, RAT_LICENSE_FAMILY_CATEGORY_VALUE_GPL1);
     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(

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



Mime
View raw message