Skip to content

Commit

Permalink
Introducing BaseFeatureTest and refactoring common code of TCKTests a…
Browse files Browse the repository at this point in the history
…nd AcceptanceTests into it
  • Loading branch information
SaschaPeukert committed Jan 26, 2018
1 parent 5e078ff commit 4dbe30a
Show file tree
Hide file tree
Showing 9 changed files with 150 additions and 229 deletions.

This file was deleted.

@@ -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)
}
}
2 changes: 1 addition & 1 deletion enterprise/cypher/compatibility-spec-suite/pom.xml
Expand Up @@ -60,7 +60,7 @@
<dependency>
<groupId>org.opencypher</groupId>
<artifactId>tck</artifactId>
<version>1.0.0-M09</version>
<version>${opencypher.version}</version>
</dependency>

<!-- scala -->
Expand Down
@@ -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()
}
}
1 change: 1 addition & 0 deletions enterprise/cypher/pom.xml
Expand Up @@ -20,6 +20,7 @@
<properties>
<licensing.prepend.text>notice-agpl-prefix.txt</licensing.prepend.text>
<license-text.header>AGPL-3-header.txt</license-text.header>
<opencypher.version>1.0.0-M09</opencypher.version>
</properties>

<scm>
Expand Down
11 changes: 5 additions & 6 deletions enterprise/cypher/spec-suite-tools/LICENSES.txt
Expand Up @@ -3,7 +3,6 @@ libraries. For an overview of the licenses see the NOTICE.txt file.

------------------------------------------------------------------------------
Apache Software License, Version 2.0
Apache Commons IO
Apache Commons Lang
Caffeine cache
casbah-commons
Expand All @@ -15,13 +14,13 @@ Apache Software License, Version 2.0
json4s-ast
json4s-core
json4s-native
Logging
Lucene Core
Lucene Memory
MongoDB Java Driver
Netty/All-in-One
nscala-time
openCypher TCK Developer Tools
openCypher TCK API
openCypher TCK Features and Graphs
org.apiguardian:apiguardian-api
org.opentest4j:opentest4j
parboiled-core
Expand Down Expand Up @@ -277,6 +276,7 @@ SUCH DAMAGE.

------------------------------------------------------------------------------
BSD License
ANTLR 4 Runtime
ParaNamer Core
Scala Compiler
scala-parser-combinators
Expand Down Expand Up @@ -611,8 +611,8 @@ No third-party beneficiary rights are created under this Agreement.

Exhibit A - Form of Secondary Licenses Notice

"This Source Code may also be made available under the following
Secondary Licenses when the conditions for such availability set forth
"This Source Code may also be made available under the following
Secondary Licenses when the conditions for such availability set forth
in the Eclipse Public License, v. 2.0 are satisfied: {name license(s),
version(s), and exceptions or additional permissions here}."

Expand Down Expand Up @@ -656,4 +656,3 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.



6 changes: 3 additions & 3 deletions enterprise/cypher/spec-suite-tools/NOTICE.txt
Expand Up @@ -25,7 +25,6 @@ Third-party licenses
--------------------

Apache Software License, Version 2.0
Apache Commons IO
Apache Commons Lang
Caffeine cache
casbah-commons
Expand All @@ -37,13 +36,13 @@ Apache Software License, Version 2.0
json4s-ast
json4s-core
json4s-native
Logging
Lucene Core
Lucene Memory
MongoDB Java Driver
Netty/All-in-One
nscala-time
openCypher TCK Developer Tools
openCypher TCK API
openCypher TCK Features and Graphs
org.apiguardian:apiguardian-api
org.opentest4j:opentest4j
parboiled-core
Expand All @@ -55,6 +54,7 @@ BSD - Scala License
Scala Library

BSD License
ANTLR 4 Runtime
ParaNamer Core
Scala Compiler
scala-parser-combinators
Expand Down
4 changes: 0 additions & 4 deletions enterprise/cypher/spec-suite-tools/pom.xml
Expand Up @@ -44,10 +44,6 @@
</license>
</licenses>

<properties>
<opencypher.version>1.0.0-M09</opencypher.version>
</properties>

<build>
<plugins>
<plugin>
Expand Down

0 comments on commit 4dbe30a

Please sign in to comment.