Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump cucumber #580

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 16 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,13 @@
<dep.antlr4.version>4.7.2</dep.antlr4.version>
<dep.batik.version>1.13</dep.batik.version>
<dep.scalatags.version>0.10.0</dep.scalatags.version>
<dep.cucumber.version>5.7.0</dep.cucumber.version>
<dep.cucumber.version>7.20.1</dep.cucumber.version>
<dep.cucumber-scala.version>8.25.1</dep.cucumber-scala.version>
<dep.fastparse.version>2.3.3</dep.fastparse.version>
<dep.hamcrest.version>2.2</dep.hamcrest.version>
<dep.junit.platform.version>1.7.0</dep.junit.platform.version>
<dep.junit.version>5.7.0</dep.junit.version>
<dep.json-unit-asserth.version>2.37.0</dep.json-unit-asserth.version>
<dep.maven.compiler.plugin.version>3.8.1</dep.maven.compiler.plugin.version>
<dep.maven.javadoc.plugin.version>3.2.0</dep.maven.javadoc.plugin.version>
<dep.maven.source.plugin.version>3.2.1</dep.maven.source.plugin.version>
Expand All @@ -47,7 +49,7 @@
<dep.commons-csv.version>1.8</dep.commons-csv.version>
<dep.commons-cli.version>1.4</dep.commons-cli.version>
<dep.freemarker.version>2.3.30</dep.freemarker.version>
<dep.jackson-dataformat-xml.version>2.11.3</dep.jackson-dataformat-xml.version>
<dep.jackson.version>2.18.2</dep.jackson.version>
<license.header>${project.rootdir}/ASL-2-header.txt</license.header>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
Expand Down Expand Up @@ -122,14 +124,15 @@
</dependency>

