Propchange: 
creadur/whisker/trunk/apache-whisker-plugin4maven/src/it/whisker-10/descriptor.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
creadur/whisker/trunk/apache-whisker-plugin4maven/src/it/whisker-10/pom.xml
URL: 
http://svn.apache.org/viewvc/creadur/whisker/trunk/apache-whisker-plugin4maven/src/it/whisker-10/pom.xml?rev=1405541&view=auto
==============================================================================
--- creadur/whisker/trunk/apache-whisker-plugin4maven/src/it/whisker-10/pom.xml 
(added)
+++ creadur/whisker/trunk/apache-whisker-plugin4maven/src/it/whisker-10/pom.xml 
Sun Nov  4 13:26:23 2012
@@ -0,0 +1,64 @@
+<?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
+  xmlns="http://maven.apache.org/POM/4.0.0";
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";
+>
+  <modelVersion>4.0.0</modelVersion>
+
+
+  <groupId>org.apache.creadur.whisker.it</groupId>
+  <artifactId>PrimaryLicenseWithCopyrightNotice</artifactId>
+  <version>@project.version@</version>
+
+  <name>WHISKER-10 mixture copyright notices</name>
+  <description>
+  WHISKER-10 a mixture of licenses only some with copyright notices.
+  </description>
+
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    <target.jdk>1.5</target.jdk>
+  </properties>
+
+  <build>
+    <plugins>
+        <plugin>
+          <groupId>org.apache.creadur.whisker</groupId>
+            <artifactId>apache-whisker-plugin4maven</artifactId>
+            <version>@project.version@</version>
+            <executions>
+                <execution>
+                    <id>generate-stuff</id>
+                    <phase>package</phase>
+                    <goals>
+                        <goal>generate</goal>
+                    </goals>
+                </execution>
+            </executions>
+            <configuration>
+                <descriptor>descriptor.xml</descriptor>
+            </configuration>
+        </plugin>
+    </plugins>
+  </build>
+
+</project>
\ No newline at end of file

Propchange: 
creadur/whisker/trunk/apache-whisker-plugin4maven/src/it/whisker-10/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
creadur/whisker/trunk/apache-whisker-plugin4maven/src/it/whisker-10/verify.groovy
URL: 
http://svn.apache.org/viewvc/creadur/whisker/trunk/apache-whisker-plugin4maven/src/it/whisker-10/verify.groovy?rev=1405541&view=auto
==============================================================================
--- 
creadur/whisker/trunk/apache-whisker-plugin4maven/src/it/whisker-10/verify.groovy
 (added)
+++ 
creadur/whisker/trunk/apache-whisker-plugin4maven/src/it/whisker-10/verify.groovy
 Sun Nov  4 13:26:23 2012
@@ -0,0 +1,35 @@
+/**
+ * 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.
+ */
+
+import static org.apache.creadur.whisker.it.Helpers.*
+
+results = results();
+
+if (noticeIsMissing(basedir)) {
+    results.fail("NOTICE is missing")
+}
+if (licenseIsMissing(basedir)) {
+    results.fail("LICENSE is missing")
+}
+
+if (results.hasFailed()) {
+    return results.report();
+} else {
+    return licenseIn(basedir).expectThat(aLineContainsCDDL1()).failures()
+}
\ No newline at end of file

Added: 
creadur/whisker/trunk/apache-whisker-plugin4maven/src/test/java/org/apache/creadur/whisker/it/AnyLineContainsCheck.java
URL: 
http://svn.apache.org/viewvc/creadur/whisker/trunk/apache-whisker-plugin4maven/src/test/java/org/apache/creadur/whisker/it/AnyLineContainsCheck.java?rev=1405541&view=auto
==============================================================================
--- 
creadur/whisker/trunk/apache-whisker-plugin4maven/src/test/java/org/apache/creadur/whisker/it/AnyLineContainsCheck.java
 (added)
+++ 
creadur/whisker/trunk/apache-whisker-plugin4maven/src/test/java/org/apache/creadur/whisker/it/AnyLineContainsCheck.java
 Sun Nov  4 13:26:23 2012
