creadur-commits mailing list archives

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

URL: http://svn.apache.org/r1548696
Log:
Convert GPL3License 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/GPL3License.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/GPL3LicenseFamily.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=1548696&r1=1548695&r2=1548696&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:46 2013
@@ -37,6 +37,10 @@ public enum RatLicenseFamily {
 			"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."),
+	GPL3(
+			"GNU General Public License, version 3",
+			"GPL3 ",
+			"Note that GPL3 requires a NOTICE. All modifications require notes. See http://www.gnu.org/licenses/gpl-3.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=1548696&r1=1548695&r2=1548696&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:46 2013
@@ -21,6 +21,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.GPL3;
 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;
@@ -114,4 +115,21 @@ public class RatLicenseFamilyTest {
 				GPL2.getNotes(),
 				is("Note that GPL2 requires a NOTICE. All modifications require notes. See http://www.gnu.org/licenses/gpl-2.0.html."));
 	}
+	
+	@Test
+	public void testGPL3LicenseFamilyCategory() {
+		assertThat(GPL3.getCategory(), is("GPL3 "));
+	}
+
+	@Test
+	public void testGPL3LicenseFamilyName() {
+		assertThat(GPL3.getName(), is("GNU General Public License, version 3"));
+	}
+
+	@Test
+	public void testGPL3LicenseFamilyNotes() {
+		assertThat(
+				GPL3.getNotes(),
+				is("Note that GPL3 requires a NOTICE. All modifications require notes. See http://www.gnu.org/licenses/gpl-3.0.html."));
+	}
 }

Modified: creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/license/GPL3License.java
URL: http://svn.apache.org/viewvc/creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/license/GPL3License.java?rev=1548696&r1=1548695&r2=1548696&view=diff
==============================================================================
--- creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/license/GPL3License.java
(original)
+++ creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/license/GPL3License.java
Fri Dec  6 19:42:46 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.GPL3;
 
 /**
  * Licence matches GPL3 or later.
@@ -33,8 +33,7 @@ public class GPL3License extends FullTex
      * 
      */
 	public GPL3License() {
-		super(MetaData.RAT_LICENSE_FAMILY_CATEGORY_DATUM_GPL3,
-				MetaData.RAT_LICENSE_FAMILY_NAME_DATUM_GPL_VERSION_3, "",
+		super(GPL3.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=1548696&r1=1548695&r2=1548696&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:46 2013
@@ -67,7 +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_GPL3 = "GPL3 ";
     public static final String RAT_LICENSE_FAMILY_CATEGORY_VALUE_MIT = "MIT  ";
     public static final String RAT_LICENSE_FAMILY_CATEGORY_VALUE_CDDL1 = "CDDL1";
 
@@ -86,9 +85,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_GPL3 = new Datum(
-            RAT_URL_LICENSE_FAMILY_CATEGORY,
-            RAT_LICENSE_FAMILY_CATEGORY_VALUE_GPL3);
     public static final Datum RAT_LICENSE_FAMILY_CATEGORY_DATUM_MIT = new Datum(
             RAT_URL_LICENSE_FAMILY_CATEGORY,
             RAT_LICENSE_FAMILY_CATEGORY_VALUE_MIT);
@@ -102,8 +98,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_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";
     public static final String RAT_LICENSE_FAMILY_NAME_VALUE_CDDL1 = "COMMON DEVELOPMENT
AND DISTRIBUTION LICENSE Version 1.0";
     public static final String RAT_LICENSE_FAMILY_NAME_VALUE_ACADEMIC_FREE_LICENSE_VERSION_2_1
= "Academic Free License, Version 2.1";
@@ -114,9 +108,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_3 = new Datum(
-            RAT_URL_LICENSE_FAMILY_NAME,
-            RAT_LICENSE_FAMILY_NAME_VALUE_GPL_VERSION_3);
     public static final Datum RAT_LICENSE_FAMILY_NAME_DATUM_MIT = new Datum(
             RAT_URL_LICENSE_FAMILY_NAME, RAT_LICENSE_FAMILY_NAME_VALUE_MIT);
     public static final Datum RAT_LICENSE_FAMILY_NAME_DATUM_CDDL1 = new Datum(

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



Mime
View raw message