creadur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rdon...@apache.org
Subject svn commit: r1548672 - in /creadur/rat/branches/gsoc/apache-rat-api/src: main/java/org/apache/rat/api/domain/LicenseFamily.java main/java/org/apache/rat/api/domain/LicenseFamilyBuilder.java test/java/org/apache/rat/api/domain/LicenseFamilyBuilderTest.java
Date Fri, 06 Dec 2013 19:11:47 GMT
Author: rdonkin
Date: Fri Dec  6 19:11:47 2013
New Revision: 1548672

URL: http://svn.apache.org/r1548672
Log:
A license family may be in a category

Modified:
    creadur/rat/branches/gsoc/apache-rat-api/src/main/java/org/apache/rat/api/domain/LicenseFamily.java
    creadur/rat/branches/gsoc/apache-rat-api/src/main/java/org/apache/rat/api/domain/LicenseFamilyBuilder.java
    creadur/rat/branches/gsoc/apache-rat-api/src/test/java/org/apache/rat/api/domain/LicenseFamilyBuilderTest.java

Modified: creadur/rat/branches/gsoc/apache-rat-api/src/main/java/org/apache/rat/api/domain/LicenseFamily.java
URL: http://svn.apache.org/viewvc/creadur/rat/branches/gsoc/apache-rat-api/src/main/java/org/apache/rat/api/domain/LicenseFamily.java?rev=1548672&r1=1548671&r2=1548672&view=diff
==============================================================================
--- creadur/rat/branches/gsoc/apache-rat-api/src/main/java/org/apache/rat/api/domain/LicenseFamily.java
(original)
+++ creadur/rat/branches/gsoc/apache-rat-api/src/main/java/org/apache/rat/api/domain/LicenseFamily.java
Fri Dec  6 19:11:47 2013
@@ -21,14 +21,20 @@ package org.apache.rat.api.domain;
 public final class LicenseFamily {
 
     private final String notes;
+    private final String category;
 
-    public LicenseFamily(final String notes) {
+    public LicenseFamily(final String notes, final String category) {
         super();
         this.notes = notes;
+        this.category = category;
     }
 
     public String getNotes() {
         return this.notes;
     }
 
+    public String getCategory() {
+        return this.category;
+    }
+
 }

Modified: creadur/rat/branches/gsoc/apache-rat-api/src/main/java/org/apache/rat/api/domain/LicenseFamilyBuilder.java
URL: http://svn.apache.org/viewvc/creadur/rat/branches/gsoc/apache-rat-api/src/main/java/org/apache/rat/api/domain/LicenseFamilyBuilder.java?rev=1548672&r1=1548671&r2=1548672&view=diff
==============================================================================
--- creadur/rat/branches/gsoc/apache-rat-api/src/main/java/org/apache/rat/api/domain/LicenseFamilyBuilder.java
(original)
+++ creadur/rat/branches/gsoc/apache-rat-api/src/main/java/org/apache/rat/api/domain/LicenseFamilyBuilder.java
Fri Dec  6 19:11:47 2013
@@ -26,8 +26,11 @@ public final class LicenseFamilyBuilder 
     }
 
     private String notes;
+    private String category;
 
     private LicenseFamilyBuilder() {
+        this.notes = null;
+        this.category = null;
     }
 
     public LicenseFamilyBuilder withNotes(final String notes) {
@@ -36,6 +39,11 @@ public final class LicenseFamilyBuilder 
     }
 
     public LicenseFamily build() {
-        return new LicenseFamily(this.notes);
+        return new LicenseFamily(this.notes, this.category);
+    }
+
+    public LicenseFamilyBuilder withCategory(final String category) {
+        this.category = category;
+        return this;
     }
 }

Modified: creadur/rat/branches/gsoc/apache-rat-api/src/test/java/org/apache/rat/api/domain/LicenseFamilyBuilderTest.java
URL: http://svn.apache.org/viewvc/creadur/rat/branches/gsoc/apache-rat-api/src/test/java/org/apache/rat/api/domain/LicenseFamilyBuilderTest.java?rev=1548672&r1=1548671&r2=1548672&view=diff
==============================================================================
--- creadur/rat/branches/gsoc/apache-rat-api/src/test/java/org/apache/rat/api/domain/LicenseFamilyBuilderTest.java
(original)
+++ creadur/rat/branches/gsoc/apache-rat-api/src/test/java/org/apache/rat/api/domain/LicenseFamilyBuilderTest.java
Fri Dec  6 19:11:47 2013
@@ -27,12 +27,27 @@ import org.junit.Test;
 public class LicenseFamilyBuilderTest {
 
     @Test
+    public void testBuilderBuilds() {
+        final LicenseFamily family =
+                LicenseFamilyBuilder.aLicenseFamily().build();
+        assertNotNull("Builder should build", family);
+    }
+
+    @Test
     public void testWithNotes() {
         final String someNotes = "Some notes";
         final LicenseFamily family =
                 LicenseFamilyBuilder.aLicenseFamily().withNotes(someNotes)
                         .build();
-        assertNotNull("Builder should build", family);
         assertThat(family.getNotes(), is(someNotes));
     }
+
+    @Test
+    public void testWithCategory() {
+        final String someCategory = "Some license category";
+        final LicenseFamily family =
+                LicenseFamilyBuilder.aLicenseFamily()
+                        .withCategory(someCategory).build();
+        assertThat(family.getCategory(), is(someCategory));
+    }
 }



Mime
View raw message