asterixdb-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Blow (Code Review)" <do-not-re...@asterixdb.incubator.apache.org>
Subject Change in asterixdb[master]: [NO ISSUE] Refactor LicensingIT for extensibility
Date Mon, 28 Aug 2017 22:59:09 GMT
Michael Blow has submitted this change and it was merged.

Change subject: [NO ISSUE] Refactor LicensingIT for extensibility
......................................................................


[NO ISSUE] Refactor LicensingIT for extensibility

Change-Id: Idc82843905dbe3c3d26edcbbbebdde35fdefc775
Reviewed-on: https://asterix-gerrit.ics.uci.edu/1980
Sonar-Qube: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Contrib: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Till Westmann <tillw@apache.org>
---
M asterixdb/asterix-server/src/test/java/org/apache/asterix/server/test/LicensingIT.java
1 file changed, 19 insertions(+), 8 deletions(-)

Approvals:
  Till Westmann: Looks good to me, approved
  Jenkins: Verified; No violations found; ; Verified

Objections:
  Anon. E. Moose #1000171: 



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
index e5a3d3e..3ea5b23 100644
--- 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
@@ -61,21 +61,32 @@
 
     @Test
     public void testLicenseNoticeFilesPresent() throws IOException {
-        for (String name : Arrays.asList("LICENSE", "NOTICE")) {
+        for (String name : getRequiredArtifactNames()) {
             final String fileName = FileUtil.joinPath(installerDir, pathToLicensingFiles(),
name);
             Assert.assertTrue(fileName + " missing", new File(fileName).exists());
         }
     }
 
+    protected String[] getRequiredArtifactNames() {
+        return org.apache.commons.lang3.ArrayUtils.add(getLicenseArtifactNames(), "NOTICE");
+    }
+
     @Test
-    public void testNoMissingLicenses() throws IOException {
-        final File licenseFile = new File(FileUtil.joinPath(installerDir, pathToLicensingFiles(),
"LICENSE"));
-        List<String> badLines = new ArrayList<>();
-        for (String line : FileUtils.readLines(licenseFile, StandardCharsets.UTF_8)) {
-            if (line.matches("^\\s*MISSING:.*")) {
-                badLines.add(line.trim());
+    public void ensureNoMissingLicenses() throws IOException {
+        for (String licenseArtifactName : getLicenseArtifactNames()) {
+            final File licenseFile = new File(
+                    FileUtil.joinPath(installerDir, pathToLicensingFiles(), licenseArtifactName));
+            List<String> 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());
         }
-        Assert.assertEquals("Missing licenses in " + licenseFile + ": " + badLines, 0, badLines.size());
+    }
+
+    protected String[] getLicenseArtifactNames() {
+        return new String[] { "LICENSE" };
     }
 }

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/1980
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Idc82843905dbe3c3d26edcbbbebdde35fdefc775
Gerrit-PatchSet: 3
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Michael Blow <mblow@apache.org>
Gerrit-Reviewer: Anon. E. Moose #1000171
Gerrit-Reviewer: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Michael Blow <mblow@apache.org>
Gerrit-Reviewer: Till Westmann <tillw@apache.org>
Gerrit-Reviewer: abdullah alamoudi <bamousaa@gmail.com>

Mime
View raw message