Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introducing BaseFeatureTest and refactoring common code of TCKTests a…
…nd AcceptanceTests into it
- Loading branch information
1 parent
5e078ff
commit 4dbe30a
Showing
9 changed files
with
150 additions
and
229 deletions.
There are no files selected for viewing
163 changes: 0 additions & 163 deletions
163
enterprise/cypher/acceptance-spec-suite/src/test/scala/cypher/features/AcceptanceTest.scala
This file was deleted.
Oops, something went wrong.
52 changes: 52 additions & 0 deletions
52
enterprise/cypher/acceptance-spec-suite/src/test/scala/cypher/features/AcceptanceTests.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
* Copyright (c) 2002-2018 "Neo Technology," | ||
* Network Engine for Objects in Lund AB [http://neotechnology.com] | ||
* | ||
* This file is part of Neo4j. | ||
* | ||
* Neo4j is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as | ||
* published by the Free Software Foundation, either version 3 of the | ||
* License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package cypher.features | ||
|
||
import java.io.File | ||
import java.net.URI | ||
import java.util.Collection | ||
|
||
import cypher.features.ScenarioTestHelper._ | ||
import org.junit.jupiter.api.Assertions.fail | ||
import org.junit.jupiter.api.{DynamicTest, Test, TestFactory} | ||
import org.opencypher.tools.tck.api.{CypherTCK, Scenario} | ||
|
||
class AcceptanceTests extends BaseFeatureTest { | ||
|
||
// these two should be empty on commit! | ||
override val featureToRun = "" | ||
override val scenarioToRun = "" | ||
|
||
val featuresURI: URI = getClass.getResource("/cypher/features").toURI | ||
|
||
override val scenarios: Seq[Scenario] = { | ||
val all = CypherTCK.parseFilesystemFeatures(new File(featuresURI)).flatMap(_.scenarios) | ||
filterScenarios(all) | ||
} | ||
|
||
@TestFactory | ||
override def runCompatibility23(): Collection[DynamicTest] = { | ||
//TODO: Investigate flakiness | ||
def isFlakyOn23(scenario: Scenario): Boolean = { | ||
scenario.name == "STARTS WITH should handle null prefix" && scenario.featureName == "IndexAcceptance" | ||
} | ||
createTests(scenarios.filterNot(isFlakyOn23), Compatibility23TestConfig) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
enterprise/cypher/compatibility-spec-suite/src/test/scala/cypher/features/TCKTests.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* Copyright (c) 2002-2018 "Neo Technology," | ||
* Network Engine for Objects in Lund AB [http://neotechnology.com] | ||
* | ||
* This file is part of Neo4j. | ||
* | ||
* Neo4j is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as | ||
* published by the Free Software Foundation, either version 3 of the | ||
* License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package cypher.features | ||
|
||
import java.nio.file.FileSystems | ||
|
||
import org.junit.jupiter.api.AfterEach | ||
import org.opencypher.tools.tck.api.{CypherTCK, Scenario} | ||
|
||
class TCKTests extends BaseFeatureTest { | ||
|
||
// these two should be empty on commit! | ||
override val featureToRun = "" | ||
override val scenarioToRun = "" | ||
|
||
override val scenarios: Seq[Scenario] = { | ||
val allScenarios: Seq[Scenario] = CypherTCK.allTckScenarios | ||
filterScenarios(allScenarios) | ||
} | ||
|
||
@AfterEach | ||
def tearDown(): Unit = { | ||
//TODO: This method can be removed with new release of TCK (1.0.0-M10) | ||
FileSystems.getFileSystem(CypherTCK.getClass.getResource(CypherTCK.featuresPath).toURI).close() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.