<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-core</artifactId>
<version>${dep.cucumber.version}</version>
<groupId>net.javacrumbs.json-unit</groupId>
<artifactId>json-unit-assertj</artifactId>
<version>${dep.json-unit-asserth.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-gherkin-vintage</artifactId>
<artifactId>cucumber-core</artifactId>
<version>${dep.cucumber.version}</version>
</dependency>

Expand Down Expand Up @@ -182,7 +185,13 @@
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-xml</artifactId>
<version>${dep.jackson-dataformat-xml.version}</version>
<version>${dep.jackson.version}</version>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${dep.jackson.version}</version>
</dependency>

<dependency>
Expand Down
6 changes: 0 additions & 6 deletions tools/grammar/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,6 @@
<version>2.17.0</version>
</dependency>

<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-gherkin-vintage</artifactId>
<optional>true</optional>
</dependency>

</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ package org.opencypher.tools.tck.api

import io.cucumber.core.gherkin
import io.cucumber.core.gherkin.DataTableArgument
import io.cucumber.core.gherkin.DocStringArgument
import io.cucumber.core.gherkin.vintage.GherkinVintageFeatureParser
import io.cucumber.plugin.event.DocStringArgument
import io.cucumber.core.gherkin.messages.GherkinMessagesFeatureParser
import org.opencypher.tools.tck.SideEffectOps.Diff
import org.opencypher.tools.tck._
import org.opencypher.tools.tck.api.events.TCKEvents
Expand All @@ -46,6 +46,7 @@ import java.net.URI
import java.nio.charset.StandardCharsets
import java.nio.file._
import java.util
import java.util.UUID
import scala.annotation.tailrec
import scala.collection.mutable.ListBuffer
import scala.jdk.CollectionConverters._
Expand All @@ -58,7 +59,7 @@ object CypherTCK {
val featuresPath = "/features"
val featureSuffix = ".feature"

private lazy val parser = new GherkinVintageFeatureParser()
private lazy val parser = new GherkinMessagesFeatureParser()

/**
* Provides all the scenarios in the openCypher TCK.
Expand Down Expand Up @@ -142,7 +143,7 @@ object CypherTCK {
def apply(pickle: NameExtractedPickle): PickleGroupingKey = PickleGroupingKey(pickle.pickle.getKeyword, pickle.nameAndNumber)
}

Try(parser.parse(featureFile.toUri, featureString, null)) match {
Try(parser.parse(featureFile.toUri, featureString, () => UUID.randomUUID)) match {
case Success(featureOption) =>
if(featureOption.isPresent) {
val feature = featureOption.get()
Expand All @@ -156,7 +157,7 @@ object CypherTCK {
case (_, included) => included.sortBy(_.pickle.getLocation.getLine)
}

val featureName = feature.getName
val featureName = feature.getName.orElse("N/A")
val scenarios = includedGroupedAndSorted.flatMap {
case (PickleGroupingKey("Scenario Outline", _), pickles) =>
pickles.zipWithIndex.map {
Expand All @@ -171,7 +172,7 @@ object CypherTCK {
}
else Feature(Seq[Scenario]())
case Failure(error) =>
throw InvalidFeatureFormatException(s"Could not parse feature from ${featureFile.toAbsolutePath.toString}: ${error.getMessage}")
throw InvalidFeatureFormatException(s"Could not parse feature from ${featureFile.toAbsolutePath.toString}: ${error.getMessage}", error)
}
}

Expand Down Expand Up @@ -470,7 +471,7 @@ case class ExpectError(errorType: String, phase: String, detail: String, source:
}
}

case class InvalidFeatureFormatException(message: String) extends RuntimeException(message)
case class InvalidFeatureFormatException(message: String, cause: Throwable = null) extends RuntimeException(message, cause)

sealed trait QueryType

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ case object PickleStep {
case class PickleLocation(line: Int, column: Int)

case object PickleLocation {
def apply(location: io.cucumber.core.gherkin.Location): PickleLocation = {
def apply(location: io.cucumber.plugin.event.Location): PickleLocation = {
PickleLocation(location.getLine, location.getColumn)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,8 @@ class ScenarioTest extends AnyFunSuite with Matchers {
val noPickleSteps = new util.ArrayList[io.cucumber.core.gherkin.Step]()
val noPickleTags = new util.ArrayList[String]()

def location(line: Int, column: Int): io.cucumber.core.gherkin.Location = {
new io.cucumber.core.gherkin.Location() {
override def getLine: Int = line

override def getColumn: Int = column
}
def location(line: Int, column: Int): io.cucumber.plugin.event.Location = {
new io.cucumber.plugin.event.Location(line, column)
}

def stringArgument(text: String, line: Int): io.cucumber.core.gherkin.DocStringArgument = {
Expand All @@ -54,6 +50,8 @@ class ScenarioTest extends AnyFunSuite with Matchers {
override def getContentType: String = ""

override def getLine: Int = line

override def getMediaType: String = ""
}
}

Expand All @@ -63,15 +61,17 @@ class ScenarioTest extends AnyFunSuite with Matchers {

override def getArgument: io.cucumber.core.gherkin.Argument = argument

override def getKeyWord: String = keyWord
override def getKeyword: String = keyWord

override def getType: io.cucumber.core.gherkin.StepType = stepType

override def getPreviousGivenWhenThenKeyWord: String = ""
override def getPreviousGivenWhenThenKeyword: String = ""

override def getText: String = text

override def getId: String = id

override def getLocation: io.cucumber.plugin.event.Location = new io.cucumber.plugin.event.Location(0, 0)
}
}

Expand All @@ -94,9 +94,9 @@ class ScenarioTest extends AnyFunSuite with Matchers {

override def getName: String = name

override def getLocation: io.cucumber.core.gherkin.Location = loc
override def getLocation: io.cucumber.plugin.event.Location = loc

override def getScenarioLocation: io.cucumber.core.gherkin.Location = loc
override def getScenarioLocation: io.cucumber.plugin.event.Location = loc

override def getSteps: util.List[io.cucumber.core.gherkin.Step] = steps

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,9 @@ trait GroupTest extends Matchers {

override val getName: String = "name"

override val getLocation: io.cucumber.core.gherkin.Location = new io.cucumber.core.gherkin.Location() {
override val getLine: Int = 1
override val getLocation: io.cucumber.plugin.event.Location = new io.cucumber.plugin.event.Location(1,1)

override val getColumn: Int = 1
}

override val getScenarioLocation: io.cucumber.core.gherkin.Location = new io.cucumber.core.gherkin.Location() {
override val getLine: Int = 1

override val getColumn: Int = 1
}
override val getScenarioLocation: io.cucumber.plugin.event.Location = new io.cucumber.plugin.event.Location(1,1)

override val getSteps: util.List[io.cucumber.core.gherkin.Step] = new util.ArrayList[io.cucumber.core.gherkin.Step]()

Expand All @@ -71,22 +63,26 @@ trait GroupTest extends Matchers {
override val getLine: Int = 1

override val getArgument: io.cucumber.core.gherkin.Argument = new io.cucumber.core.gherkin.DocStringArgument() {
override val getContent: String = "text"
override def getContent: String = "text"

override def getContentType: String = ""

override val getContentType: String = ""
override def getMediaType: String = ""

override val getLine: Int = 1
override def getLine: Int = 1
}

override val getKeyWord: String = "keyWord"
override val getKeyword: String = "keyWord"

override val getType: io.cucumber.core.gherkin.StepType = io.cucumber.core.gherkin.StepType.GIVEN

override val getPreviousGivenWhenThenKeyWord: String = ""
override val getPreviousGivenWhenThenKeyword: String = ""

override val getText: String = "xyz"

override val getId: String = "id"

override def getLocation: io.cucumber.plugin.event.Location = new io.cucumber.plugin.event.Location(1, 1)
}

val dummySteps: List[Step] = List[Step](Dummy(dummyPickleStep), Measure(dummyPickleStep))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,9 @@ class CountScenariosTest extends AnyFunSuite with Matchers {

override def getName: String = "name"

override def getLocation: io.cucumber.core.gherkin.Location = new io.cucumber.core.gherkin.Location() {
override def getLine: Int = 1

override def getColumn: Int = 1
}

override def getScenarioLocation: io.cucumber.core.gherkin.Location = new io.cucumber.core.gherkin.Location() {
override def getLine: Int = 1
override def getLocation: io.cucumber.plugin.event.Location = new io.cucumber.plugin.event.Location(1,1)

override def getColumn: Int = 1
}
override def getScenarioLocation: io.cucumber.plugin.event.Location = new io.cucumber.plugin.event.Location(1,1)

override def getSteps: util.List[io.cucumber.core.gherkin.Step] = new util.ArrayList[io.cucumber.core.gherkin.Step]()

Expand All @@ -78,17 +70,21 @@ class CountScenariosTest extends AnyFunSuite with Matchers {
override def getContentType: String = ""

override def getLine: Int = 1

override def getMediaType: String = ""
}

override def getKeyWord: String = "keyWord"
override def getKeyword: String = "keyWord"

override def getType: io.cucumber.core.gherkin.StepType = io.cucumber.core.gherkin.StepType.GIVEN

override def getPreviousGivenWhenThenKeyWord: String = ""
override def getPreviousGivenWhenThenKeyword: String = ""

override def getText: String = name

override def getId: String = "id"

override def getLocation: io.cucumber.plugin.event.Location = new io.cucumber.plugin.event.Location(1,1)
}

private val dummyPickleStep = namedDummyPickleStep("")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,9 @@ class GroupDiffTest extends AnyFunSuite with Matchers {

override def getName: String = "name"

override def getLocation: io.cucumber.core.gherkin.Location = new io.cucumber.core.gherkin.Location() {
override def getLine: Int = 1

override def getColumn: Int = 1
}

override def getScenarioLocation: io.cucumber.core.gherkin.Location = new io.cucumber.core.gherkin.Location() {
override def getLine: Int = 1
override def getLocation: io.cucumber.plugin.event.Location = new io.cucumber.plugin.event.Location(1,1)

override def getColumn: Int = 1
}
override def getScenarioLocation: io.cucumber.plugin.event.Location = new io.cucumber.plugin.event.Location(1,1)

override def getSteps: util.List[io.cucumber.core.gherkin.Step] = new util.ArrayList[io.cucumber.core.gherkin.Step]()

Expand All @@ -76,17 +68,21 @@ class GroupDiffTest extends AnyFunSuite with Matchers {
override def getContentType: String = ""

override def getLine: Int = 1

override def getMediaType: String = ""
}

override def getKeyWord: String = "keyWord"
override def getKeyword: String = "keyWord"

override def getType: io.cucumber.core.gherkin.StepType = io.cucumber.core.gherkin.StepType.GIVEN

override def getPreviousGivenWhenThenKeyWord: String = ""
override def getPreviousGivenWhenThenKeyword: String = ""

override def getText: String = name

override def getId: String = "id"

override def getLocation: io.cucumber.plugin.event.Location = new io.cucumber.plugin.event.Location(1,1)
}

private val dummyPickleStep = namedDummyPickleStep("")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,8 @@ class ScenarioDiffTest extends AnyFunSuite with Matchers {
val noPickleSteps = new util.ArrayList[io.cucumber.core.gherkin.Step]()
val noPickleTags = new util.ArrayList[String]()

def location(line: Int, column: Int): io.cucumber.core.gherkin.Location = {
new io.cucumber.core.gherkin.Location() {
override def getLine: Int = line

override def getColumn: Int = column
}
def location(line: Int, column: Int): io.cucumber.plugin.event.Location = {
new io.cucumber.plugin.event.Location(line,column)
}

def stringArgument(text: String, line: Int): io.cucumber.core.gherkin.DocStringArgument = {
Expand All @@ -59,6 +55,8 @@ class ScenarioDiffTest extends AnyFunSuite with Matchers {
override def getContentType: String = ""

override def getLine: Int = line

override def getMediaType: String = ""
}
}

Expand All @@ -68,15 +66,17 @@ class ScenarioDiffTest extends AnyFunSuite with Matchers {

override def getArgument: io.cucumber.core.gherkin.Argument = argument

override def getKeyWord: String = keyWord
override def getKeyword: String = keyWord

override def getType: io.cucumber.core.gherkin.StepType = stepType

override def getPreviousGivenWhenThenKeyWord: String = ""
override def getPreviousGivenWhenThenKeyword: String = ""

override def getText: String = text

override def getId: String = id

override def getLocation: io.cucumber.plugin.event.Location = new io.cucumber.plugin.event.Location(line, 1)
}
}

Expand All @@ -99,9 +99,9 @@ class ScenarioDiffTest extends AnyFunSuite with Matchers {

override def getName: String = name

override def getLocation: io.cucumber.core.gherkin.Location = loc
override def getLocation: io.cucumber.plugin.event.Location = loc

override def getScenarioLocation: io.cucumber.core.gherkin.Location = loc
override def getScenarioLocation: io.cucumber.plugin.event.Location = loc

override def getSteps: util.List[io.cucumber.core.gherkin.Step] = steps

Expand Down
Loading
Loading