creadur-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: svn commit: r1661803 - in /creadur/rat/trunk: ./ apache-rat-api/ apache-rat-api/src/ apache-rat-api/src/main/ apache-rat-api/src/main/java/ apache-rat-api/src/main/java/org/ apache-rat-api/src/main/java/org/apache/ apache-rat-api/src/main/java/org/apac...
Date Tue, 24 Feb 2015 00:06:06 GMT
On 23 February 2015 at 22:25,  <pottlinger@apache.org> wrote:
> Author: pottlinger
> Date: Mon Feb 23 22:25:53 2015
> New Revision: 1661803
>
> URL: http://svn.apache.org/r1661803
> Log:
> RAT-195: Merged rat-api from GSOC branch.
>
> * Cleaned up mess with pom coordinates of it test projects.
> * Enhanced SVN:ignore to not take care of *.iml.
> * Activated RAT::API as default module.
>
>
> Added:
>     creadur/rat/trunk/apache-rat-api/   (with props)
>     creadur/rat/trunk/apache-rat-api/pom.xml
>     creadur/rat/trunk/apache-rat-api/src/
>     creadur/rat/trunk/apache-rat-api/src/main/
>     creadur/rat/trunk/apache-rat-api/src/main/java/
>     creadur/rat/trunk/apache-rat-api/src/main/java/org/
>     creadur/rat/trunk/apache-rat-api/src/main/java/org/apache/
>     creadur/rat/trunk/apache-rat-api/src/main/java/org/apache/rat/
>     creadur/rat/trunk/apache-rat-api/src/main/java/org/apache/rat/api/
>     creadur/rat/trunk/apache-rat-api/src/main/java/org/apache/rat/api/domain/
>     creadur/rat/trunk/apache-rat-api/src/main/java/org/apache/rat/api/domain/LicenseFamily.java
>     creadur/rat/trunk/apache-rat-api/src/main/java/org/apache/rat/api/domain/LicenseFamilyBuilder.java
>     creadur/rat/trunk/apache-rat-api/src/main/java/org/apache/rat/api/domain/RatLicenseFamily.java
>     creadur/rat/trunk/apache-rat-api/src/test/
>     creadur/rat/trunk/apache-rat-api/src/test/java/
>     creadur/rat/trunk/apache-rat-api/src/test/java/org/
>     creadur/rat/trunk/apache-rat-api/src/test/java/org/apache/
>     creadur/rat/trunk/apache-rat-api/src/test/java/org/apache/rat/
>     creadur/rat/trunk/apache-rat-api/src/test/java/org/apache/rat/api/
>     creadur/rat/trunk/apache-rat-api/src/test/java/org/apache/rat/api/domain/
>     creadur/rat/trunk/apache-rat-api/src/test/java/org/apache/rat/api/domain/LicenseFamilyBuilderTest.java
>     creadur/rat/trunk/apache-rat-api/src/test/java/org/apache/rat/api/domain/RatLicenseFamilyTest.java
> Modified:
>     creadur/rat/trunk/apache-rat-core/pom.xml
>     creadur/rat/trunk/apache-rat-core/src/main/java/org/apache/rat/Report.java
>     creadur/rat/trunk/apache-rat-plugin/   (props changed)
>     creadur/rat/trunk/apache-rat-plugin/pom.xml
>     creadur/rat/trunk/apache-rat-plugin/src/it/it1/   (props changed)
>     creadur/rat/trunk/apache-rat-plugin/src/it/it4_RAT-168/   (props changed)
>     creadur/rat/trunk/apache-rat-plugin/src/it/it4_RAT-168/pom.xml
>     creadur/rat/trunk/apache-rat-plugin/src/test/resources/unit/   (props changed)
>     creadur/rat/trunk/apache-rat-plugin/src/test/resources/unit/it1/   (props changed)
>     creadur/rat/trunk/apache-rat-plugin/src/test/resources/unit/it2/   (props changed)
>     creadur/rat/trunk/apache-rat-plugin/src/test/resources/unit/it3/   (props changed)
>     creadur/rat/trunk/pom.xml
>
> Propchange: creadur/rat/trunk/apache-rat-api/
> ------------------------------------------------------------------------------
> --- svn:ignore (added)
> +++ svn:ignore Mon Feb 23 22:25:53 2015
> @@ -0,0 +1,7 @@
> +**/*.iml
> +*.iml
> +*.ipr
> +.project
> +.classpath
> +target
> +target/*
>
> Added: creadur/rat/trunk/apache-rat-api/pom.xml
> URL: http://svn.apache.org/viewvc/creadur/rat/trunk/apache-rat-api/pom.xml?rev=1661803&view=auto
> ==============================================================================
> --- creadur/rat/trunk/apache-rat-api/pom.xml (added)
> +++ creadur/rat/trunk/apache-rat-api/pom.xml Mon Feb 23 22:25:53 2015
> @@ -0,0 +1,51 @@
> +<?xml version="1.0" encoding="UTF-8"?>
> +<!--
> +  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.
> +-->
> +<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
> +    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
> +  <modelVersion>4.0.0</modelVersion>
> +  <parent>
> +    <groupId>org.apache.rat</groupId>
> +    <artifactId>apache-rat-project</artifactId>
> +    <version>0.12-SNAPSHOT</version>
> +  </parent>
> +  <packaging>jar</packaging>
> +
> +  <artifactId>apache-rat-api</artifactId>
> +
> +  <name>Apache Creadur Rat::API</name>
> +  <description>Shared beans and services.</description>
> +
> +  <dependencies>
> +    <!-- Test Dependencies -->
> +    <dependency>
> +      <groupId>junit</groupId>
> +      <artifactId>junit</artifactId>
> +      <scope>test</scope>
> +    </dependency>
> +    <dependency>
> +      <groupId>org.hamcrest</groupId>
> +      <artifactId>hamcrest-library</artifactId>
> +      <scope>test</scope>
> +    </dependency>
> +    <dependency>
> +      <groupId>org.mockito</groupId>
> +      <artifactId>mockito-core</artifactId>
> +      <scope>test</scope>
> +    </dependency>
> +  </dependencies>
> +</project>
>
> Added: creadur/rat/trunk/apache-rat-api/src/main/java/org/apache/rat/api/domain/LicenseFamily.java
> URL: http://svn.apache.org/viewvc/creadur/rat/trunk/apache-rat-api/src/main/java/org/apache/rat/api/domain/LicenseFamily.java?rev=1661803&view=auto
> ==============================================================================
> --- creadur/rat/trunk/apache-rat-api/src/main/java/org/apache/rat/api/domain/LicenseFamily.java
(added)
> +++ creadur/rat/trunk/apache-rat-api/src/main/java/org/apache/rat/api/domain/LicenseFamily.java
Mon Feb 23 22:25:53 2015
> @@ -0,0 +1,99 @@
> +/*
> + * 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;
> +
> +/**
> + * Licenses are grouped into families. Each family has similar legal semantics,
> + * though some small details may differ.
> + * <p/>
> + * For example, the <a href='http://opensource.org/licenses/BSD-3-Clause'>3
> + * clause BSD license</a> is in a family where members differ by &lt;OWNER&gt;,
> + * &lt;ORGANIZATION&gt; and &lt;YEAR&gt; parameters.
> + *
> + */
> +public final class LicenseFamily {
> +
> +    /**
> +     * Further information associated with the license family. Human readable.
> +     * Possibly null.
> +     */
> +    private final String notes;
> +    /**
> +     * Names of the category containing this license family. Choosing a suitable
> +     * URI is recommended. Possibly null;
> +     */
> +    private final String category;
> +    /**
> +     * Uniquely identifies this family. Choosing a suitable URI is recommended.
> +     * Not null.
> +     */
> +    private final String name;
> +
> +    /**
> +     * Constructs an immutable license family.
> +     *
> +     * @param name
> +     *            the name uniquely identifying this family. Recommended that
> +     *            this be an URI. Not null.
> +     * @param category
> +     *            the name of the category containing this license family.
> +     *            Recommended that this be an URI. Possibly null.
> +     * @param notes
> +     *            further information associated with the license family. Human
> +     *            readable. Possibly null.
> +     */
> +    public LicenseFamily(final String name, final String category,
> +            final String notes) {
> +        super();
> +        this.notes = notes;
> +        this.category = category;
> +        this.name = name;
> +    }
> +
> +    /**
> +     * Gets further information associated with the license family. Human
> +     * readable.
> +     *
> +     * @return possibly null
> +     */
> +    public String getNotes() {
> +        return this.notes;
> +    }
> +
> +    /**
> +     * Gets the name of the category containing this license family. Recommended
> +     * that this be an URI.
> +     *
> +     * @return possibly null
> +     */
> +    public String getCategory() {
> +        return this.category;
> +    }
> +
> +    /**
> +     * Gets the name uniquely identifying this family. Recommended that this be
> +     * an URI.
> +     *
> +     * @return not null
> +     */
> +    public String getName() {
> +        return this.name;
> +    }
> +
> +}
>
> Added: creadur/rat/trunk/apache-rat-api/src/main/java/org/apache/rat/api/domain/LicenseFamilyBuilder.java
> URL: http://svn.apache.org/viewvc/creadur/rat/trunk/apache-rat-api/src/main/java/org/apache/rat/api/domain/LicenseFamilyBuilder.java?rev=1661803&view=auto
> ==============================================================================
> --- creadur/rat/trunk/apache-rat-api/src/main/java/org/apache/rat/api/domain/LicenseFamilyBuilder.java
(added)
> +++ creadur/rat/trunk/apache-rat-api/src/main/java/org/apache/rat/api/domain/LicenseFamilyBuilder.java
Mon Feb 23 22:25:53 2015
> @@ -0,0 +1,96 @@
> +/*
> + * 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;
> +
> +/**
> + * Builds {@link LicenseFamily} instances.
> + */
> +public final class LicenseFamilyBuilder {
> +
> +    /**
> +     * Begins to build a license family.
> +     *
> +     * @return a builder for a license family, not null
> +     */
> +    public static LicenseFamilyBuilder aLicenseFamily() {
> +        return new LicenseFamilyBuilder();
> +    }
> +
> +    /** Further information associated with the license family. Human readable. */
> +    private String notes;
> +    /**
> +     * Names of the category containing this license family. Recommended that
> +     * this be an URI.
> +     */
> +    private String category;
> +    /** Uniquely identifies this family. Choosing a suitable URI is recommended */
> +    private String name;
> +
> +    /** Use {@link #aLicenseFamily()  */
> +    private LicenseFamilyBuilder() {
> +    }
> +
> +    /**
> +     * Builds a family.
> +     *
> +     * @return not null
> +     */
> +    public LicenseFamily build() {
> +        return new LicenseFamily(this.name, this.category, this.notes);
> +    }
> +
> +    /**
> +     * Builds family with further information associated with the license
> +     * family. Human readable.
> +     *
> +     * @param notes
> +     *            possibly null
> +     * @return this instance, not null
> +     */
> +    public LicenseFamilyBuilder withNotes(final String notes) {
> +        this.notes = notes;
> +        return this;
> +    }
> +
> +    /**
> +     * Builds family with category containing this license family. Choosing a
> +     * suitable URI is recommended
> +     *
> +     * @param category
> +     *            possible null
> +     * @return this instance, not null
> +     */
> +    public LicenseFamilyBuilder withCategory(final String category) {
> +        this.category = category;
> +        return this;
> +    }
> +
> +    /**
> +     *
> +     * Uniquely identifies this family. Choosing a suitable URI is recommended.
> +     *
> +     * @param name
> +     *            not null
> +     * @return this instance, not null
> +     */
> +    public LicenseFamilyBuilder withName(final String name) {
> +        this.name = name;
> +        return this;
> +    }
> +}
>
> Added: creadur/rat/trunk/apache-rat-api/src/main/java/org/apache/rat/api/domain/RatLicenseFamily.java
> URL: http://svn.apache.org/viewvc/creadur/rat/trunk/apache-rat-api/src/main/java/org/apache/rat/api/domain/RatLicenseFamily.java?rev=1661803&view=auto
> ==============================================================================
> --- creadur/rat/trunk/apache-rat-api/src/main/java/org/apache/rat/api/domain/RatLicenseFamily.java
(added)
> +++ creadur/rat/trunk/apache-rat-api/src/main/java/org/apache/rat/api/domain/RatLicenseFamily.java
Mon Feb 23 22:25:53 2015

