Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id A829E200C38 for ; Wed, 15 Mar 2017 19:55:28 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id A69EA160B78; Wed, 15 Mar 2017 18:55:28 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id A53DB160B60 for ; Wed, 15 Mar 2017 19:55:27 +0100 (CET) Received: (qmail 89683 invoked by uid 500); 15 Mar 2017 18:55:26 -0000 Mailing-List: contact notifications-help@asterixdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@asterixdb.apache.org Delivered-To: mailing list notifications@asterixdb.apache.org Received: (qmail 89673 invoked by uid 99); 15 Mar 2017 18:55:26 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 Mar 2017 18:55:26 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id CAEF51A08DD for ; Wed, 15 Mar 2017 18:55:25 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.126 X-Spam-Level: ** X-Spam-Status: No, score=2.126 tagged_above=-999 required=6.31 tests=[MISSING_HEADERS=1.207, SPF_FAIL=0.919] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id bnqyxSrBBm1N for ; Wed, 15 Mar 2017 18:55:23 +0000 (UTC) Received: from unhygienix.ics.uci.edu (unhygienix.ics.uci.edu [128.195.14.130]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 026BF5F295 for ; Wed, 15 Mar 2017 18:55:22 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by unhygienix.ics.uci.edu (Postfix) with ESMTP id 333042411A0; Wed, 15 Mar 2017 11:55:22 -0700 (PDT) Date: Wed, 15 Mar 2017 11:55:22 -0700 From: "Michael Blow (Code Review)" CC: Jenkins , Till Westmann Reply-To: mblow@apache.org X-Gerrit-MessageType: merged Subject: Change in asterixdb[master]: Fix Missing License, Add Tests X-Gerrit-Change-Id: Ic6f4afc3dd9edd311709bf14ac4cbc7438a3716d X-Gerrit-ChangeURL: X-Gerrit-Commit: 51ef51ca61c5542732415c65b556b34a4ec490ac In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Content-Disposition: inline User-Agent: Gerrit/2.12.7 Message-Id: <20170315185522.333042411A0@unhygienix.ics.uci.edu> archived-at: Wed, 15 Mar 2017 18:55:28 -0000 Michael Blow has submitted this change and it was merged. Change subject: Fix Missing License, Add Tests ...................................................................... Fix Missing License, Add Tests - Fix missing license for updated appassembler components - Add tests to prevent missing licenses Change-Id: Ic6f4afc3dd9edd311709bf14ac4cbc7438a3716d Reviewed-on: https://asterix-gerrit.ics.uci.edu/1583 Sonar-Qube: Jenkins Tested-by: Jenkins BAD: Jenkins Integration-Tests: Jenkins Reviewed-by: Till Westmann --- M asterixdb/asterix-client-helper/pom.xml M asterixdb/asterix-installer/pom.xml A asterixdb/asterix-installer/src/test/java/org/apache/asterix/installer/test/InstallerLicensingIT.java M asterixdb/asterix-server/pom.xml A asterixdb/asterix-server/src/test/java/org/apache/asterix/server/test/LicensingIT.java M asterixdb/asterix-server/src/test/java/org/apache/asterix/server/test/SampleLocalClusterIT.java 6 files changed, 149 insertions(+), 6 deletions(-) Approvals: Till Westmann: Looks good to me, approved Jenkins: Verified; No violations found; No violations found; Verified diff --git a/asterixdb/asterix-client-helper/pom.xml b/asterixdb/asterix-client-helper/pom.xml index d3ad745..1769003 100644 --- a/asterixdb/asterix-client-helper/pom.xml +++ b/asterixdb/asterix-client-helper/pom.xml @@ -80,10 +80,20 @@ ${basedir}/../src/main/appended-resources/supplemental-models.xml + + + org.codehaus.mojo.appassembler:appassembler-booter:2.0.0 + https://raw.githubusercontent.com/mojohaus/appassembler/appassembler-2.0.0/LICENSE.txt + + + org.codehaus.mojo.appassembler:appassembler-model:2.0.0 + https://raw.githubusercontent.com/mojohaus/appassembler/appassembler-2.0.0/LICENSE.txt + + https://raw.githubusercontent.com/mojohaus/appassembler/master/LICENSE.txt - http://svn.codehaus.org/mojo/trunk/mojo/appassembler/LICENSE.txt + https://raw.githubusercontent.com/mojohaus/appassembler/appassembler-2.0.0/LICENSE.txt https://java.net/projects/stax-utils/sources/svn/content/trunk/LICENSE diff --git a/asterixdb/asterix-installer/pom.xml b/asterixdb/asterix-installer/pom.xml index a6e7541..8041b99 100644 --- a/asterixdb/asterix-installer/pom.xml +++ b/asterixdb/asterix-installer/pom.xml @@ -482,5 +482,12 @@ hyracks-util test + + org.apache.asterix + asterix-server + test-jar + ${project.version} + test + diff --git a/asterixdb/asterix-installer/src/test/java/org/apache/asterix/installer/test/InstallerLicensingIT.java b/asterixdb/asterix-installer/src/test/java/org/apache/asterix/installer/test/InstallerLicensingIT.java new file mode 100644 index 0000000..0fc06b8 --- /dev/null +++ b/asterixdb/asterix-installer/src/test/java/org/apache/asterix/installer/test/InstallerLicensingIT.java @@ -0,0 +1,29 @@ +/* + * 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.asterix.installer.test; + +import org.apache.asterix.server.test.LicensingIT; + +public class InstallerLicensingIT extends LicensingIT { + + @Override + protected String getInstallerDirPattern() { + return "asterix-installer.*-binary-assembly"; + } +} diff --git a/asterixdb/asterix-server/pom.xml b/asterixdb/asterix-server/pom.xml index 5bfe30f..1b971af 100644 --- a/asterixdb/asterix-server/pom.xml +++ b/asterixdb/asterix-server/pom.xml @@ -42,6 +42,17 @@ + org.apache.maven.plugins + maven-jar-plugin + + + + test-jar + + + + + org.apache.hyracks license-automation-plugin ${hyracks.version} @@ -124,6 +135,14 @@ xmlenc:xmlenc:0.52 https://cytranet.dl.sourceforge.net/project/xmlenc/xmlenc/0.52/xmlenc-0.52.tgz?xmlenc-0.52/COPYRIGHT + + org.codehaus.mojo.appassembler:appassembler-booter:2.0.0 + https://raw.githubusercontent.com/mojohaus/appassembler/appassembler-2.0.0/LICENSE.txt + + + org.codehaus.mojo.appassembler:appassembler-model:2.0.0 + https://raw.githubusercontent.com/mojohaus/appassembler/appassembler-2.0.0/LICENSE.txt + @@ -166,10 +185,6 @@ http://www.json.org/license.html The JSON License - - - https://raw.githubusercontent.com/mojohaus/appassembler/master/LICENSE.txt - http://svn.codehaus.org/mojo/trunk/mojo/appassembler/LICENSE.txt https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html diff --git a/asterixdb/asterix-server/src/test/java/org/apache/asterix/server/test/LicensingIT.java b/asterixdb/asterix-server/src/test/java/org/apache/asterix/server/test/LicensingIT.java new file mode 100644 index 0000000..e5a3d3e --- /dev/null +++ b/asterixdb/asterix-server/src/test/java/org/apache/asterix/server/test/LicensingIT.java @@ -0,0 +1,81 @@ +/* + * 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.asterix.server.test; + +import java.io.File; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import org.apache.commons.io.FileUtils; +import org.apache.hyracks.util.file.FileUtil; +import org.junit.Assert; +import org.junit.Before; +import org.junit.FixMethodOrder; +import org.junit.Test; +import org.junit.runners.MethodSorters; + +@FixMethodOrder(MethodSorters.JVM) +public class LicensingIT { + + // The "target" subdirectory of asterix-server. All outputs go here. + private static final String TARGET_DIR = FileUtil.joinPath("target"); + + protected String installerDir; + + @Before + public void setup() { + final String pattern = getInstallerDirPattern(); + final String[] list = new File(TARGET_DIR).list((dir, name) -> name.matches(pattern)); + Assert.assertNotNull("installerDir", list); + Assert.assertFalse("Ambiguous install dir (" + pattern + "): " + Arrays.toString(list), list.length > 1); + Assert.assertEquals("Can't find install dir (" + pattern + ")", 1, list.length); + installerDir = FileUtil.joinPath(TARGET_DIR, list[0]); + } + + protected String getInstallerDirPattern() { + return "asterix-server.*-binary-assembly"; + } + + protected String pathToLicensingFiles() { + return ""; + } + + @Test + public void testLicenseNoticeFilesPresent() throws IOException { + for (String name : Arrays.asList("LICENSE", "NOTICE")) { + final String fileName = FileUtil.joinPath(installerDir, pathToLicensingFiles(), name); + Assert.assertTrue(fileName + " missing", new File(fileName).exists()); + } + } + + @Test + public void testNoMissingLicenses() throws IOException { + final File licenseFile = new File(FileUtil.joinPath(installerDir, pathToLicensingFiles(), "LICENSE")); + List badLines = new ArrayList<>(); + for (String line : FileUtils.readLines(licenseFile, StandardCharsets.UTF_8)) { + if (line.matches("^\\s*MISSING:.*")) { + badLines.add(line.trim()); + } + } + Assert.assertEquals("Missing licenses in " + licenseFile + ": " + badLines, 0, badLines.size()); + } +} diff --git a/asterixdb/asterix-server/src/test/java/org/apache/asterix/server/test/SampleLocalClusterIT.java b/asterixdb/asterix-server/src/test/java/org/apache/asterix/server/test/SampleLocalClusterIT.java index 566ebb8..61128c5 100644 --- a/asterixdb/asterix-server/src/test/java/org/apache/asterix/server/test/SampleLocalClusterIT.java +++ b/asterixdb/asterix-server/src/test/java/org/apache/asterix/server/test/SampleLocalClusterIT.java @@ -70,7 +70,8 @@ } outDir.mkdirs(); - String[] pathElements = new String[]{TARGET_DIR, new File(TARGET_DIR).list((dir, name) -> name.matches("asterix-server.*-binary-assembly.zip"))[0]}; + String[] pathElements = new String[] { TARGET_DIR, + new File(TARGET_DIR).list((dir, name) -> name.matches("asterix-server.*-binary-assembly.zip"))[0] }; String installerZip = FileUtil.joinPath(pathElements); TestHelper.unzip(installerZip, OUTPUT_DIR); -- To view, visit https://asterix-gerrit.ics.uci.edu/1583 To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic6f4afc3dd9edd311709bf14ac4cbc7438a3716d Gerrit-PatchSet: 2 Gerrit-Project: asterixdb Gerrit-Branch: master Gerrit-Owner: Michael Blow Gerrit-Reviewer: Jenkins Gerrit-Reviewer: Michael Blow Gerrit-Reviewer: Till Westmann