@@ -0,0 +1,49 @@
+/**
+ * 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.creadur.whisker.it;
+
+import static org.apache.creadur.whisker.it.Not.*;
+
+public class AnyLineContainsCheck {
+
+    final String value;
+
+    Latch latch = Latch.UP;
+
+    public AnyLineContainsCheck(String value) {
+        super();
+        this.value = value;
+    }
+
+    public void check(String line) {
+        if (isNotNull(line) && not(hasPassed()) && line.contains(value)) {
+            latch = latch.push();
+        }
+    }
+
+    public boolean hasPassed() {
+        return latch == Latch.DOWN;
+    }
+
+    public void report(Results result) {
+        if (not(hasPassed())) {
+           result.fail("Missing from result: " + value);
+        }
+    }
+}

Propchange: 
creadur/whisker/trunk/apache-whisker-plugin4maven/src/test/java/org/apache/creadur/whisker/it/AnyLineContainsCheck.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
creadur/whisker/trunk/apache-whisker-plugin4maven/src/test/java/org/apache/creadur/whisker/it/Helpers.java
URL: 
http://svn.apache.org/viewvc/creadur/whisker/trunk/apache-whisker-plugin4maven/src/test/java/org/apache/creadur/whisker/it/Helpers.java?rev=1405541&view=auto
==============================================================================
--- 
creadur/whisker/trunk/apache-whisker-plugin4maven/src/test/java/org/apache/creadur/whisker/it/Helpers.java
 (added)
+++ 
creadur/whisker/trunk/apache-whisker-plugin4maven/src/test/java/org/apache/creadur/whisker/it/Helpers.java
 Sun Nov  4 13:26:23 2012
@@ -0,0 +1,56 @@
+/**
+ * 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.creadur.whisker.it;
+
+import static org.apache.creadur.whisker.it.Not.not;
+
+import java.io.File;
+
+public class Helpers {
+
+    public static AnyLineContainsCheck aLineContainsCDDL1() {
+        return new AnyLineContainsCheck("COMMON DEVELOPMENT AND DISTRIBUTION 
LICENSE (CDDL) Version 1.0");
+    }
+
+    public static AnyLineContainsCheck aLineContains(String value) {
+        return new AnyLineContainsCheck(value);
+    }
+
+    private static final String PATH_TO_LICENSE_FILE = "target/LICENSE";
+
+    public static boolean noticeIsMissing(File basedir) {
+        return fileIsMissing(basedir, "target/NOTICE");
+    }
+
+    private static boolean fileIsMissing(File basedir, final String string) {
+        return not(new File(basedir, string).exists());
+    }
+
+    public static boolean licenseIsMissing(File basedir) {
+        return fileIsMissing(basedir, PATH_TO_LICENSE_FILE);
+    }
+
+    public static LicenseVerifier licenseIn(File basedir) {
+        return new LicenseVerifier(new File(basedir, PATH_TO_LICENSE_FILE));
+    }
+
+    public static Results results() {
+        return new Results();
+    }
+}

Propchange: 
creadur/whisker/trunk/apache-whisker-plugin4maven/src/test/java/org/apache/creadur/whisker/it/Helpers.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
creadur/whisker/trunk/apache-whisker-plugin4maven/src/test/java/org/apache/creadur/whisker/it/Latch.java
URL: 
http://svn.apache.org/viewvc/creadur/whisker/trunk/apache-whisker-plugin4maven/src/test/java/org/apache/creadur/whisker/it/Latch.java?rev=1405541&view=auto
==============================================================================
--- 
creadur/whisker/trunk/apache-whisker-plugin4maven/src/test/java/org/apache/creadur/whisker/it/Latch.java
 (added)
+++ 
creadur/whisker/trunk/apache-whisker-plugin4maven/src/test/java/org/apache/creadur/whisker/it/Latch.java
 Sun Nov  4 13:26:23 2012
@@ -0,0 +1,36 @@
+/**
+ * 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.creadur.whisker.it;
+
+public enum Latch {
+
+    UP, DOWN;
+
+    private Latch() {}
+
+    public Latch push() {
+        final Latch result;
+        if (this == DOWN) {
+            result = this;
+        } else {
+            result = DOWN;
+        }
+        return result;
+    }
+}

Propchange: 
creadur/whisker/trunk/apache-whisker-plugin4maven/src/test/java/org/apache/creadur/whisker/it/Latch.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
creadur/whisker/trunk/apache-whisker-plugin4maven/src/test/java/org/apache/creadur/whisker/it/LicenseVerifier.java
URL: 
http://svn.apache.org/viewvc/creadur/whisker/trunk/apache-whisker-plugin4maven/src/test/java/org/apache/creadur/whisker/it/LicenseVerifier.java?rev=1405541&view=auto
==============================================================================
--- 
creadur/whisker/trunk/apache-whisker-plugin4maven/src/test/java/org/apache/creadur/whisker/it/LicenseVerifier.java
 (added)
+++ 
creadur/whisker/trunk/apache-whisker-plugin4maven/src/test/java/org/apache/creadur/whisker/it/LicenseVerifier.java
 Sun Nov  4 13:26:23 2012
@@ -0,0 +1,66 @@
+/**
+ * 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.creadur.whisker.it;
+
+import java.io.*;
+import java.util.ArrayList;
+import java.util.List;
+
+public class LicenseVerifier {
+
+    final File licenseFile;
+    final List<AnyLineContainsCheck> checks;
+
+
+    public LicenseVerifier(final File licenseFile) {
+        this.licenseFile = licenseFile;
+        this.checks = new ArrayList<AnyLineContainsCheck>();
+    }
+
+    public LicenseVerifier expectThat(final AnyLineContainsCheck check) {
+        this.checks.add(check);
+        return this;
+    }
+
+    public String failures() throws Exception {
+        BufferedReader reader = new BufferedReader(new InputStreamReader(
+                new FileInputStream(licenseFile), "UTF-8"));
+        try {
+            String line = null;
+            do {
+                line = checkLine(reader.readLine());
+            } while (line != null);
+        } finally {
+            reader.close();
+        }
+
+        Results result = new Results().titled("FAILURES in LICENSE:");
+        for (AnyLineContainsCheck check:checks) {
+            check.report(result);
+        }
+        return result.report();
+    }
+
+    private String checkLine(final String line) {
+        for (AnyLineContainsCheck check:checks) {
+            check.check(line);
+        }
+        return line;
+    }
+}

Propchange: 
creadur/whisker/trunk/apache-whisker-plugin4maven/src/test/java/org/apache/creadur/whisker/it/LicenseVerifier.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
creadur/whisker/trunk/apache-whisker-plugin4maven/src/test/java/org/apache/creadur/whisker/it/Not.java
URL: 
http://svn.apache.org/viewvc/creadur/whisker/trunk/apache-whisker-plugin4maven/src/test/java/org/apache/creadur/whisker/it/Not.java?rev=1405541&view=auto
==============================================================================
--- 
creadur/whisker/trunk/apache-whisker-plugin4maven/src/test/java/org/apache/creadur/whisker/it/Not.java
 (added)
+++ 
creadur/whisker/trunk/apache-whisker-plugin4maven/src/test/java/org/apache/creadur/whisker/it/Not.java
 Sun Nov  4 13:26:23 2012
@@ -0,0 +1,30 @@
+/**
+ * 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.creadur.whisker.it;
+
+public class Not {
+
+    public static boolean not(boolean truth) {
+        return !truth;
+    }
+
+    public static boolean isNotNull(Object object) {
+        return object != null;
+    }
+}

Propchange: 
creadur/whisker/trunk/apache-whisker-plugin4maven/src/test/java/org/apache/creadur/whisker/it/Not.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
creadur/whisker/trunk/apache-whisker-plugin4maven/src/test/java/org/apache/creadur/whisker/it/Results.java
URL: 
http://svn.apache.org/viewvc/creadur/whisker/trunk/apache-whisker-plugin4maven/src/test/java/org/apache/creadur/whisker/it/Results.java?rev=1405541&view=auto
==============================================================================
--- 
creadur/whisker/trunk/apache-whisker-plugin4maven/src/test/java/org/apache/creadur/whisker/it/Results.java
 (added)
+++ 
creadur/whisker/trunk/apache-whisker-plugin4maven/src/test/java/org/apache/creadur/whisker/it/Results.java
 Sun Nov  4 13:26:23 2012
@@ -0,0 +1,64 @@
+/**
+ * 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.creadur.whisker.it;
+
+public class Results {
+
+    private final StringBuilder builder = new StringBuilder("***FAILED***\n");
+    private boolean failed = false;
+
+    public boolean hasFailed() {
+        return failed;
+    }
+
+    public Results fail(String message) {
+        builder.append("  ");
+        builder.append(message);
+        builder.append("\n");
+        failed = true;
+        return this;
+    }
+
+    public String report() {
+        final String result;
+        if (failed) {
+            endLine();
+            endLine();
+            endLine();
+            result = builder.toString();
+        } else {
+            result = null;
+        }
+        return result;
+    }
+
+    private void endLine() {
+        builder.append('\n');
+    }
+
+    public Results titled(final String title) {
+        endLine();
+        endLine();
+        endLine();
+        builder.append('#').append('#').append(' ').append(title);
+        endLine();
+        endLine();
+        return this;
+    }
+}

Propchange: 
creadur/whisker/trunk/apache-whisker-plugin4maven/src/test/java/org/apache/creadur/whisker/it/Results.java
------------------------------------------------------------------------------
    svn:eol-style = native


Reply via email to