From 904a850193589d57a0ccfeba4f66b82dd0ad3bf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonatan=20J=C3=A4derberg?= Date: Tue, 26 Feb 2019 19:44:54 +0100 Subject: [PATCH 1/4] Update Scala from 2.11 to 2.12 Co-Authored-By: Mats Rydberg --- tools/pom.xml | 11 ++++-- tools/tck-api/pom.xml | 35 ++++++++++------- tools/tck-integrity-tests/pom.xml | 39 ++++++++++--------- .../tools/tck/FeatureFormatChecker.scala | 2 +- .../tools/tck/validateParameters.scala | 5 +-- .../tools/tck/validateResults.scala | 6 +-- .../tools/tck/validateSideEffects.scala | 6 +-- .../opencypher/tools/tck/TckTestSupport.scala | 2 +- 8 files changed, 59 insertions(+), 47 deletions(-) diff --git a/tools/pom.xml b/tools/pom.xml index 59596dba61..c20c93f98a 100644 --- a/tools/pom.xml +++ b/tools/pom.xml @@ -20,10 +20,15 @@ - ${project.basedir}/.. - UTF-8 - 4.7 4.5.3 + 4.7 + UTF-8 + ${project.basedir}/.. + 2.12 + 3.4.4 + 1.13.5 + 3.0.5 + 2.12.7 diff --git a/tools/tck-api/pom.xml b/tools/tck-api/pom.xml index 3bcb50ad88..aad453c110 100644 --- a/tools/tck-api/pom.xml +++ b/tools/tck-api/pom.xml @@ -10,15 +10,13 @@ 1.0-SNAPSHOT - tck-api + tck-api_2.12 1.0-SNAPSHOT openCypher TCK API http://opencypher.org openCypher Technology Compatibility Kit API - 2.11.7 - 2.11 ${project.basedir}/../.. @@ -34,7 +32,7 @@ net.alchim31.maven scala-maven-plugin - 3.2.0 + ${scala.maven.plugin.version} @@ -50,22 +48,29 @@ ${scala.binary.version} + maven-surefire-plugin - 2.19 + 2.22.1 org.junit.platform - junit-platform-surefire-provider - 1.0.2 + junit-platform-launcher + 1.4.0 + + + org.junit.jupiter + junit-jupiter-engine + 5.4.0 org.junit.vintage junit-vintage-engine - 4.12.2 + 5.4.0 + @@ -92,7 +97,7 @@ org.junit.jupiter junit-jupiter-api - 5.0.2 + 5.4.0 @@ -111,8 +116,8 @@ org.scalatest - scalatest_2.11 - 2.2.6 + scalatest_${scala.binary.version} + ${scala.scalatest.version} test @@ -124,22 +129,22 @@ org.scalacheck - scalacheck_2.11 - 1.13.0 + scalacheck_${scala.binary.version} + ${scala.scalacheck.version} test org.junit.platform junit-platform-launcher - 1.0.2 + 1.4.0 test org.junit.jupiter junit-jupiter-engine - 5.0.2 + 5.4.0 test diff --git a/tools/tck-integrity-tests/pom.xml b/tools/tck-integrity-tests/pom.xml index b188b4db21..eb603bc15d 100644 --- a/tools/tck-integrity-tests/pom.xml +++ b/tools/tck-integrity-tests/pom.xml @@ -10,15 +10,13 @@ 1.0-SNAPSHOT - tck-integrity-tests + tck-integrity-tests_2.12 1.0-SNAPSHOT openCypher TCK Integrity Tests http://opencypher.org openCypher Technology Compatibility Kit Integrity Tests - 2.11.7 - 2.11 ${project.basedir}/../.. @@ -34,7 +32,7 @@ net.alchim31.maven scala-maven-plugin - 3.2.0 + ${scala.maven.plugin.version} @@ -52,17 +50,22 @@ maven-surefire-plugin - 2.19 + 2.22.1 org.junit.platform - junit-platform-surefire-provider - 1.0.2 + junit-platform-launcher + 1.4.0 + + + org.junit.jupiter + junit-jupiter-engine + 5.4.0 org.junit.vintage junit-vintage-engine - 4.12.2 + 5.4.0 @@ -80,15 +83,15 @@ - info.cukes - cucumber-scala_2.11 - 1.2.4 + io.cucumber + cucumber-scala_${scala.binary.version} + 4.2.0 - info.cukes + io.cucumber cucumber-junit - 1.2.4 + 4.2.0 @@ -114,8 +117,8 @@ org.scalatest - scalatest_2.11 - 2.2.6 + scalatest_${scala.binary.version} + ${scala.scalatest.version} test @@ -127,14 +130,14 @@ org.scalacheck - scalacheck_2.11 - 1.13.0 + scalacheck_${scala.binary.version} + ${scala.scalacheck.version} test org.opencypher - tck-api + tck-api_${scala.binary.version} ${project.version} diff --git a/tools/tck-integrity-tests/src/main/scala/org/opencypher/tools/tck/FeatureFormatChecker.scala b/tools/tck-integrity-tests/src/main/scala/org/opencypher/tools/tck/FeatureFormatChecker.scala index c9cc4f6f15..1b9f651bc3 100644 --- a/tools/tck-integrity-tests/src/main/scala/org/opencypher/tools/tck/FeatureFormatChecker.scala +++ b/tools/tck-integrity-tests/src/main/scala/org/opencypher/tools/tck/FeatureFormatChecker.scala @@ -29,7 +29,7 @@ package org.opencypher.tools.tck import java.util.concurrent.atomic.AtomicInteger -import cucumber.api.DataTable +import io.cucumber.datatable.DataTable import org.opencypher.tools.tck.api.InvalidFeatureFormatException import org.opencypher.tools.tck.constants.TCKStepDefinitions._ diff --git a/tools/tck-integrity-tests/src/main/scala/org/opencypher/tools/tck/validateParameters.scala b/tools/tck-integrity-tests/src/main/scala/org/opencypher/tools/tck/validateParameters.scala index 27001a0b09..4071447138 100644 --- a/tools/tck-integrity-tests/src/main/scala/org/opencypher/tools/tck/validateParameters.scala +++ b/tools/tck-integrity-tests/src/main/scala/org/opencypher/tools/tck/validateParameters.scala @@ -27,7 +27,7 @@ */ package org.opencypher.tools.tck -import cucumber.api.DataTable +import io.cucumber.datatable.DataTable import org.opencypher.tools.tck.parsing.FormatListener import scala.collection.JavaConverters._ @@ -41,8 +41,7 @@ object validateParameters extends (DataTable => Option[String]) { override def apply(table: DataTable): Option[String] = { // TODO: Specify constraints for parameter keys, and enforce these here - // val keys = table.transpose().topCells().asScala - val values = table.transpose().cells(1).asScala.head.asScala + val values = table.transpose().row(1).asScala val badValues = values.filterNot(this (_)) if (badValues.isEmpty) None diff --git a/tools/tck-integrity-tests/src/main/scala/org/opencypher/tools/tck/validateResults.scala b/tools/tck-integrity-tests/src/main/scala/org/opencypher/tools/tck/validateResults.scala index aba751a890..671c62514f 100644 --- a/tools/tck-integrity-tests/src/main/scala/org/opencypher/tools/tck/validateResults.scala +++ b/tools/tck-integrity-tests/src/main/scala/org/opencypher/tools/tck/validateResults.scala @@ -27,7 +27,7 @@ */ package org.opencypher.tools.tck -import cucumber.api.DataTable +import io.cucumber.datatable.DataTable import org.opencypher.tools.tck.parsing.FormatListener import scala.collection.JavaConverters._ @@ -41,8 +41,8 @@ object validateResults extends (DataTable => Option[String]) { override def apply(table: DataTable): Option[String] = { // TODO: Specify constraints for column names, and enforce these here - val keys = table.topCells().asScala - val cells = table.cells(1).asScala + val keys = table.cells().asScala.head + val cells = table.cells().asScala.tail val badValues = cells.flatMap { list => list.asScala.filterNot(this (_)) diff --git a/tools/tck-integrity-tests/src/main/scala/org/opencypher/tools/tck/validateSideEffects.scala b/tools/tck-integrity-tests/src/main/scala/org/opencypher/tools/tck/validateSideEffects.scala index 5568c083b1..40c10e6aba 100644 --- a/tools/tck-integrity-tests/src/main/scala/org/opencypher/tools/tck/validateSideEffects.scala +++ b/tools/tck-integrity-tests/src/main/scala/org/opencypher/tools/tck/validateSideEffects.scala @@ -27,7 +27,7 @@ */ package org.opencypher.tools.tck -import cucumber.api.DataTable +import io.cucumber.datatable.DataTable import org.opencypher.tools.tck.constants.TCKSideEffects import scala.collection.JavaConverters._ @@ -39,8 +39,8 @@ import scala.collection.JavaConverters._ object validateSideEffects extends (DataTable => Option[String]) { override def apply(table: DataTable): Option[String] = { - val keys = table.transpose().topCells().asScala - val values = table.transpose().cells(1).asScala.head.asScala + val keys = table.transpose().row(0).asScala + val values = table.transpose().rows(1).asList.asScala val msg = s"""${checkKeys(keys)} |${checkValues(values)}""".stripMargin diff --git a/tools/tck-integrity-tests/src/test/scala/org/opencypher/tools/tck/TckTestSupport.scala b/tools/tck-integrity-tests/src/test/scala/org/opencypher/tools/tck/TckTestSupport.scala index 31a233a5fd..cb7a323b50 100644 --- a/tools/tck-integrity-tests/src/test/scala/org/opencypher/tools/tck/TckTestSupport.scala +++ b/tools/tck-integrity-tests/src/test/scala/org/opencypher/tools/tck/TckTestSupport.scala @@ -27,7 +27,7 @@ */ package org.opencypher.tools.tck -import cucumber.api.DataTable +import io.cucumber.datatable.DataTable import org.junit.runner.RunWith import org.scalatest.junit.JUnitRunner import org.scalatest.{FunSuiteLike, Matchers} From 9247859e27856088df7b157cccf12f16ba9fb0b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonatan=20J=C3=A4derberg?= Date: Tue, 26 Feb 2019 20:49:30 +0100 Subject: [PATCH 2/4] Refactor the project object model --- pom.xml | 313 ++++++++++++++++++++++++++---- tck/pom.xml | 1 - tools/grammar/pom.xml | 21 +- tools/pom.xml | 39 +--- tools/tck-api/pom.xml | 59 +----- tools/tck-integrity-tests/pom.xml | 51 +---- 6 files changed, 292 insertions(+), 192 deletions(-) diff --git a/pom.xml b/pom.xml index 46e6f83df1..fc6f7bff6e 100644 --- a/pom.xml +++ b/pom.xml @@ -27,9 +27,30 @@ - ${project.basedir} + 4.5.3 + 4.7 + 1.0.0 + 1.8 + 4.2.0 + 5.0.0 + 1.3 + 1.4.0 + 5.4.0 + 3.5 + 3.0.0 + 3.0.0 + 2.22.1 + 3.4.4 + 2.12.7 + 1.13.5 + 3.0.5 + 2.0 ${project.rootdir}/ASL-2-header.txt + 1.8 + 1.8 UTF-8 + ${project.basedir} + 2.12 @@ -41,42 +62,264 @@ + + + + + org.scala-lang + scala-library + ${dep.scala.version} + + + + org.opencypher + tck + ${project.version} + + + + org.antlr + antlr4-runtime + ${dep.antlr.runtime.version} + + + + org.antlr + antlr4 + ${dep.antlr.generator.version} + + + + org.junit.jupiter + junit-jupiter-api + ${dep.junit.version} + + + + io.cucumber + gherkin + ${dep.gherkin.version} + + + + org.apiguardian + apiguardian-api + ${dep.apiguardian.version} + + + + io.cucumber + cucumber-scala_${scala.binary.version} + ${dep.cucumber.version} + + + + io.cucumber + cucumber-junit + ${dep.cucumber.version} + + + + org.apache.xmlgraphics + batik-svggen + ${dep.batik.version} + test + + + + org.apache.xmlgraphics + batik-swing + ${dep.batik.version} + test + + + + org.apache.xmlgraphics + xmlgraphics-commons + ${dep.xmlgraphics-commons.version} + test + + + + org.scalatest + scalatest_${scala.binary.version} + ${dep.scalatest.version} + test + + + org.scala-lang + scala-library + + + + + + org.scalacheck + scalacheck_${scala.binary.version} + ${dep.scalacheck.version} + test + + + + org.junit.platform + junit-platform-launcher + ${dep.junit.platform.version} + test + + + + org.junit.jupiter + junit-jupiter-engine + ${dep.junit.version} + test + + + + junit + junit + 4.12 + test + + + + org.hamcrest + hamcrest-library + ${dep.hamcrest.version} + test + + + + + + + + + + + net.alchim31.maven + scala-maven-plugin + ${dep.scala.maven.plugin.version} + + + + compile + testCompile + add-source + doc-jar + + + + + ${dep.scala.version} + ${scala.binary.version} + + + + + maven-surefire-plugin + ${dep.maven.surefire.plugin.version} + + + org.junit.platform + junit-platform-launcher + ${dep.junit.platform.version} + + + org.junit.jupiter + junit-jupiter-engine + ${dep.junit.version} + + + org.junit.vintage + junit-vintage-engine + ${dep.junit.version} + + + + + + org.neo4j.build.plugins + license-maven-plugin + 3 + + + check-licenses + initialize + + check + + + + + true +
${license.header}
+ + src/**/*.java + src/**/*.scala + **/*.feature + grammar/*.xml + + + SLASHSTAR_STYLE + SLASHSTAR_STYLE + SCRIPT_STYLE + XML_STYLE + + currentYear + + 2015 + +
+
+ + + org.apache.maven.plugins + maven-source-plugin + ${dep.maven.source.plugin.version} + + + attach-sources + + jar + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + ${dep.maven.javadoc.plugin.version} + + + attach-javadocs + + jar + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + ${dep.maven.compiler.plugin.version} + + + -parameters + + + + +
+
+ - - org.neo4j.build.plugins - license-maven-plugin - 3 - - - check-licenses - initialize - - check - - - - - true -
${license.header}
- - src/**/*.java - src/**/*.scala - **/*.feature - grammar/*.xml - - - SLASHSTAR_STYLE - SLASHSTAR_STYLE - SCRIPT_STYLE - XML_STYLE - - currentYear - - 2015 - -
-
+ + org.neo4j.build.plugins + license-maven-plugin +
diff --git a/tck/pom.xml b/tck/pom.xml index 0797eb59ba..ebca68c6d7 100644 --- a/tck/pom.xml +++ b/tck/pom.xml @@ -11,7 +11,6 @@ tck - 1.0-SNAPSHOT openCypher TCK Features and Graphs http://opencypher.org diff --git a/tools/grammar/pom.xml b/tools/grammar/pom.xml index 566fdf02f5..cce9011d4e 100644 --- a/tools/grammar/pom.xml +++ b/tools/grammar/pom.xml @@ -11,7 +11,6 @@ grammar - 1.0-SNAPSHOT openCypher Grammar Developer Tools http://opencypher.org openCypher Grammar @@ -31,46 +30,42 @@
+ junit junit - 4.12 - test + org.hamcrest hamcrest-library - 1.3 - test + org.antlr antlr4 - ${antlr.generator.version} + org.antlr antlr4-runtime - ${antlr.runtime.version} + org.apache.xmlgraphics batik-svggen - 1.8 - test + org.apache.xmlgraphics batik-swing - 1.8 - test + org.apache.xmlgraphics xmlgraphics-commons - 2.0 - test + diff --git a/tools/pom.xml b/tools/pom.xml index c20c93f98a..dc69777800 100644 --- a/tools/pom.xml +++ b/tools/pom.xml @@ -11,7 +11,6 @@ tools pom - 1.0-SNAPSHOT tools http://opencypher.org openCypher Developer Tools @@ -20,15 +19,7 @@ - 4.5.3 - 4.7 - UTF-8 ${project.basedir}/.. - 2.12 - 3.4.4 - 1.13.5 - 3.0.5 - 2.12.7 @@ -40,44 +31,22 @@ + org.apache.maven.plugins maven-source-plugin - 3.0.0 - - - attach-sources - - jar - - - + org.apache.maven.plugins maven-javadoc-plugin - 3.0.0 - - - attach-javadocs - - jar - - - + org.apache.maven.plugins maven-compiler-plugin - 3.5 - - 1.8 - 1.8 - - -parameters - - + diff --git a/tools/tck-api/pom.xml b/tools/tck-api/pom.xml index aad453c110..c50071f2a4 100644 --- a/tools/tck-api/pom.xml +++ b/tools/tck-api/pom.xml @@ -11,7 +11,6 @@ tck-api_2.12 - 1.0-SNAPSHOT openCypher TCK API http://opencypher.org openCypher Technology Compatibility Kit API @@ -32,84 +31,42 @@ net.alchim31.maven scala-maven-plugin - ${scala.maven.plugin.version} - - - - compile - testCompile - add-source - doc-jar - - - - - ${scala.version} - ${scala.binary.version} - - maven-surefire-plugin - 2.22.1 - - - org.junit.platform - junit-platform-launcher - 1.4.0 - - - org.junit.jupiter - junit-jupiter-engine - 5.4.0 - - - org.junit.vintage - junit-vintage-engine - 5.4.0 - - - - org.scala-lang scala-library - ${scala.version} org.opencypher tck - ${project.version} org.antlr antlr4-runtime - ${antlr.runtime.version} org.junit.jupiter junit-jupiter-api - 5.4.0 io.cucumber gherkin - 5.0.0 org.apiguardian apiguardian-api - 1.0.0 @@ -117,36 +74,22 @@ org.scalatest scalatest_${scala.binary.version} - ${scala.scalatest.version} - test - - - org.scala-lang - scala-library - - org.scalacheck scalacheck_${scala.binary.version} - ${scala.scalacheck.version} - test org.junit.platform junit-platform-launcher - 1.4.0 - test org.junit.jupiter junit-jupiter-engine - 5.4.0 - test - + diff --git a/tools/tck-integrity-tests/pom.xml b/tools/tck-integrity-tests/pom.xml index eb603bc15d..228d47c1b3 100644 --- a/tools/tck-integrity-tests/pom.xml +++ b/tools/tck-integrity-tests/pom.xml @@ -11,7 +11,6 @@ tck-integrity-tests_2.12 - 1.0-SNAPSHOT openCypher TCK Integrity Tests http://opencypher.org openCypher Technology Compatibility Kit Integrity Tests @@ -32,44 +31,12 @@ net.alchim31.maven scala-maven-plugin - ${scala.maven.plugin.version} - - - - compile - testCompile - add-source - doc-jar - - - - - ${scala.version} - ${scala.binary.version} - maven-surefire-plugin - 2.22.1 - - - org.junit.platform - junit-platform-launcher - 1.4.0 - - - org.junit.jupiter - junit-jupiter-engine - 5.4.0 - - - org.junit.vintage - junit-vintage-engine - 5.4.0 - - + ../../grammar @@ -85,25 +52,21 @@ io.cucumber cucumber-scala_${scala.binary.version} - 4.2.0 io.cucumber cucumber-junit - 4.2.0 org.scala-lang scala-library - ${scala.version} org.antlr antlr4-runtime - ${antlr.runtime.version} @@ -111,28 +74,16 @@ junit junit - 4.12 - test org.scalatest scalatest_${scala.binary.version} - ${scala.scalatest.version} - test - - - org.scala-lang - scala-library - - org.scalacheck scalacheck_${scala.binary.version} - ${scala.scalacheck.version} - test From 60a586bed6d8a93eccf9ec215d1f02d642b18b8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonatan=20J=C3=A4derberg?= Date: Tue, 26 Feb 2019 21:18:40 +0100 Subject: [PATCH 3/4] Launch script reads version from root project --- tools/grammar/src/main/shell/launch.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/grammar/src/main/shell/launch.sh b/tools/grammar/src/main/shell/launch.sh index d3763f548e..b6b051ef1b 100755 --- a/tools/grammar/src/main/shell/launch.sh +++ b/tools/grammar/src/main/shell/launch.sh @@ -8,9 +8,10 @@ case "$(basename $0)" in JARFILE="$(cd $(dirname $0); pwd)/$(basename $0)" ;; launch.sh) - VERSION="$(grep -A1 'grammar' $(dirname $0)/../../../pom.xml | grep -m1 version | cut -d\> -f2 | cut -d\< -f1)" + pomfile="$(realpath $(dirname $0)/../../../../../pom.xml)" + VERSION=$(grep --max-count=1 --regexp="[^<]*" "$pomfile" | cut -f2 -d ">" | cut -f1 -d "<") if [[ -z "$VERSION" ]]; then - >&2 echo "Cannot find version in $(cd $(dirname $0)/../../..; pwd)/pom.xml" + >&2 echo "Cannot find version in $pomfile" exit 1 fi JARFILE="$(cd $(dirname $0)/../../..; pwd)/target/grammar-${VERSION}.jar" From 726df700cef2e56eef4b637c283e62a6adca282f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonatan=20J=C3=A4derberg?= Date: Tue, 26 Feb 2019 21:35:22 +0100 Subject: [PATCH 4/4] Don't use realpath because it makes CI unhappy --- tools/grammar/src/main/shell/launch.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/grammar/src/main/shell/launch.sh b/tools/grammar/src/main/shell/launch.sh index b6b051ef1b..d8b7c43ef7 100755 --- a/tools/grammar/src/main/shell/launch.sh +++ b/tools/grammar/src/main/shell/launch.sh @@ -8,7 +8,7 @@ case "$(basename $0)" in JARFILE="$(cd $(dirname $0); pwd)/$(basename $0)" ;; launch.sh) - pomfile="$(realpath $(dirname $0)/../../../../../pom.xml)" + pomfile="$(cd "$(dirname $0)/../../../../.."; pwd)/pom.xml" VERSION=$(grep --max-count=1 --regexp="[^<]*" "$pomfile" | cut -f2 -d ">" | cut -f1 -d "<") if [[ -z "$VERSION" ]]; then >&2 echo "Cannot find version in $pomfile"