-1

This class looks wrong to me.

> @@ -0,0 +1,137 @@
> +/*
> + * 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.apache.rat.api.domain.LicenseFamilyBuilder.aLicenseFamily;
> +
> +/**
> + * Enumerates standard license families known to Rat.
> + */
> +public enum RatLicenseFamily {
> +
> +       APACHE(
> +                       "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."),

What does "All modifications require notes." actually mean?

It could be taken to mean that all code modifications require entries
in the NOTICE file - which is definitely not the case for APACHE.

I don't think RAT should be in the business of interpreting license conditions.

> +       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."),
> +       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."),
> +       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."),
> +       MIT(
> +                       "The MIT License",
> +                       "MIT  ",
> +                       "Note that MIT requires a NOTICE. All modifications require notes.
See http://opensource.org/licenses/MIT."),
> +       CDDL1(
> +                       "COMMON DEVELOPMENT AND DISTRIBUTION LICENSE Version 1.0",
> +                       "CDDL1",
> +                       "Note that CDDL1 requires a NOTICE. All modifications require
notes. See https://oss.oracle.com/licenses/CDDL."),
> +       OASIS(
> +                       "OASIS Open License",
> +                       "OASIS",
> +                       "Note that OASIS requires a NOTICE. All modifications require
notes. See https://www.oasis-open.org/policies-guidelines/ipr."),
> +       TMF854(
> +                       "Modified BSD License",
> +                       "TMF  ",
> +                       "Note that TMF854 requires a NOTICE. All modifications require
notes. See http://opensource.org/licenses/BSD-3-Clause."),
> +        DOJO(
> +                       "Modified BSD License",
> +                       "DOJO ",
> +                       "Note that DOJO requires a NOTICE. All modifications require
notes. See http://dojotoolkit.org/community/licensing.shtml."),
> +    W3C(
> +            "W3C Software Copyright",
> +            "W3C  ",
> +            "Note that W3C requires a NOTICE. All modifications require notes. See http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231."),
> +
> +    W3C_DOCUMENTATION(
> +            "W3C Document Copyright",
> +            "W3CD ",
> +            "Note that W3CD does not allow modifications. See http://www.w3.org/Consortium/Legal/2002/copyright-documents-20021231.");
> +
> +    /** @see LicenseFamily#getName() */
> +    private final String name;
> +    /** @see LicenseFamily#getCategory() */
> +    private final String category;
> +    /** @see LicenseFamily#getNotes() */
> +    private final String notes;
> +    /** Constructed from other data */
> +    private final LicenseFamily licenseFamily;
> +

The 3rd string in each of the enums appears to be a mixture of several
different attributes.

These should be split into separate fields, and their purpose should
be documented.


> +    /**
> +     * Constructs an instance.
> +     *
> +     * @param name
> +     *            not null
> +     * @param category
> +     *            not null
> +     * @param notes
> +     *            not null
> +     */
> +    private RatLicenseFamily(final String name, final String category,
> +            final String notes) {
> +        this.name = name;
> +        this.category = category;
> +        this.notes = notes;
> +        this.licenseFamily = aLicenseFamily().withCategory(getCategory())
> +                .withName(getName()).withNotes(getNotes()).build();
> +    }
> +
> +    /**
> +     * @see LicenseFamily#getName()
> +     *
> +     * @return not null
> +     */
> +    public String getName() {
> +        return this.name;
> +    }
> +
> +    /**
> +     * @see LicenseFamily#getCategory()
> +     *
> +     * @return possibly null
> +     */
> +    public String getCategory() {
> +        return this.category;
> +    }
> +
> +    /**
> +     * @see LicenseFamily#getNotes()
> +     *
> +     * @return possibly null
> +     */
> +    public String getNotes() {
> +        return this.notes;
> +    }
> +
> +    /**
> +     * Gets a {@link LicenseFamily} representing this data.
> +     *
> +     * @return not null
> +     */
> +    public LicenseFamily licenseFamily() {
> +        return this.licenseFamily;
> +    }
> +}
>
> Added: creadur/rat/trunk/apache-rat-api/src/test/java/org/apache/rat/api/domain/LicenseFamilyBuilderTest.java
> URL: http://svn.apache.org/viewvc/creadur/rat/trunk/apache-rat-api/src/test/java/org/apache/rat/api/domain/LicenseFamilyBuilderTest.java?rev=1661803&view=auto
> ==============================================================================
> --- creadur/rat/trunk/apache-rat-api/src/test/java/org/apache/rat/api/domain/LicenseFamilyBuilderTest.java
(added)
> +++ creadur/rat/trunk/apache-rat-api/src/test/java/org/apache/rat/api/domain/LicenseFamilyBuilderTest.java
Mon Feb 23 22:25:53 2015
> @@ -0,0 +1,63 @@
> +/*
> + * 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 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();
> +        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));
> +    }
> +
> +    @Test
> +    public void testWithName() {
> +        final String someName = "A name for a license";
> +        final LicenseFamily family =
> +                LicenseFamilyBuilder.aLicenseFamily().withName(someName)
> +                        .build();
> +        assertThat(family.getName(), is(someName));
> +
> +    }
> +}
>
> Added: creadur/rat/trunk/apache-rat-api/src/test/java/org/apache/rat/api/domain/RatLicenseFamilyTest.java
> URL: http://svn.apache.org/viewvc/creadur/rat/trunk/apache-rat-api/src/test/java/org/apache/rat/api/domain/RatLicenseFamilyTest.java?rev=1661803&view=auto
> ==============================================================================
> --- creadur/rat/trunk/apache-rat-api/src/test/java/org/apache/rat/api/domain/RatLicenseFamilyTest.java
(added)
> +++ creadur/rat/trunk/apache-rat-api/src/test/java/org/apache/rat/api/domain/RatLicenseFamilyTest.java
Mon Feb 23 22:25:53 2015
> @@ -0,0 +1,226 @@
> +/*
> + * 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.apache.rat.api.domain.RatLicenseFamily.APACHE;
> +import static org.apache.rat.api.domain.RatLicenseFamily.CDDL1;
> +import static org.apache.rat.api.domain.RatLicenseFamily.DOJO;
> +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.MIT;
> +import static org.apache.rat.api.domain.RatLicenseFamily.OASIS;
> +import static org.apache.rat.api.domain.RatLicenseFamily.TMF854;
> +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;
> +import static org.junit.Assert.assertThat;
> +
> +import org.junit.Test;
> +
> +public class RatLicenseFamilyTest {
> +
> +    @Test
> +    public void testW3CLicenseFamilyCategory() {
> +        assertThat(W3C.getCategory(), is("W3C  "));
> +    }
> +
> +    @Test
> +    public void testW3CLicenseFamilyName() {
> +        assertThat(W3C.getName(), is("W3C Software Copyright"));
> +    }
> +
> +    @Test
> +    public void testW3CLicenseFamilyNotes() {
> +        assertThat(
> +                W3C.getNotes(),
> +                is("Note that W3C requires a NOTICE. All modifications require notes.
See http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231."));
> +    }
> +
> +    @Test
> +    public void testW3CDocLicenseFamilyCategory() {
> +        assertThat(W3C_DOCUMENTATION.getCategory(), is("W3CD "));
> +    }
> +
> +    @Test
> +    public void testW3CDocLicenseFamilyName() {
> +        assertThat(W3C_DOCUMENTATION.getName(), is("W3C Document Copyright"));
> +    }
> +
> +    @Test
> +    public void testW3CDocLicenseFamilyNotes() {
> +        assertThat(
> +                W3C_DOCUMENTATION.getNotes(),
> +                is("Note that W3CD does not allow modifications. See http://www.w3.org/Consortium/Legal/2002/copyright-documents-20021231."));
> +    }
> +
> +       @Test
> +       public void testAPACHELicenseFamilyCategory() {
> +               assertThat(APACHE.getCategory(), is("AL   "));
> +       }
> +
> +       @Test
> +       public void testAPACHELicenseFamilyName() {
> +               assertThat(APACHE.getName(), is("Apache License Version 2.0"));
> +       }
> +
> +       @Test
> +       public void testAPACHELicenseFamilyNotes() {
> +               assertThat(
> +                               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."));
> +       }
> +
> +       @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."));
> +       }
> +
> +       @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."));
> +       }
> +
> +       @Test
> +       public void testMITLicenseFamilyCategory() {
> +               assertThat(MIT.getCategory(), is("MIT  "));
> +       }
> +
> +       @Test
> +       public void testMITLicenseFamilyName() {
> +               assertThat(MIT.getName(), is("The MIT License"));
> +       }
> +
> +       @Test
> +       public void testMITLicenseFamilyNotes() {
> +               assertThat(
> +                               MIT.getNotes(),
> +                               is("Note that MIT requires a NOTICE. All modifications
require notes. See http://opensource.org/licenses/MIT."));
> +       }
> +
> +       @Test
> +       public void testCDDL1LicenseFamilyCategory() {
> +               assertThat(CDDL1.getCategory(), is("CDDL1"));
> +       }
> +
> +       @Test
> +       public void testCDDL1LicenseFamilyName() {
> +               assertThat(CDDL1.getName(),
> +                               is("COMMON DEVELOPMENT AND DISTRIBUTION LICENSE Version
1.0"));
> +       }
> +
> +       @Test
> +       public void testCDDL1LicenseFamilyNotes() {
> +               assertThat(
> +                               CDDL1.getNotes(),
> +                               is("Note that CDDL1 requires a NOTICE. All modifications
require notes. See https://oss.oracle.com/licenses/CDDL."));
> +       }
> +
> +       @Test
> +       public void testOASISLicenseFamilyCategory() {
> +               assertThat(OASIS.getCategory(), is("OASIS"));
> +       }
> +
> +       @Test
> +       public void testOASISLicenseFamilyName() {
> +               assertThat(OASIS.getName(), is("OASIS Open License"));
> +       }
> +
> +       @Test
> +       public void testOASISLicenseFamilyNotes() {
> +               assertThat(
> +                               OASIS.getNotes(),
> +                               is("Note that OASIS requires a NOTICE. All modifications
require notes. See https://www.oasis-open.org/policies-guidelines/ipr."));
> +       }
> +
> +       @Test
> +       public void testTMF854LicenseFamilyCategory() {
> +               assertThat(TMF854.getCategory(), is("TMF  "));
> +       }
> +
> +       @Test
> +       public void testTMF854LicenseFamilyName() {
> +               assertThat(TMF854.getName(), is("Modified BSD License"));
> +       }
> +
> +       @Test
> +       public void testTMF854LicenseFamilyNotes() {
> +               assertThat(
> +                               TMF854.getNotes(),
> +                               is("Note that TMF854 requires a NOTICE. All modifications
require notes. See http://opensource.org/licenses/BSD-3-Clause."));
> +       }
> +
> +       @Test
> +       public void testDOJOLicenseFamilyCategory() {
> +               assertThat(DOJO.getCategory(), is("DOJO "));
> +       }
> +
> +       @Test
> +       public void testDOJOLicenseFamilyName() {
> +               assertThat(DOJO.getName(), is("Modified BSD License"));
> +       }
> +
> +       @Test
> +       public void testDOJOLicenseFamilyNotes() {
> +               assertThat(
> +                               DOJO.getNotes(),
> +                               is("Note that DOJO requires a NOTICE. All modifications
require notes. See http://dojotoolkit.org/community/licensing.shtml."));
> +       }
> +}
>
> Modified: creadur/rat/trunk/apache-rat-core/pom.xml
> URL: http://svn.apache.org/viewvc/creadur/rat/trunk/apache-rat-core/pom.xml?rev=1661803&r1=1661802&r2=1661803&view=diff
> ==============================================================================
> --- creadur/rat/trunk/apache-rat-core/pom.xml (original)
> +++ creadur/rat/trunk/apache-rat-core/pom.xml Mon Feb 23 22:25:53 2015
> @@ -75,6 +75,10 @@
>
>    <dependencies>
>      <dependency>
> +      <groupId>org.apache.rat</groupId>
> +      <artifactId>apache-rat-api</artifactId>
> +    </dependency>
> +    <dependency>
>        <groupId>commons-collections</groupId>
>        <artifactId>commons-collections</artifactId>
>      </dependency>
>
> Modified: creadur/rat/trunk/apache-rat-core/src/main/java/org/apache/rat/Report.java
> URL: http://svn.apache.org/viewvc/creadur/rat/trunk/apache-rat-core/src/main/java/org/apache/rat/Report.java?rev=1661803&r1=1661802&r2=1661803&view=diff
> ==============================================================================
> --- creadur/rat/trunk/apache-rat-core/src/main/java/org/apache/rat/Report.java (original)
> +++ creadur/rat/trunk/apache-rat-core/src/main/java/org/apache/rat/Report.java Mon Feb
23 22:25:53 2015
> @@ -332,7 +332,7 @@ public class Report {
>       * Output a report in the default style and default licence
>       * header matcher.
>       *
> -     * @param out - the output stream to recieve the styled report
> +     * @param out - the output stream to receive the styled report
>       * @param configuration the configuration to use
>       * @throws Exception in case of errors.
>       * @since Rat 0.8
> @@ -375,7 +375,6 @@ public class Report {
>       * @param style an input stream representing the stylesheet to use for styling the
report
>       * @param pConfiguration current report configuration.
>       *
> -     * @throws FileNotFoundException in case of I/O errors.
>       * @throws IOException in case of I/O errors.
>       * @throws TransformerConfigurationException in case of XML errors.
>       * @throws InterruptedException in case of threading errors.
> @@ -385,7 +384,7 @@ public class Report {
>       */
>      public static ClaimStatistic report(Writer out, IReportable base, final InputStream
style,
>              ReportConfiguration pConfiguration)
> -    throws IOException, TransformerConfigurationException, FileNotFoundException, InterruptedException,
RatException {
> +    throws IOException, TransformerConfigurationException, InterruptedException, RatException
{
>          PipedReader reader = new PipedReader();
>          PipedWriter writer = new PipedWriter(reader);
>          ReportTransformer transformer = new ReportTransformer(out, style, reader);
>
> Propchange: creadur/rat/trunk/apache-rat-plugin/
> ------------------------------------------------------------------------------
> --- svn:ignore (original)
> +++ svn:ignore Mon Feb 23 22:25:53 2015
> @@ -4,3 +4,4 @@ maven-eclipse.xml
>  *.iml
>  *.ipr
>  *.iws
> +**/*.iml
>
> Modified: creadur/rat/trunk/apache-rat-plugin/pom.xml
> URL: http://svn.apache.org/viewvc/creadur/rat/trunk/apache-rat-plugin/pom.xml?rev=1661803&r1=1661802&r2=1661803&view=diff
> ==============================================================================
> --- creadur/rat/trunk/apache-rat-plugin/pom.xml (original)
> +++ creadur/rat/trunk/apache-rat-plugin/pom.xml Mon Feb 23 22:25:53 2015
> @@ -70,6 +70,7 @@
>                <exclude>src/it/it1/src.apt</exclude>
>                <exclude>src/test/resources/unit/it2/src.txt</exclude>
>                <exclude>src/test/resources/unit/it3/src.apt</exclude>
> +              <exclude>**/*.iml</exclude>
>              </excludes>
>            </configuration>
>          </plugin>
>
> Propchange: creadur/rat/trunk/apache-rat-plugin/src/it/it1/
> ------------------------------------------------------------------------------
> --- svn:ignore (added)
> +++ svn:ignore Mon Feb 23 22:25:53 2015
> @@ -0,0 +1 @@
> +*.iml
>
> Propchange: creadur/rat/trunk/apache-rat-plugin/src/it/it4_RAT-168/
> ------------------------------------------------------------------------------
> --- svn:ignore (added)
> +++ svn:ignore Mon Feb 23 22:25:53 2015
> @@ -0,0 +1 @@
> +*.iml
>
> Modified: creadur/rat/trunk/apache-rat-plugin/src/it/it4_RAT-168/pom.xml
> URL: http://svn.apache.org/viewvc/creadur/rat/trunk/apache-rat-plugin/src/it/it4_RAT-168/pom.xml?rev=1661803&r1=1661802&r2=1661803&view=diff
> ==============================================================================
> --- creadur/rat/trunk/apache-rat-plugin/src/it/it4_RAT-168/pom.xml (original)
> +++ creadur/rat/trunk/apache-rat-plugin/src/it/it4_RAT-168/pom.xml Mon Feb 23 22:25:53
2015
> @@ -21,7 +21,7 @@
>      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
>    <modelVersion>4.0.0</modelVersion>
>    <groupId>org.apache.rat.test</groupId>
> -  <artifactId>it1</artifactId>
> +  <artifactId>it4rat168</artifactId>
>    <version>1.0</version>
>    <build>
>      <plugins>
>
> Propchange: creadur/rat/trunk/apache-rat-plugin/src/test/resources/unit/
> ------------------------------------------------------------------------------
> --- svn:ignore (added)
> +++ svn:ignore Mon Feb 23 22:25:53 2015
> @@ -0,0 +1 @@
> +
>
> Propchange: creadur/rat/trunk/apache-rat-plugin/src/test/resources/unit/it1/
> ------------------------------------------------------------------------------
> --- svn:ignore (added)
> +++ svn:ignore Mon Feb 23 22:25:53 2015
> @@ -0,0 +1 @@
> +*.iml
>
> Propchange: creadur/rat/trunk/apache-rat-plugin/src/test/resources/unit/it2/
> ------------------------------------------------------------------------------
> --- svn:ignore (added)
> +++ svn:ignore Mon Feb 23 22:25:53 2015
> @@ -0,0 +1 @@
> +*.iml
>
> Propchange: creadur/rat/trunk/apache-rat-plugin/src/test/resources/unit/it3/
> ------------------------------------------------------------------------------
> --- svn:ignore (added)
> +++ svn:ignore Mon Feb 23 22:25:53 2015
> @@ -0,0 +1 @@
> +*.iml
>
> Modified: creadur/rat/trunk/pom.xml
> URL: http://svn.apache.org/viewvc/creadur/rat/trunk/pom.xml?rev=1661803&r1=1661802&r2=1661803&view=diff
> ==============================================================================
> --- creadur/rat/trunk/pom.xml (original)
> +++ creadur/rat/trunk/pom.xml Mon Feb 23 22:25:53 2015
> @@ -83,6 +83,11 @@ agnostic home for software distribution
>      <dependencies>
>        <dependency>
>          <groupId>org.apache.rat</groupId>
> +        <artifactId>apache-rat-api</artifactId>
> +        <version>${project.version}</version>
> +      </dependency>
> +      <dependency>
> +        <groupId>org.apache.rat</groupId>
>          <artifactId>apache-rat-core</artifactId>
>          <version>${project.version}</version>
>        </dependency>
> @@ -126,11 +131,23 @@ agnostic home for software distribution
>        </dependency>
>        <dependency>
>          <groupId>org.mockito</groupId>
> +        <artifactId>mockito-core</artifactId>
> +        <version>1.9.5</version>
> +        <scope>test</scope>
> +      </dependency>
> +      <dependency>
> +        <groupId>org.mockito</groupId>
>          <artifactId>mockito-all</artifactId>
>          <version>1.9.5</version>
>          <scope>test</scope>
>        </dependency>
>        <dependency>
> +        <groupId>org.hamcrest</groupId>
> +        <artifactId>hamcrest-library</artifactId>
> +        <version>1.2.1</version>
> +        <scope>test</scope>
> +      </dependency>
> +      <dependency>
>          <groupId>org.apache.ant</groupId>
>          <artifactId>ant</artifactId>
>          <version>1.7.1</version>
> @@ -568,6 +585,7 @@ agnostic home for software distribution
>      </site>
>    </distributionManagement>
>    <modules>
> +    <module>apache-rat-api</module>
>      <module>apache-rat-core</module>
>      <module>apache-rat-plugin</module>
>      <module>apache-rat-tasks</module>
>
>

Mime
View raw message