creadur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rdon...@apache.org
Subject svn commit: r1548670 - in /creadur/rat/branches/gsoc/apache-rat-api/src: ./ main/ main/java/ main/java/org/ main/java/org/apache/ main/java/org/apache/rat/ main/java/org/apache/rat/api/ main/java/org/apache/rat/api/domain/ test/ test/java/ test/java/or...
Date Fri, 06 Dec 2013 19:10:44 GMT
Author: rdonkin
Date: Fri Dec  6 19:10:43 2013
New Revision: 1548670

URL: http://svn.apache.org/r1548670
Log:
Start developing immutable license family bean with builder

Added:
    creadur/rat/branches/gsoc/apache-rat-api/src/
    creadur/rat/branches/gsoc/apache-rat-api/src/main/
    creadur/rat/branches/gsoc/apache-rat-api/src/main/java/
    creadur/rat/branches/gsoc/apache-rat-api/src/main/java/org/
    creadur/rat/branches/gsoc/apache-rat-api/src/main/java/org/apache/
    creadur/rat/branches/gsoc/apache-rat-api/src/main/java/org/apache/rat/
    creadur/rat/branches/gsoc/apache-rat-api/src/main/java/org/apache/rat/api/
    creadur/rat/branches/gsoc/apache-rat-api/src/main/java/org/apache/rat/api/domain/
    creadur/rat/branches/gsoc/apache-rat-api/src/main/java/org/apache/rat/api/domain/LicenseFamily.java
  (with props)
    creadur/rat/branches/gsoc/apache-rat-api/src/main/java/org/apache/rat/api/domain/LicenseFamilyBuilder.java
  (with props)
    creadur/rat/branches/gsoc/apache-rat-api/src/test/
    creadur/rat/branches/gsoc/apache-rat-api/src/test/java/
    creadur/rat/branches/gsoc/apache-rat-api/src/test/java/org/
    creadur/rat/branches/gsoc/apache-rat-api/src/test/java/org/apache/
    creadur/rat/branches/gsoc/apache-rat-api/src/test/java/org/apache/rat/
    creadur/rat/branches/gsoc/apache-rat-api/src/test/java/org/apache/rat/api/
    creadur/rat/branches/gsoc/apache-rat-api/src/test/java/org/apache/rat/api/domain/
    creadur/rat/branches/gsoc/apache-rat-api/src/test/java/org/apache/rat/api/domain/LicenseFamilyBuilderTest.java
  (with props)

Added: 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=1548670&view=auto
==============================================================================
--- creadur/rat/branches/gsoc/apache-rat-api/src/main/java/org/apache/rat/api/domain/LicenseFamily.java
(added)
+++ creadur/rat/branches/gsoc/apache-rat-api/src/main/java/org/apache/rat/api/domain/LicenseFamily.java
Fri Dec  6 19:10:43 2013
@@ -0,0 +1,34 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.rat.api.domain;
+
+public final class LicenseFamily {
+
+    private final String notes;
+
+    public LicenseFamily(final String notes) {
+        super();
+        this.notes = notes;
+    }
+
+    public String getNotes() {
+        return this.notes;
+    }
+
+}

Propchange: creadur/rat/branches/gsoc/apache-rat-api/src/main/java/org/apache/rat/api/domain/LicenseFamily.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 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=1548670&view=auto
==============================================================================
--- creadur/rat/branches/gsoc/apache-rat-api/src/main/java/org/apache/rat/api/domain/LicenseFamilyBuilder.java
(added)
+++ creadur/rat/branches/gsoc/apache-rat-api/src/main/java/org/apache/rat/api/domain/LicenseFamilyBuilder.java
Fri Dec  6 19:10:43 2013
@@ -0,0 +1,41 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.rat.api.domain;
+
+public final class LicenseFamilyBuilder {
+
+    public static LicenseFamilyBuilder aLicenseFamily() {
+
+        return new LicenseFamilyBuilder();
+    }
+
+    private String notes;
+
+    private LicenseFamilyBuilder() {
+    }
+
+    public LicenseFamilyBuilder withNotes(final String notes) {
+        this.notes = notes;
+        return this;
+    }
+
+    public LicenseFamily build() {
+        return new LicenseFamily(this.notes);
+    }
+}

Propchange: creadur/rat/branches/gsoc/apache-rat-api/src/main/java/org/apache/rat/api/domain/LicenseFamilyBuilder.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 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=1548670&view=auto
==============================================================================
--- creadur/rat/branches/gsoc/apache-rat-api/src/test/java/org/apache/rat/api/domain/LicenseFamilyBuilderTest.java
(added)
+++ creadur/rat/branches/gsoc/apache-rat-api/src/test/java/org/apache/rat/api/domain/LicenseFamilyBuilderTest.java
Fri Dec  6 19:10:43 2013
@@ -0,0 +1,38 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.rat.api.domain;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertThat;
+
+import org.junit.Test;
+
+public class LicenseFamilyBuilderTest {
+
+    @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));
+    }
+}

Propchange: creadur/rat/branches/gsoc/apache-rat-api/src/test/java/org/apache/rat/api/domain/LicenseFamilyBuilderTest.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message