From a4102016d1d5145853e87a3a62861e85f33c7850 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Toni=20Cebria=CC=81n?= Date: Tue, 17 Dec 2019 13:06:12 +0100 Subject: [PATCH 1/4] Show the bug parsing comments --- .../localTests/shex-parsing-of-comments.shex | 7 +++++++ .../scala/es/weso/shex/ParsingCommentsSpec.scala | 16 ++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 modules/shex/src/test/resources/localTests/shex-parsing-of-comments.shex create mode 100644 modules/shex/src/test/scala/es/weso/shex/ParsingCommentsSpec.scala diff --git a/modules/shex/src/test/resources/localTests/shex-parsing-of-comments.shex b/modules/shex/src/test/resources/localTests/shex-parsing-of-comments.shex new file mode 100644 index 00000000..31dc3ebd --- /dev/null +++ b/modules/shex/src/test/resources/localTests/shex-parsing-of-comments.shex @@ -0,0 +1,7 @@ +prefix : +prefix foaf: +prefix xsd: + +:Person { + foaf:name xsd:string ; # Test +} \ No newline at end of file diff --git a/modules/shex/src/test/scala/es/weso/shex/ParsingCommentsSpec.scala b/modules/shex/src/test/scala/es/weso/shex/ParsingCommentsSpec.scala new file mode 100644 index 00000000..6fae6988 --- /dev/null +++ b/modules/shex/src/test/scala/es/weso/shex/ParsingCommentsSpec.scala @@ -0,0 +1,16 @@ +package es.weso.shex + +import org.scalatest.{EitherValues, FlatSpec, Matchers} + +import scala.io.Source + +class ParsingCommentsSpec extends FlatSpec with Matchers with EitherValues { + "Shex" should "parse comments" in { + val contentFile = Source.fromFile("modules/shex/src/test/resources/localTests/shex-parsing-of-comments.shex") + val parsing = Schema.fromString(contentFile.getLines().mkString, "ShexC", None) + parsing match { + case Right(_) => succeed + case Left(e) => fail(e) + } + } +} From c937e204587f832ae882618d0feb3d367ea30035 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Toni=20Cebria=CC=81n?= Date: Fri, 17 Jan 2020 09:57:28 +0100 Subject: [PATCH 2/4] Bump scalatest version --- README.md | 2 +- build.sbt | 197 ++++++++------- .../es/weso/depgraphs/DepGraphTest.scala | 6 +- .../scala/es/weso/collection/BagTest.scala | 15 +- .../es/weso/collection/SortedMapBagTest.scala | 14 +- .../src/test/scala/es/weso/rbe/RbeTest.scala | 8 +- .../es/weso/rbe/interval/BagMatchers.scala | 6 +- .../rbe/interval/IntervalSingleTest.scala | 4 +- .../es/weso/rbe/interval/IntervalTest.scala | 6 +- .../weso/shapeMaps/ResultShapeMapTest.scala | 6 +- .../es/weso/shapeMaps/ShapeMapJsonTest.scala | 6 +- .../es/weso/shapeMaps/ShapeMapTest.scala | 6 +- .../scala/es/weso/shex/CardinalityTest.scala | 6 +- .../es/weso/shex/NormalizeShapeTest.scala | 6 +- .../es/weso/shex/ParsingCommentsSpec.scala | 6 +- .../test/scala/es/weso/shex/PathsTest.scala | 6 +- .../shex/SchemaEncodeJsonEqualsJsonTest.scala | 6 +- .../SchemaParseShowEqualsCompatTest.scala | 6 +- .../es/weso/shex/ShExJsonSingleTest.scala | 6 +- .../scala/es/weso/shex/ShExJsonTest.scala | 6 +- .../scala/es/weso/shex/WellFormedTest.scala | 6 +- .../shex/actions/TestSemanticActionTest.scala | 6 +- .../shex/btValidator/BtValidatorTest.scala | 6 +- .../weso/shex/compact/CompactShowTest.scala | 6 +- .../shex/compact/CompactSyntaxLocalTest.scala | 6 +- .../shex/compact/CompareJsonSingleTest.scala | 8 +- .../weso/shex/compact/CompareJsonTest.scala | 8 +- .../compact/CompareSchemasSingleTest.scala | 8 +- .../shex/compact/CompareSchemasTest.scala | 8 +- .../es/weso/shex/compact/OnlySyntaxTest.scala | 8 +- .../compact/ParseSchemaFileSingleTest.scala | 6 +- .../es/weso/shex/compact/ParserTest.scala | 6 +- .../weso/shex/compact/ShexCompactSingle.scala | 6 +- .../scala/es/weso/shex/dependenciesTest.scala | 6 +- .../es/weso/shex/extend/ExtendTest.scala | 6 +- .../es/weso/shex/implicits/EqShExTest.scala | 6 +- .../scala/es/weso/shex/shexCodecTest.scala | 6 +- .../test/scala/es/weso/shex/shexDiff.scala | 6 +- .../es/weso/shex/shexR/RDF2ShexTest.scala | 6 +- .../scala/es/weso/shex/spec/CheckTest.scala | 6 +- .../scala/es/weso/shex/spec/SpecTest.scala | 6 +- .../es/weso/shex/spec/TypingMapTest.scala | 6 +- .../es/weso/shex/validator/CTableTest.scala | 6 +- .../es/weso/shex/validator/ContextTest.scala | 6 +- .../shex/validator/ErrorMessagesTest.scala | 6 +- .../es/weso/shex/validator/ExprTest.scala | 6 +- .../es/weso/shex/validator/IRITest.scala | 6 +- .../weso/shex/validator/LocalFolderTest.scala | 6 +- .../es/weso/shex/validator/NodeInfoTest.scala | 6 +- .../es/weso/shex/validator/RegexTest.scala | 6 +- .../validator/ShouldValidateShapeMap.scala | 6 +- .../weso/shex/validator/ValidatorTest.scala | 6 +- .../shex/validator/ValueCheckerTest.scala | 6 +- .../validator/ShapeMapValidatorTest.scala | 6 +- .../shextest/manifest/ValidateManifest.scala | 230 ++++++++++-------- .../shextest/manifest/JsonResultTest.scala | 6 +- .../manifest/RDF2ManifestLocalTest.scala | 10 +- .../shextest/manifest/RDF2ManifestTest.scala | 53 ++-- project/plugins.sbt | 6 +- 59 files changed, 484 insertions(+), 359 deletions(-) diff --git a/README.md b/README.md index d107522d..e737fbec 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ Contributors: * [Eric Prud'hommeaux](https://www.w3.org/People/Eric/) * [Bogdan Roman](https://github.com/bogdanromanx) -* [Toni Cebrían](http://www.tonicebrian.com/) +* [Toni Cebrián](http://www.tonicebrian.com/) * [Andrew Berezovskyi](https://github.com/berezovskyi) ## Adopters diff --git a/build.sbt b/build.sbt index 31022cdd..002a9f3d 100644 --- a/build.sbt +++ b/build.sbt @@ -1,18 +1,18 @@ -lazy val scala212 = "2.12.10" -lazy val scala213 = "2.13.1" +lazy val scala212 = "2.12.10" +lazy val scala213 = "2.13.1" lazy val supportedScalaVersions = List(scala213, scala212) // Local dependencies -lazy val srdfVersion = "0.1.53" -lazy val utilsVersion = "0.1.62" -lazy val documentVersion = "0.0.3" +lazy val srdfVersion = "0.1.53" +lazy val utilsVersion = "0.1.62" +lazy val documentVersion = "0.0.3" // Dependency versions -lazy val antlrVersion = "4.7.1" -lazy val catsVersion = "2.0.0" -lazy val commonsTextVersion = "1.8" -lazy val circeVersion = "0.12.0-RC3" -lazy val diffsonVersion = "4.0.0" +lazy val antlrVersion = "4.7.1" +lazy val catsVersion = "2.0.0" +lazy val commonsTextVersion = "1.8" +lazy val circeVersion = "0.12.0-RC3" +lazy val diffsonVersion = "4.0.0" // lazy val effVersion = "4.6.1" lazy val jenaVersion = "3.13.1" lazy val jgraphtVersion = "1.3.1" @@ -20,8 +20,8 @@ lazy val logbackVersion = "1.2.3" lazy val loggingVersion = "3.9.2" lazy val rdf4jVersion = "3.0.0" lazy val scalacheckVersion = "1.14.0" -lazy val scalacticVersion = "3.0.8" -lazy val scalaTestVersion = "3.0.8" +lazy val scalacticVersion = "3.1.0" +lazy val scalaTestVersion = "3.1.0" lazy val scalaGraphVersion = "1.11.5" lazy val scalatagsVersion = "0.6.7" lazy val scallopVersion = "3.3.1" @@ -31,51 +31,50 @@ lazy val typesafeConfigVersion = "1.3.4" lazy val xercesVersion = "2.12.0" // Compiler plugin dependency versions -lazy val simulacrumVersion = "1.0.0" +lazy val simulacrumVersion = "1.0.0" // lazy val kindProjectorVersion = "0.9.5" -lazy val scalaMacrosVersion = "2.1.1" +lazy val scalaMacrosVersion = "2.1.1" // Dependency modules -lazy val antlr4 = "org.antlr" % "antlr4" % antlrVersion -lazy val catsCore = "org.typelevel" %% "cats-core" % catsVersion -lazy val catsKernel = "org.typelevel" %% "cats-kernel" % catsVersion -lazy val catsMacros = "org.typelevel" %% "cats-macros" % catsVersion -lazy val catsEffect = "org.typelevel" %% "cats-effect" % catsVersion -lazy val circeCore = "io.circe" %% "circe-core" % circeVersion -lazy val circeGeneric = "io.circe" %% "circe-generic" % circeVersion -lazy val circeParser = "io.circe" %% "circe-parser" % circeVersion -lazy val commonsText = "org.apache.commons" % "commons-text" % commonsTextVersion -lazy val diffsonCirce = "org.gnieh" %% "diffson-circe" % diffsonVersion +lazy val antlr4 = "org.antlr" % "antlr4" % antlrVersion +lazy val catsCore = "org.typelevel" %% "cats-core" % catsVersion +lazy val catsKernel = "org.typelevel" %% "cats-kernel" % catsVersion +lazy val catsMacros = "org.typelevel" %% "cats-macros" % catsVersion +lazy val catsEffect = "org.typelevel" %% "cats-effect" % catsVersion +lazy val circeCore = "io.circe" %% "circe-core" % circeVersion +lazy val circeGeneric = "io.circe" %% "circe-generic" % circeVersion +lazy val circeParser = "io.circe" %% "circe-parser" % circeVersion +lazy val commonsText = "org.apache.commons" % "commons-text" % commonsTextVersion +lazy val diffsonCirce = "org.gnieh" %% "diffson-circe" % diffsonVersion // lazy val eff = "org.atnos" %% "eff" % effVersion -lazy val jgraphtCore = "org.jgrapht" % "jgrapht-core" % jgraphtVersion -lazy val logbackClassic = "ch.qos.logback" % "logback-classic" % logbackVersion -lazy val jenaArq = "org.apache.jena" % "jena-arq" % jenaVersion -lazy val jenaFuseki = "org.apache.jena" % "jena-fuseki-main" % jenaVersion -lazy val rdf4j_runtime = "org.eclipse.rdf4j" % "rdf4j-runtime" % rdf4jVersion +lazy val jgraphtCore = "org.jgrapht" % "jgrapht-core" % jgraphtVersion +lazy val logbackClassic = "ch.qos.logback" % "logback-classic" % logbackVersion +lazy val jenaArq = "org.apache.jena" % "jena-arq" % jenaVersion +lazy val jenaFuseki = "org.apache.jena" % "jena-fuseki-main" % jenaVersion +lazy val rdf4j_runtime = "org.eclipse.rdf4j" % "rdf4j-runtime" % rdf4jVersion // WESO components -lazy val document = "es.weso" %% "document" % documentVersion -lazy val srdf = "es.weso" %% "srdf" % srdfVersion -lazy val srdfJena = "es.weso" %% "srdfjena" % srdfVersion -lazy val srdf4j = "es.weso" %% "srdf4j" % srdfVersion -lazy val utils = "es.weso" %% "utils" % utilsVersion -lazy val typing = "es.weso" %% "typing" % utilsVersion -lazy val validating = "es.weso" %% "validating" % utilsVersion -lazy val utilsTest = "es.weso" %% "utilstest" % utilsVersion +lazy val document = "es.weso" %% "document" % documentVersion +lazy val srdf = "es.weso" %% "srdf" % srdfVersion +lazy val srdfJena = "es.weso" %% "srdfjena" % srdfVersion +lazy val srdf4j = "es.weso" %% "srdf4j" % srdfVersion +lazy val utils = "es.weso" %% "utils" % utilsVersion +lazy val typing = "es.weso" %% "typing" % utilsVersion +lazy val validating = "es.weso" %% "validating" % utilsVersion +lazy val utilsTest = "es.weso" %% "utilstest" % utilsVersion -lazy val scalaLogging = "com.typesafe.scala-logging" %% "scala-logging" % loggingVersion -lazy val scallop = "org.rogach" %% "scallop" % scallopVersion -lazy val scalactic = "org.scalactic" %% "scalactic" % scalacticVersion -lazy val scalacheck = "org.scalacheck" %% "scalacheck" % scalacheckVersion -lazy val scalaTest = "org.scalatest" %% "scalatest" % scalaTestVersion -lazy val scalatags = "com.lihaoyi" %% "scalatags" % scalatagsVersion -lazy val selenium = "org.seleniumhq.selenium" % "selenium-java" % seleniumVersion +lazy val scalaLogging = "com.typesafe.scala-logging" %% "scala-logging" % loggingVersion +lazy val scallop = "org.rogach" %% "scallop" % scallopVersion +lazy val scalactic = "org.scalactic" %% "scalactic" % scalacticVersion +lazy val scalacheck = "org.scalacheck" %% "scalacheck" % scalacheckVersion +lazy val scalaTest = "org.scalatest" %% "scalatest" % scalaTestVersion +lazy val scalatags = "com.lihaoyi" %% "scalatags" % scalatagsVersion +lazy val selenium = "org.seleniumhq.selenium" % "selenium-java" % seleniumVersion // lazy val htmlUnit = "org.seleniumhq.selenium" % "htmlunit-driver" % seleniumVersion -lazy val sext = "com.github.nikita-volkov" % "sext" % sextVersion -lazy val typesafeConfig = "com.typesafe" % "config" % typesafeConfigVersion -lazy val xercesImpl = "xerces" % "xercesImpl" % xercesVersion -lazy val simulacrum = "org.typelevel" %% "simulacrum" % simulacrumVersion - +lazy val sext = "com.github.nikita-volkov" % "sext" % sextVersion +lazy val typesafeConfig = "com.typesafe" % "config" % typesafeConfigVersion +lazy val xercesImpl = "xerces" % "xercesImpl" % xercesVersion +lazy val simulacrum = "org.typelevel" %% "simulacrum" % simulacrumVersion lazy val shexsRoot = project .in(file(".")) @@ -83,7 +82,7 @@ lazy val shexsRoot = project .disablePlugins(RevolverPlugin) // .settings( // buildInfoKeys := BuildInfoKey.ofN(name, version, scalaVersion, sbtVersion), -// buildInfoPackage := "es.weso.shaclex.buildinfo" +// buildInfoPackage := "es.weso.shaclex.buildinfo" // ) .settings(commonSettings, packagingSettings, publishSettings, ghPagesSettings, wixSettings) .aggregate(depGraphs, shex, shexTest, rbe, shapeMaps) @@ -97,20 +96,20 @@ lazy val shexsRoot = project catsEffect, scalaLogging, scallop, - typesafeConfig, + typesafeConfig ), - cancelable in Global := true, - fork := true, + cancelable in Global := true, + fork := true, // parallelExecution in Test := false, ThisBuild / turbo := true, crossScalaVersions := supportedScalaVersions, // crossScalaVersions := Nil, - publish / skip := true, + publish / skip := true ) -lazy val CompatTest = config("compat") extend (Test) describedAs("Tests that check compatibility (some may fail)") +lazy val CompatTest = config("compat") extend (Test) describedAs ("Tests that check compatibility (some may fail)") def compatFilter(name: String): Boolean = name endsWith "CompatTest" -def testFilter(name: String): Boolean = /*(name endsWith "Test") && */ !compatFilter(name) +def testFilter(name: String): Boolean = /*(name endsWith "Test") && */ !compatFilter(name) lazy val shex = project .in(file("modules/shex")) @@ -124,7 +123,7 @@ lazy val shex = project antlrSettings("es.weso.shex.parser"), inConfig(CompatTest)(Defaults.testTasks), testOptions in Test := Seq(Tests.Filter(testFilter)), - testOptions in CompatTest := Seq(Tests.Filter(compatFilter)), + testOptions in CompatTest := Seq(Tests.Filter(compatFilter)) ) .dependsOn( shapeMaps, @@ -140,20 +139,20 @@ lazy val shex = project circeGeneric, circeParser, catsEffect, - scalaTest % Test, - scalacheck % Test, + scalaTest % Test, + scalacheck % Test, typing, document, - utils % "test -> test; compile -> compile", + utils % "test -> test; compile -> compile", utilsTest % Test, validating, - srdf, + srdf, srdfJena % Test, - srdf4j % Test + srdf4j % Test ) ) - lazy val depGraphs = project +lazy val depGraphs = project .in(file("modules/depGraphs")) .disablePlugins(RevolverPlugin) .settings(commonSettings, publishSettings) @@ -168,7 +167,7 @@ lazy val shex = project ) ) - lazy val shexTest = project +lazy val shexTest = project .in(file("modules/shexTest")) .disablePlugins(RevolverPlugin) .configs(CompatTest) @@ -178,11 +177,11 @@ lazy val shex = project publishSettings, inConfig(CompatTest)(Defaults.testTasks), testOptions in Test := Seq(Tests.Filter(testFilter)), - testOptions in CompatTest := Seq(Tests.Filter(compatFilter)), + testOptions in CompatTest := Seq(Tests.Filter(compatFilter)) ) .dependsOn( - shex, - ) + shex + ) .settings( libraryDependencies ++= Seq( typesafeConfig % Test, @@ -191,18 +190,17 @@ lazy val shex = project circeCore, circeGeneric, circeParser, - scalaTest % Test, - scalacheck % Test, + scalaTest % Test, + scalacheck % Test, catsEffect, - utils % "test -> test; compile -> compile", + utils % "test -> test; compile -> compile", utilsTest % Test, - srdf, + srdf, srdfJena, srdf4j % Test ) ) - lazy val shapeMaps = project .in(file("modules/shapeMaps")) .enablePlugins(Antlr4Plugin) @@ -215,7 +213,7 @@ lazy val shapeMaps = project srdf, utils, srdfJena % Test, - sext % Test, + sext % Test, scalaLogging, catsCore, catsKernel, @@ -223,7 +221,7 @@ lazy val shapeMaps = project circeCore, circeGeneric, circeParser - ) + ) ) def macroDependencies(scalaVersion: String) = @@ -240,12 +238,13 @@ lazy val rbe = project .disablePlugins(RevolverPlugin) .dependsOn() .settings( - commonSettings, publishSettings + commonSettings, + publishSettings ) .settings( crossScalaVersions := supportedScalaVersions, libraryDependencies ++= Seq( - // compilerPlugin(("org.typelevel" %% "kind-projector" % kindProjectorVersion).cross(CrossVersion.full)), + // compilerPlugin(("org.typelevel" %% "kind-projector" % kindProjectorVersion).cross(CrossVersion.full)), validating, typing, simulacrum, @@ -253,18 +252,18 @@ lazy val rbe = project catsKernel, catsMacros, scalacheck % Test, - srdfJena % Test, + srdfJena % Test, utils, scalaLogging ) ++ macroDependencies(scalaVersion.value) ) - /* ******************************************************** +/* ******************************************************** ******************** Grouped Settings ******************** **********************************************************/ lazy val noDocProjects = Seq[ProjectReference]( -) + ) lazy val noPublishSettings = Seq( // publish := (), @@ -280,13 +279,13 @@ lazy val sharedDependencies = Seq( ) lazy val packagingSettings = Seq( - mainClass in Compile := Some("es.weso.shexs.Main"), - mainClass in assembly := Some("es.weso.shexs.Main"), - test in assembly := {}, + mainClass in Compile := Some("es.weso.shexs.Main"), + mainClass in assembly := Some("es.weso.shexs.Main"), + test in assembly := {}, assemblyJarName in assembly := "shex-s.jar", - packageSummary in Linux := name.value, - packageSummary in Windows := name.value, - packageDescription := name.value + packageSummary in Linux := name.value, + packageSummary in Windows := name.value, + packageDescription := name.value ) lazy val compilationSettings = Seq( @@ -305,7 +304,7 @@ lazy val compilationSettings = Seq( "-Yrangepos", "-Ywarn-dead-code", // Warn when dead code is identified. // "-Xfatal-warnings", - "-Ywarn-extra-implicit", // Warn when more than one implicit parameter section is defined. + "-Ywarn-extra-implicit" // Warn when more than one implicit parameter section is defined. ) ++ (if (priorTo2_13(scalaVersion.value)) Seq( "-Yno-adapted-args", @@ -326,7 +325,7 @@ def priorTo2_13(scalaVersion: String): Boolean = } lazy val wixSettings = Seq( - wixProductId := "39b564d5-d381-4282-ada9-87244c76e14b", + wixProductId := "39b564d5-d381-4282-ada9-87244c76e14b", wixProductUpgradeId := "6a710435-9af4-4adb-a597-98d3dd0bade1" // The same numbers as in the docs? // wixProductId := "ce07be71-510d-414a-92d4-dff47631848a", @@ -348,19 +347,19 @@ lazy val commonSettings = compilationSettings ++ sharedDependencies ++ Seq( def antlrSettings(packageName: String) = Seq( antlr4GenListener in Antlr4 := true, - antlr4GenVisitor in Antlr4 := true, - antlr4Dependency in Antlr4 := antlr4, - antlr4PackageName in Antlr4 := Some(packageName), + antlr4GenVisitor in Antlr4 := true, + antlr4Dependency in Antlr4 := antlr4, + antlr4PackageName in Antlr4 := Some(packageName) ) lazy val publishSettings = Seq( - maintainer := "Jose Emilio Labra Gayo ", - homepage := Some(url("https://github.com/labra/shaclex")), - licenses := Seq("MIT" -> url("http://opensource.org/licenses/MIT")), - scmInfo := Some(ScmInfo(url("https://github.com/labra/shaclex"), "scm:git:git@github.com:labra/shaclex.git")), + maintainer := "Jose Emilio Labra Gayo ", + homepage := Some(url("https://github.com/labra/shaclex")), + licenses := Seq("MIT" -> url("http://opensource.org/licenses/MIT")), + scmInfo := Some(ScmInfo(url("https://github.com/labra/shaclex"), "scm:git:git@github.com:labra/shaclex.git")), autoAPIMappings := true, - apiURL := Some(url("http://labra.github.io/shaclex/latest/api/")), - pomExtra := + apiURL := Some(url("http://labra.github.io/shaclex/latest/api/")), + pomExtra := labra Jose Emilio Labra Gayo @@ -373,9 +372,9 @@ lazy val publishSettings = Seq( scmInfo.value.get.browseUrl + "/tree/master€{FILE_PATH}.scala", "-sourcepath", baseDirectory.in(LocalRootProject).value.getAbsolutePath, - "-diagrams", + "-diagrams" ), - publishMavenStyle := true, - bintrayRepository in bintray := "weso-releases", + publishMavenStyle := true, + bintrayRepository in bintray := "weso-releases", bintrayOrganization in bintray := Some("weso") ) diff --git a/modules/depGraphs/src/test/scala/es/weso/depgraphs/DepGraphTest.scala b/modules/depGraphs/src/test/scala/es/weso/depgraphs/DepGraphTest.scala index da05bc69..ead9dd0b 100644 --- a/modules/depGraphs/src/test/scala/es/weso/depgraphs/DepGraphTest.scala +++ b/modules/depGraphs/src/test/scala/es/weso/depgraphs/DepGraphTest.scala @@ -1,9 +1,11 @@ package es.weso.depgraphs -import org.scalatest._ +import org.scalatest._ +import org.scalatest.funspec.AnyFunSpec +import org.scalatest.matchers.should.Matchers class DepGraphTest - extends FunSpec + extends AnyFunSpec with Matchers with EitherValues { diff --git a/modules/rbe/src/test/scala/es/weso/collection/BagTest.scala b/modules/rbe/src/test/scala/es/weso/collection/BagTest.scala index 9f801e0b..22636d09 100644 --- a/modules/rbe/src/test/scala/es/weso/collection/BagTest.scala +++ b/modules/rbe/src/test/scala/es/weso/collection/BagTest.scala @@ -1,12 +1,9 @@ package es.weso.collection -import org.scalatest._ -import org.scalatestplus.scalacheck._ +import org.scalatest.funspec.AnyFunSpec +import org.scalatest.matchers.should.Matchers -class BagTest - extends FunSpec - with Matchers - with Checkers { +class BagTest extends AnyFunSpec with Matchers { describe("A Bag") { @@ -41,8 +38,8 @@ class BagTest } it("should calculate delta") { - val bag = Bag.toBag(List(1, 1, 2, 2, 3)) - val delta = Bag.delta(Seq(1, 2), bag) + val bag = Bag.toBag(List(1, 1, 2, 2, 3)) + val delta = Bag.delta(Seq(1, 2), bag) val expected = Bag.toBag(List(1, 1, 2, 2)) delta should be(expected) } @@ -76,7 +73,7 @@ class BagTest ) } -*/ + */ } } diff --git a/modules/rbe/src/test/scala/es/weso/collection/SortedMapBagTest.scala b/modules/rbe/src/test/scala/es/weso/collection/SortedMapBagTest.scala index 389190f4..3a6ed2ab 100644 --- a/modules/rbe/src/test/scala/es/weso/collection/SortedMapBagTest.scala +++ b/modules/rbe/src/test/scala/es/weso/collection/SortedMapBagTest.scala @@ -1,20 +1,18 @@ package es.weso.collection -import org.scalatest._ -import org.scalatestplus.scalacheck._ +import org.scalatest.funspec.AnyFunSpec +import org.scalatest.matchers.should.Matchers import scala.collection.SortedMap -class SortedMapBagTest extends FunSpec with Matchers with Checkers { +class SortedMapBagTest extends AnyFunSpec with Matchers { describe("A SortedMap Bag") { it("Should add one element and have multiplicity 1") { val sm: SortedMap[Char, Int] = SortedMap[Char, Int]() - val bag = BagSortedMap[Char](sm) - val expected = SortedMap[Char, Int]('b' -> 3) + val bag = BagSortedMap[Char](sm) + val expected = SortedMap[Char, Int]('b' -> 3) bag.add('b', 3).asSortedMap should be(expected) } - } - -} \ No newline at end of file +} diff --git a/modules/rbe/src/test/scala/es/weso/rbe/RbeTest.scala b/modules/rbe/src/test/scala/es/weso/rbe/RbeTest.scala index a3fe4515..e1f88ea9 100644 --- a/modules/rbe/src/test/scala/es/weso/rbe/RbeTest.scala +++ b/modules/rbe/src/test/scala/es/weso/rbe/RbeTest.scala @@ -1,10 +1,10 @@ package es.weso.rbe -import org.scalatest._ +import org.scalatest.matchers.should.Matchers import es.weso.collection._ -import org.scalatestplus.scalacheck._ +import org.scalatest.funspec.AnyFunSpec -class RbeTest extends FunSpec with Matchers with ScalaCheckDrivenPropertyChecks { +class RbeTest extends AnyFunSpec with Matchers { describe("Symbols") { val rbe = Or(And(Symbol("a", 1, 3), Symbol("b", 1, 1)), Symbol("b", 2, 3)) @@ -16,4 +16,4 @@ class RbeTest extends FunSpec with Matchers with ScalaCheckDrivenPropertyChecks rbe.noSymbolsInBag(Bag("a", "c")) should be(false) } -} \ No newline at end of file +} diff --git a/modules/rbe/src/test/scala/es/weso/rbe/interval/BagMatchers.scala b/modules/rbe/src/test/scala/es/weso/rbe/interval/BagMatchers.scala index b9ccf593..fc7a404b 100644 --- a/modules/rbe/src/test/scala/es/weso/rbe/interval/BagMatchers.scala +++ b/modules/rbe/src/test/scala/es/weso/rbe/interval/BagMatchers.scala @@ -2,9 +2,11 @@ package es.weso.rbe.interval import es.weso.collection.Bag import es.weso.rbe.Rbe -import org.scalatest._ +import org.scalatest._ +import org.scalatest.funspec.AnyFunSpec +import org.scalatest.matchers.should.Matchers -trait BagMatchers extends FunSpec with Matchers { +trait BagMatchers extends AnyFunSpec with Matchers { def matchBag[A](rbe: Rbe[A], bag: Bag[A], open: Boolean = true) = { it(s"${rbe} should match ${bag}. Open: $open") { val checker = IntervalChecker(rbe) diff --git a/modules/rbe/src/test/scala/es/weso/rbe/interval/IntervalSingleTest.scala b/modules/rbe/src/test/scala/es/weso/rbe/interval/IntervalSingleTest.scala index c38ffde4..6929f3a3 100644 --- a/modules/rbe/src/test/scala/es/weso/rbe/interval/IntervalSingleTest.scala +++ b/modules/rbe/src/test/scala/es/weso/rbe/interval/IntervalSingleTest.scala @@ -2,9 +2,9 @@ package es.weso.rbe.interval import es.weso.collection._ import es.weso.rbe._ -import org.scalatest._ +import org.scalatest.funspec.AnyFunSpec -class IntervalSingleTest extends FunSpec with BagMatchers { +class IntervalSingleTest extends AnyFunSpec with BagMatchers { describe("Single test") { // noMatchBag(Repeat(Symbol("a", 1, 1), 0, 0), Bag.toBag(List("a"))) diff --git a/modules/rbe/src/test/scala/es/weso/rbe/interval/IntervalTest.scala b/modules/rbe/src/test/scala/es/weso/rbe/interval/IntervalTest.scala index 92d00222..ef887d16 100644 --- a/modules/rbe/src/test/scala/es/weso/rbe/interval/IntervalTest.scala +++ b/modules/rbe/src/test/scala/es/weso/rbe/interval/IntervalTest.scala @@ -2,9 +2,11 @@ package es.weso.rbe.interval import es.weso.collection._ import es.weso.rbe._ -import org.scalatest._ +import org.scalatest._ +import org.scalatest.funspec.AnyFunSpec +import org.scalatest.matchers.should.Matchers -class IntervalTest extends FunSpec with Matchers with BagMatchers { +class IntervalTest extends AnyFunSpec with Matchers with BagMatchers { describe("Intervals calculation") { diff --git a/modules/shapeMaps/src/test/scala/es/weso/shapeMaps/ResultShapeMapTest.scala b/modules/shapeMaps/src/test/scala/es/weso/shapeMaps/ResultShapeMapTest.scala index fbd060ca..61de1888 100644 --- a/modules/shapeMaps/src/test/scala/es/weso/shapeMaps/ResultShapeMapTest.scala +++ b/modules/shapeMaps/src/test/scala/es/weso/shapeMaps/ResultShapeMapTest.scala @@ -2,9 +2,11 @@ package es.weso.shapeMaps import es.weso.rdf.jena.RDFAsJenaModel import es.weso.rdf.nodes._ -import org.scalatest._ +import org.scalatest._ +import org.scalatest.funspec.AnyFunSpec +import org.scalatest.matchers.should.Matchers -class ResultShapeMapTest extends FunSpec with Matchers with TryValues with OptionValues { +class ResultShapeMapTest extends AnyFunSpec with Matchers with TryValues with OptionValues { /* describe("ResultShapeMaps") { val rdfStr = diff --git a/modules/shapeMaps/src/test/scala/es/weso/shapeMaps/ShapeMapJsonTest.scala b/modules/shapeMaps/src/test/scala/es/weso/shapeMaps/ShapeMapJsonTest.scala index 9f099e50..a8d1c8f1 100644 --- a/modules/shapeMaps/src/test/scala/es/weso/shapeMaps/ShapeMapJsonTest.scala +++ b/modules/shapeMaps/src/test/scala/es/weso/shapeMaps/ShapeMapJsonTest.scala @@ -3,9 +3,11 @@ package es.weso.shapeMaps import es.weso.utils.json.JsonCompare import es.weso.rdf._ import es.weso.rdf.nodes._ -import org.scalatest._ +import org.scalatest._ +import org.scalatest.funspec.AnyFunSpec +import org.scalatest.matchers.should.Matchers -class ShapeMapJsonTest extends FunSpec with Matchers with TryValues with OptionValues { +class ShapeMapJsonTest extends AnyFunSpec with Matchers with TryValues with OptionValues { describe(s"Parse Json shapemaps") { it("can parse Json example") { diff --git a/modules/shapeMaps/src/test/scala/es/weso/shapeMaps/ShapeMapTest.scala b/modules/shapeMaps/src/test/scala/es/weso/shapeMaps/ShapeMapTest.scala index f8059418..fdb175e6 100644 --- a/modules/shapeMaps/src/test/scala/es/weso/shapeMaps/ShapeMapTest.scala +++ b/modules/shapeMaps/src/test/scala/es/weso/shapeMaps/ShapeMapTest.scala @@ -4,9 +4,11 @@ import org.scalatest._ import es.weso.rdf.nodes._ import es.weso.rdf.jena.RDFAsJenaModel import es.weso.rdf._ -import es.weso.rdf.path.PredicatePath +import es.weso.rdf.path.PredicatePath +import org.scalatest.funspec.AnyFunSpec +import org.scalatest.matchers.should.Matchers -class ShapeMapTest extends FunSpec with Matchers with TryValues with OptionValues { +class ShapeMapTest extends AnyFunSpec with Matchers with TryValues with OptionValues { describe("ShapeMaps") { diff --git a/modules/shex/src/test/scala/es/weso/shex/CardinalityTest.scala b/modules/shex/src/test/scala/es/weso/shex/CardinalityTest.scala index d0a5f9de..c699a18b 100644 --- a/modules/shex/src/test/scala/es/weso/shex/CardinalityTest.scala +++ b/modules/shex/src/test/scala/es/weso/shex/CardinalityTest.scala @@ -1,7 +1,9 @@ package es.weso.shex -import org.scalatest._ +import org.scalatest._ +import org.scalatest.funspec.AnyFunSpec +import org.scalatest.matchers.should.Matchers -class CardinalityTest extends FunSpec with Matchers with EitherValues { +class CardinalityTest extends AnyFunSpec with Matchers with EitherValues { describe(s"Cardinality test") { checkBetween(2,1,IntMax(5)) diff --git a/modules/shex/src/test/scala/es/weso/shex/NormalizeShapeTest.scala b/modules/shex/src/test/scala/es/weso/shex/NormalizeShapeTest.scala index b297098a..226aaf84 100644 --- a/modules/shex/src/test/scala/es/weso/shex/NormalizeShapeTest.scala +++ b/modules/shex/src/test/scala/es/weso/shex/NormalizeShapeTest.scala @@ -2,9 +2,11 @@ package es.weso.shex import es.weso.rdf.nodes._ import es.weso.shex.normalized.{Constraint, NormalizedShape} -import org.scalatest._ +import org.scalatest._ +import org.scalatest.funspec.AnyFunSpec +import org.scalatest.matchers.should.Matchers -class NormalizeShapeTest extends FunSpec with Matchers with EitherValues { +class NormalizeShapeTest extends AnyFunSpec with Matchers with EitherValues { describe(s"Normalize shape with IRI") { val shexStr = diff --git a/modules/shex/src/test/scala/es/weso/shex/ParsingCommentsSpec.scala b/modules/shex/src/test/scala/es/weso/shex/ParsingCommentsSpec.scala index 6fae6988..eebd8212 100644 --- a/modules/shex/src/test/scala/es/weso/shex/ParsingCommentsSpec.scala +++ b/modules/shex/src/test/scala/es/weso/shex/ParsingCommentsSpec.scala @@ -1,10 +1,12 @@ package es.weso.shex -import org.scalatest.{EitherValues, FlatSpec, Matchers} +import org.scalatest.EitherValues import scala.io.Source +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers -class ParsingCommentsSpec extends FlatSpec with Matchers with EitherValues { +class ParsingCommentsSpec extends AnyFlatSpec with Matchers with EitherValues { "Shex" should "parse comments" in { val contentFile = Source.fromFile("modules/shex/src/test/resources/localTests/shex-parsing-of-comments.shex") val parsing = Schema.fromString(contentFile.getLines().mkString, "ShexC", None) diff --git a/modules/shex/src/test/scala/es/weso/shex/PathsTest.scala b/modules/shex/src/test/scala/es/weso/shex/PathsTest.scala index 01e68976..81e3ecd1 100644 --- a/modules/shex/src/test/scala/es/weso/shex/PathsTest.scala +++ b/modules/shex/src/test/scala/es/weso/shex/PathsTest.scala @@ -1,9 +1,11 @@ package es.weso.shex import es.weso.rdf.nodes._ -import org.scalatest._ +import org.scalatest._ +import org.scalatest.funspec.AnyFunSpec +import org.scalatest.matchers.should.Matchers -class PathsTest extends FunSpec with Matchers with EitherValues { +class PathsTest extends AnyFunSpec with Matchers with EitherValues { describe(s"Calculates paths of a shape") { val shexStr = diff --git a/modules/shex/src/test/scala/es/weso/shex/SchemaEncodeJsonEqualsJsonTest.scala b/modules/shex/src/test/scala/es/weso/shex/SchemaEncodeJsonEqualsJsonTest.scala index 06d8d5ca..0a2460ba 100644 --- a/modules/shex/src/test/scala/es/weso/shex/SchemaEncodeJsonEqualsJsonTest.scala +++ b/modules/shex/src/test/scala/es/weso/shex/SchemaEncodeJsonEqualsJsonTest.scala @@ -14,9 +14,11 @@ import io.circe.parser.parse import io.circe.syntax._ import cats.data.EitherT import org.scalatest._ -import cats.effect._ +import cats.effect._ +import org.scalatest.funspec.AnyFunSpec +import org.scalatest.matchers.should.Matchers -class SchemaEncodeJsonEqualsJsonTest extends FunSpec with JsonTest with Matchers with EitherValues { +class SchemaEncodeJsonEqualsJsonTest extends AnyFunSpec with JsonTest with Matchers with EitherValues { val conf: Config = ConfigFactory.load() val schemasFolder = conf.getString("schemasFolder") diff --git a/modules/shex/src/test/scala/es/weso/shex/SchemaParseShowEqualsCompatTest.scala b/modules/shex/src/test/scala/es/weso/shex/SchemaParseShowEqualsCompatTest.scala index 5606a552..0a3256a3 100644 --- a/modules/shex/src/test/scala/es/weso/shex/SchemaParseShowEqualsCompatTest.scala +++ b/modules/shex/src/test/scala/es/weso/shex/SchemaParseShowEqualsCompatTest.scala @@ -14,9 +14,11 @@ import es.weso.utils.FileUtils._ import io.circe.syntax._ import org.scalatest._ import cats.data.EitherT -import cats.effect._ +import cats.effect._ +import org.scalatest.funspec.AnyFunSpec +import org.scalatest.matchers.should.Matchers -class SchemaParseShowEqualsCompatTest extends FunSpec with JsonTest with Matchers with EitherValues with OptionValues { +class SchemaParseShowEqualsCompatTest extends AnyFunSpec with JsonTest with Matchers with EitherValues with OptionValues { val conf: Config = ConfigFactory.load() val schemasFolder = conf.getString("schemasFolder") diff --git a/modules/shex/src/test/scala/es/weso/shex/ShExJsonSingleTest.scala b/modules/shex/src/test/scala/es/weso/shex/ShExJsonSingleTest.scala index 513be3d4..d443b80b 100644 --- a/modules/shex/src/test/scala/es/weso/shex/ShExJsonSingleTest.scala +++ b/modules/shex/src/test/scala/es/weso/shex/ShExJsonSingleTest.scala @@ -6,9 +6,11 @@ import scala.io._ import es.weso.shex.implicits.decoderShEx._ import es.weso.shex.implicits.encoderShEx._ import es.weso.shex.implicits.showShEx._ -import es.weso.utils.json._ +import es.weso.utils.json._ +import org.scalatest.funspec.AnyFunSpec +import org.scalatest.matchers.should.Matchers -class ShExJsonSingleTest extends FunSpec with JsonTest with Matchers with EitherValues { +class ShExJsonSingleTest extends AnyFunSpec with JsonTest with Matchers with EitherValues { val conf: Config = ConfigFactory.load() val schemasFolder = conf.getString("schemasFolder") diff --git a/modules/shex/src/test/scala/es/weso/shex/ShExJsonTest.scala b/modules/shex/src/test/scala/es/weso/shex/ShExJsonTest.scala index ddc65211..a64933f9 100644 --- a/modules/shex/src/test/scala/es/weso/shex/ShExJsonTest.scala +++ b/modules/shex/src/test/scala/es/weso/shex/ShExJsonTest.scala @@ -8,9 +8,11 @@ import es.weso.shex.implicits.encoderShEx._ import es.weso.shex.implicits.showShEx._ import es.weso.utils.json._ import es.weso.utils.FileUtils._ -import cats.effect._ +import cats.effect._ +import org.scalatest.funspec.AnyFunSpec +import org.scalatest.matchers.should.Matchers -class ShExJsonTest extends FunSpec with JsonTest with Matchers with EitherValues { +class ShExJsonTest extends AnyFunSpec with JsonTest with Matchers with EitherValues { val conf: Config = ConfigFactory.load() val schemasFolder = conf.getString("schemasFolder") diff --git a/modules/shex/src/test/scala/es/weso/shex/WellFormedTest.scala b/modules/shex/src/test/scala/es/weso/shex/WellFormedTest.scala index cdd87cab..5ffc9015 100644 --- a/modules/shex/src/test/scala/es/weso/shex/WellFormedTest.scala +++ b/modules/shex/src/test/scala/es/weso/shex/WellFormedTest.scala @@ -1,7 +1,9 @@ package es.weso.shex -import org.scalatest._ +import org.scalatest._ +import org.scalatest.funspec.AnyFunSpec +import org.scalatest.matchers.should.Matchers -class WellFormedTest extends FunSpec with Matchers with EitherValues { +class WellFormedTest extends AnyFunSpec with Matchers with EitherValues { describe(s"WellFormedTest") { diff --git a/modules/shex/src/test/scala/es/weso/shex/actions/TestSemanticActionTest.scala b/modules/shex/src/test/scala/es/weso/shex/actions/TestSemanticActionTest.scala index 2664be9c..37d83d44 100644 --- a/modules/shex/src/test/scala/es/weso/shex/actions/TestSemanticActionTest.scala +++ b/modules/shex/src/test/scala/es/weso/shex/actions/TestSemanticActionTest.scala @@ -2,9 +2,11 @@ package es.weso.shex.actions import es.weso.rdf.jena.RDFAsJenaModel import es.weso.rdf.nodes.IRI -import org.scalatest._ +import org.scalatest._ +import org.scalatest.funspec.AnyFunSpec +import org.scalatest.matchers.should.Matchers -class TestSemanticActionTest extends FunSpec with Matchers with EitherValues { +class TestSemanticActionTest extends AnyFunSpec with Matchers with EitherValues { describe(s"Test of TestSemanticAction processor") { it(s"Should run print code") { diff --git a/modules/shex/src/test/scala/es/weso/shex/btValidator/BtValidatorTest.scala b/modules/shex/src/test/scala/es/weso/shex/btValidator/BtValidatorTest.scala index 3fad6d06..f92c96ba 100644 --- a/modules/shex/src/test/scala/es/weso/shex/btValidator/BtValidatorTest.scala +++ b/modules/shex/src/test/scala/es/weso/shex/btValidator/BtValidatorTest.scala @@ -7,9 +7,11 @@ import es.weso.rdf.nodes.{IRI, RDFNode} import es.weso.rdf.triples.RDFTriple import es.weso.rdf.PREFIXES._ import es.weso.shapeMaps.{IRILabel, ShapeMapLabel} -import es.weso.shex._ +import es.weso.shex._ +import org.scalatest.funspec.AnyFunSpec +import org.scalatest.matchers.should.Matchers -class BtValidatorTest extends FunSpec with Matchers with EitherValues { +class BtValidatorTest extends AnyFunSpec with Matchers with EitherValues { describe(s"BtValidator semantics") { it(s"Should validate OK") { diff --git a/modules/shex/src/test/scala/es/weso/shex/compact/CompactShowTest.scala b/modules/shex/src/test/scala/es/weso/shex/compact/CompactShowTest.scala index 8195df6c..47f047cf 100644 --- a/modules/shex/src/test/scala/es/weso/shex/compact/CompactShowTest.scala +++ b/modules/shex/src/test/scala/es/weso/shex/compact/CompactShowTest.scala @@ -2,9 +2,11 @@ package es.weso.shex.compact import cats.implicits._ import es.weso.shex.Schema -import org.scalatest._ +import org.scalatest._ +import org.scalatest.funspec.AnyFunSpec +import org.scalatest.matchers.should.Matchers -class CompactShowTest extends FunSpec with Matchers with EitherValues { +class CompactShowTest extends AnyFunSpec with Matchers with EitherValues { describe(s"Compact show test") { shouldShowAndParse( diff --git a/modules/shex/src/test/scala/es/weso/shex/compact/CompactSyntaxLocalTest.scala b/modules/shex/src/test/scala/es/weso/shex/compact/CompactSyntaxLocalTest.scala index 63125108..e4e34f70 100644 --- a/modules/shex/src/test/scala/es/weso/shex/compact/CompactSyntaxLocalTest.scala +++ b/modules/shex/src/test/scala/es/weso/shex/compact/CompactSyntaxLocalTest.scala @@ -10,9 +10,11 @@ import es.weso.shex.compact.Parser._ import es.weso.shex.compact.CompactShow._ import es.weso.shex.implicits.eqShEx._ import cats._ -import es.weso.rdf.nodes.IRI +import es.weso.rdf.nodes.IRI +import org.scalatest.funspec.AnyFunSpec +import org.scalatest.matchers.should.Matchers -class CompactSyntaxLocalTest extends FunSpec with Matchers with EitherValues { +class CompactSyntaxLocalTest extends AnyFunSpec with Matchers with EitherValues { val conf: Config = ConfigFactory.load() val shexLocalFolder = conf.getString("shexLocalFolder") diff --git a/modules/shex/src/test/scala/es/weso/shex/compact/CompareJsonSingleTest.scala b/modules/shex/src/test/scala/es/weso/shex/compact/CompareJsonSingleTest.scala index 3e75d85e..4922af66 100644 --- a/modules/shex/src/test/scala/es/weso/shex/compact/CompareJsonSingleTest.scala +++ b/modules/shex/src/test/scala/es/weso/shex/compact/CompareJsonSingleTest.scala @@ -11,11 +11,13 @@ import es.weso.utils.FileUtils._ import es.weso.utils.json.{JsonCompare, JsonTest} import io.circe.parser._ import io.circe.syntax._ -import org.scalatest.{EitherValues, FunSpec, Matchers} +import org.scalatest.EitherValues -import scala.io._ +import scala.io._ +import org.scalatest.funspec.AnyFunSpec +import org.scalatest.matchers.should.Matchers -class CompareJsonSingleTest extends FunSpec with JsonTest with Matchers with EitherValues { +class CompareJsonSingleTest extends AnyFunSpec with JsonTest with Matchers with EitherValues { val name = "1val1emptylanguageStemMinuslanguage3" val conf: Config = ConfigFactory.load() diff --git a/modules/shex/src/test/scala/es/weso/shex/compact/CompareJsonTest.scala b/modules/shex/src/test/scala/es/weso/shex/compact/CompareJsonTest.scala index 8dce3c78..6c8bc74c 100644 --- a/modules/shex/src/test/scala/es/weso/shex/compact/CompareJsonTest.scala +++ b/modules/shex/src/test/scala/es/weso/shex/compact/CompareJsonTest.scala @@ -9,11 +9,13 @@ import es.weso.utils.FileUtils._ import es.weso.utils.json.JsonTest import io.circe.parser._ import io.circe.syntax._ -import org.scalatest.{EitherValues, FunSpec, Matchers} +import org.scalatest.EitherValues -import scala.io._ +import scala.io._ +import org.scalatest.funspec.AnyFunSpec +import org.scalatest.matchers.should.Matchers -class CompareJsonTest extends FunSpec with JsonTest with Matchers with EitherValues { +class CompareJsonTest extends AnyFunSpec with JsonTest with Matchers with EitherValues { val conf: Config = ConfigFactory.load() val schemasFolder = conf.getString("schemasFolder") diff --git a/modules/shex/src/test/scala/es/weso/shex/compact/CompareSchemasSingleTest.scala b/modules/shex/src/test/scala/es/weso/shex/compact/CompareSchemasSingleTest.scala index 3bbf3a5c..7d91ecf1 100644 --- a/modules/shex/src/test/scala/es/weso/shex/compact/CompareSchemasSingleTest.scala +++ b/modules/shex/src/test/scala/es/weso/shex/compact/CompareSchemasSingleTest.scala @@ -8,14 +8,16 @@ import es.weso.shex.implicits.decoderShEx._ import es.weso.utils.FileUtils._ import io.circe.parser._ import io.circe.syntax._ -import org.scalatest.{EitherValues, FunSpec, Matchers} +import org.scalatest.EitherValues import es.weso.shex.implicits.encoderShEx._ import cats.data.EitherT import cats.effect._ import scala.io._ -import cats.implicits._ +import cats.implicits._ +import org.scalatest.funspec.AnyFunSpec +import org.scalatest.matchers.should.Matchers -class CompareSchemasSingleTest extends FunSpec with JsonTest with Matchers with EitherValues { +class CompareSchemasSingleTest extends AnyFunSpec with JsonTest with Matchers with EitherValues { val name = "1val1emptylanguageStem" val conf: Config = ConfigFactory.load() diff --git a/modules/shex/src/test/scala/es/weso/shex/compact/CompareSchemasTest.scala b/modules/shex/src/test/scala/es/weso/shex/compact/CompareSchemasTest.scala index 7de643be..99966543 100644 --- a/modules/shex/src/test/scala/es/weso/shex/compact/CompareSchemasTest.scala +++ b/modules/shex/src/test/scala/es/weso/shex/compact/CompareSchemasTest.scala @@ -8,11 +8,13 @@ import es.weso.shex._ import es.weso.shex.implicits.decoderShEx._ import es.weso.utils.FileUtils._ import io.circe.parser._ -import org.scalatest.{EitherValues, FunSpec, Matchers} +import org.scalatest.EitherValues import scala.io._ -import cats.effect._ +import cats.effect._ +import org.scalatest.funspec.AnyFunSpec +import org.scalatest.matchers.should.Matchers -class CompareSchemasTest extends FunSpec with JsonTest with Matchers with EitherValues { +class CompareSchemasTest extends AnyFunSpec with JsonTest with Matchers with EitherValues { val conf: Config = ConfigFactory.load() val schemasFolder = conf.getString("schemasFolder") diff --git a/modules/shex/src/test/scala/es/weso/shex/compact/OnlySyntaxTest.scala b/modules/shex/src/test/scala/es/weso/shex/compact/OnlySyntaxTest.scala index 08e1d419..a3e80eff 100644 --- a/modules/shex/src/test/scala/es/weso/shex/compact/OnlySyntaxTest.scala +++ b/modules/shex/src/test/scala/es/weso/shex/compact/OnlySyntaxTest.scala @@ -6,11 +6,13 @@ import com.typesafe.config.{Config, ConfigFactory} import es.weso.utils.json.JsonTest import es.weso.shex._ import es.weso.utils.FileUtils._ -import org.scalatest.{EitherValues, FunSpec, Matchers} +import org.scalatest.EitherValues import scala.io._ -import cats.effect._ +import cats.effect._ +import org.scalatest.funspec.AnyFunSpec +import org.scalatest.matchers.should.Matchers -class OnlySyntaxTest extends FunSpec with JsonTest with Matchers with EitherValues { +class OnlySyntaxTest extends AnyFunSpec with JsonTest with Matchers with EitherValues { val conf: Config = ConfigFactory.load() val schemasFolder = conf.getString("schemasFolder") diff --git a/modules/shex/src/test/scala/es/weso/shex/compact/ParseSchemaFileSingleTest.scala b/modules/shex/src/test/scala/es/weso/shex/compact/ParseSchemaFileSingleTest.scala index a494cec1..0c1a7cc1 100644 --- a/modules/shex/src/test/scala/es/weso/shex/compact/ParseSchemaFileSingleTest.scala +++ b/modules/shex/src/test/scala/es/weso/shex/compact/ParseSchemaFileSingleTest.scala @@ -6,9 +6,11 @@ import cats.data.EitherT import com.typesafe.config.{Config, ConfigFactory} import es.weso.utils.json.JsonTest import es.weso.utils.FileUtils._ -import org.scalatest.{EitherValues, FunSpec, Matchers} +import org.scalatest.EitherValues +import org.scalatest.funspec.AnyFunSpec +import org.scalatest.matchers.should.Matchers -class ParseSchemaFileSingleTest extends FunSpec with JsonTest with Matchers with EitherValues { +class ParseSchemaFileSingleTest extends AnyFunSpec with JsonTest with Matchers with EitherValues { val name = "1focusLength-dot" val conf: Config = ConfigFactory.load() diff --git a/modules/shex/src/test/scala/es/weso/shex/compact/ParserTest.scala b/modules/shex/src/test/scala/es/weso/shex/compact/ParserTest.scala index 64bd9039..d5ee5af2 100644 --- a/modules/shex/src/test/scala/es/weso/shex/compact/ParserTest.scala +++ b/modules/shex/src/test/scala/es/weso/shex/compact/ParserTest.scala @@ -3,9 +3,11 @@ package es.weso.shex.compact import es.weso.utils.json.JsonTest import es.weso.rdf.nodes.IRI import es.weso.shex._ -import org.scalatest.{EitherValues, FunSpec, Matchers} +import org.scalatest.EitherValues +import org.scalatest.funspec.AnyFunSpec +import org.scalatest.matchers.should.Matchers -class ParserTest extends FunSpec with JsonTest with Matchers with EitherValues { +class ParserTest extends AnyFunSpec with JsonTest with Matchers with EitherValues { describe("ShEx Parser test") { diff --git a/modules/shex/src/test/scala/es/weso/shex/compact/ShexCompactSingle.scala b/modules/shex/src/test/scala/es/weso/shex/compact/ShexCompactSingle.scala index 6f4c1a7b..a0c1997f 100644 --- a/modules/shex/src/test/scala/es/weso/shex/compact/ShexCompactSingle.scala +++ b/modules/shex/src/test/scala/es/weso/shex/compact/ShexCompactSingle.scala @@ -8,9 +8,11 @@ import es.weso.utils.json._ import es.weso.utils.FileUtils._ import es.weso.shex._ import cats.effect._ -import cats.implicits._ +import cats.implicits._ +import org.scalatest.funspec.AnyFunSpec +import org.scalatest.matchers.should.Matchers -class ShexCompactSingle extends FunSpec with JsonTest with Matchers with EitherValues { +class ShexCompactSingle extends AnyFunSpec with JsonTest with Matchers with EitherValues { val conf: Config = ConfigFactory.load() val schemasFolder = conf.getString("schemasFolder") diff --git a/modules/shex/src/test/scala/es/weso/shex/dependenciesTest.scala b/modules/shex/src/test/scala/es/weso/shex/dependenciesTest.scala index 769dc928..f6255e8d 100644 --- a/modules/shex/src/test/scala/es/weso/shex/dependenciesTest.scala +++ b/modules/shex/src/test/scala/es/weso/shex/dependenciesTest.scala @@ -2,9 +2,11 @@ package es.weso.shex import es.weso.depgraphs.{DepGraph, Neg, Pos, PosNeg} import es.weso.rdf.nodes._ -import org.scalatest._ +import org.scalatest._ +import org.scalatest.funspec.AnyFunSpec +import org.scalatest.matchers.should.Matchers -class dependenciesTest extends FunSpec with Matchers with EitherValues { +class dependenciesTest extends AnyFunSpec with Matchers with EitherValues { // Some common values val e = "http://example.org/" diff --git a/modules/shex/src/test/scala/es/weso/shex/extend/ExtendTest.scala b/modules/shex/src/test/scala/es/weso/shex/extend/ExtendTest.scala index 4bfb4ce7..277827c6 100644 --- a/modules/shex/src/test/scala/es/weso/shex/extend/ExtendTest.scala +++ b/modules/shex/src/test/scala/es/weso/shex/extend/ExtendTest.scala @@ -1,10 +1,12 @@ package es.weso.shex.extend import cats.syntax.either._ -import org.scalatest._ +import org.scalatest._ +import org.scalatest.funspec.AnyFunSpec +import org.scalatest.matchers.should.Matchers -class ExtendTest extends FunSpec with Extend with Matchers with EitherValues { +class ExtendTest extends AnyFunSpec with Extend with Matchers with EitherValues { type Label = String case class Expr(es: List[Label]) type Schema = Map[Label,Shape] diff --git a/modules/shex/src/test/scala/es/weso/shex/implicits/EqShExTest.scala b/modules/shex/src/test/scala/es/weso/shex/implicits/EqShExTest.scala index 722d88ef..386ee949 100644 --- a/modules/shex/src/test/scala/es/weso/shex/implicits/EqShExTest.scala +++ b/modules/shex/src/test/scala/es/weso/shex/implicits/EqShExTest.scala @@ -4,9 +4,11 @@ import es.weso.rdf.{Prefix, PrefixMap} import es.weso.rdf.nodes.IRI import es.weso.shex._ import org.scalatest._ -import cats.implicits._ +import cats.implicits._ +import org.scalatest.funspec.AnyFunSpec +import org.scalatest.matchers.should.Matchers -class EqShExTest extends FunSpec with Matchers with EitherValues { +class EqShExTest extends AnyFunSpec with Matchers with EitherValues { describe(s"Eq ShEx Schema") { it(s"Should compare single schemas ignoring namespaces") { val s1 = Schema(IRI(""),None,None,None,None,None,None,List()) diff --git a/modules/shex/src/test/scala/es/weso/shex/shexCodecTest.scala b/modules/shex/src/test/scala/es/weso/shex/shexCodecTest.scala index 579c76b7..e3762585 100644 --- a/modules/shex/src/test/scala/es/weso/shex/shexCodecTest.scala +++ b/modules/shex/src/test/scala/es/weso/shex/shexCodecTest.scala @@ -11,9 +11,11 @@ import io.circe.syntax._ import io.circe.parser._ import cats._ import cats.implicits._ -import es.weso.rdf.nodes._ +import es.weso.rdf.nodes._ +import org.scalatest.funspec.AnyFunSpec +import org.scalatest.matchers.should.Matchers -class shexCodecTest extends FunSpec with Matchers with EitherValues { +class shexCodecTest extends AnyFunSpec with Matchers with EitherValues { describe("Prefix parser") { it("Should parse prefix") { diff --git a/modules/shex/src/test/scala/es/weso/shex/shexDiff.scala b/modules/shex/src/test/scala/es/weso/shex/shexDiff.scala index 33e82030..71e86d08 100644 --- a/modules/shex/src/test/scala/es/weso/shex/shexDiff.scala +++ b/modules/shex/src/test/scala/es/weso/shex/shexDiff.scala @@ -1,9 +1,11 @@ package es.weso.shex import org.scalatest._ import es.weso.rdf.nodes._ -import es.weso.rdf._ +import es.weso.rdf._ +import org.scalatest.funspec.AnyFunSpec +import org.scalatest.matchers.should.Matchers -class shexDiffTest extends FunSpec with Matchers with EitherValues { +class shexDiffTest extends AnyFunSpec with Matchers with EitherValues { describe("shexDiff") { it("should calculate diffs of base values") { diff --git a/modules/shex/src/test/scala/es/weso/shex/shexR/RDF2ShexTest.scala b/modules/shex/src/test/scala/es/weso/shex/shexR/RDF2ShexTest.scala index 13405d3d..6e90d5c5 100644 --- a/modules/shex/src/test/scala/es/weso/shex/shexR/RDF2ShexTest.scala +++ b/modules/shex/src/test/scala/es/weso/shex/shexR/RDF2ShexTest.scala @@ -6,10 +6,12 @@ import es.weso.rdf.jena.RDFAsJenaModel import es.weso.rdf.nodes._ import es.weso.shex.shexR.PREFIXES._ import es.weso.rdf.PREFIXES._ -import es.weso.rdf.parser._ +import es.weso.rdf.parser._ +import org.scalatest.funspec.AnyFunSpec +import org.scalatest.matchers.should.Matchers -class RDF2ShExTest extends FunSpec with Matchers with EitherValues with TryValues { +class RDF2ShExTest extends AnyFunSpec with Matchers with EitherValues with TryValues { val rdf2Shex = new RDF2ShEx {} describe("Simple schema") { diff --git a/modules/shex/src/test/scala/es/weso/shex/spec/CheckTest.scala b/modules/shex/src/test/scala/es/weso/shex/spec/CheckTest.scala index 8630a09f..e5e138f7 100644 --- a/modules/shex/src/test/scala/es/weso/shex/spec/CheckTest.scala +++ b/modules/shex/src/test/scala/es/weso/shex/spec/CheckTest.scala @@ -7,9 +7,11 @@ import es.weso.rdf.nodes.IRI import es.weso.shapeMaps.{IRILabel, ShapeMapLabel} import es.weso.shex.Schema import org.scalatest._ -import es.weso.utils.internal.CollectionCompat._ +import es.weso.utils.internal.CollectionCompat._ +import org.scalatest.funspec.AnyFunSpec +import org.scalatest.matchers.should.Matchers -class CheckTest extends FunSpec with Matchers with EitherValues { +class CheckTest extends AnyFunSpec with Matchers with EitherValues { val emptyEnv = Env(Schema.empty,TypingMap.empty,RDFAsJenaModel.empty) diff --git a/modules/shex/src/test/scala/es/weso/shex/spec/SpecTest.scala b/modules/shex/src/test/scala/es/weso/shex/spec/SpecTest.scala index bbc4b780..40978233 100644 --- a/modules/shex/src/test/scala/es/weso/shex/spec/SpecTest.scala +++ b/modules/shex/src/test/scala/es/weso/shex/spec/SpecTest.scala @@ -4,9 +4,11 @@ import es.weso.rdf.jena.RDFAsJenaModel import es.weso.rdf.nodes._ import es.weso.shapeMaps._ import es.weso.shex.{IRILabel => ShExIriLabel, _} -import org.scalatest._ +import org.scalatest._ +import org.scalatest.funspec.AnyFunSpec +import org.scalatest.matchers.should.Matchers -class SpecTest extends FunSpec with Matchers with EitherValues { +class SpecTest extends AnyFunSpec with Matchers with EitherValues { val x = IRI(s"http://example.org/x") val p = IRI(s"http://example.org/p") val q = IRI(s"http://example.org/q") diff --git a/modules/shex/src/test/scala/es/weso/shex/spec/TypingMapTest.scala b/modules/shex/src/test/scala/es/weso/shex/spec/TypingMapTest.scala index cc5a7881..e096ad9e 100644 --- a/modules/shex/src/test/scala/es/weso/shex/spec/TypingMapTest.scala +++ b/modules/shex/src/test/scala/es/weso/shex/spec/TypingMapTest.scala @@ -1,8 +1,10 @@ package es.weso.shex.spec -import org.scalatest._ +import org.scalatest._ +import org.scalatest.funspec.AnyFunSpec +import org.scalatest.matchers.should.Matchers -class TypingMapTest extends FunSpec with Matchers with EitherValues { +class TypingMapTest extends AnyFunSpec with Matchers with EitherValues { } diff --git a/modules/shex/src/test/scala/es/weso/shex/validator/CTableTest.scala b/modules/shex/src/test/scala/es/weso/shex/validator/CTableTest.scala index 5fe69c68..b0d6bfb4 100644 --- a/modules/shex/src/test/scala/es/weso/shex/validator/CTableTest.scala +++ b/modules/shex/src/test/scala/es/weso/shex/validator/CTableTest.scala @@ -3,9 +3,11 @@ package es.weso.shex.validator import es.weso.rdf.nodes._ import es.weso.shex._ import es.weso.shex.validator.Table.CTable -import org.scalatest._ +import org.scalatest._ +import org.scalatest.funspec.AnyFunSpec +import org.scalatest.matchers.should.Matchers -class CTableTest extends FunSpec with Matchers with EitherValues { +class CTableTest extends AnyFunSpec with Matchers with EitherValues { describe(s"CTable") { it(s"Should generate CTable") { val ex = "http://example.org/" diff --git a/modules/shex/src/test/scala/es/weso/shex/validator/ContextTest.scala b/modules/shex/src/test/scala/es/weso/shex/validator/ContextTest.scala index 59e9b6af..669b347c 100644 --- a/modules/shex/src/test/scala/es/weso/shex/validator/ContextTest.scala +++ b/modules/shex/src/test/scala/es/weso/shex/validator/ContextTest.scala @@ -1,9 +1,11 @@ package es.weso.shex.validator import org.scalatest._ -import cats._ +import cats._ +import org.scalatest.funspec.AnyFunSpec +import org.scalatest.matchers.should.Matchers -class ContextTest extends FunSpec with Matchers with EitherValues { +class ContextTest extends AnyFunSpec with Matchers with EitherValues { describe(s"Context") { it("should generate empty context") { diff --git a/modules/shex/src/test/scala/es/weso/shex/validator/ErrorMessagesTest.scala b/modules/shex/src/test/scala/es/weso/shex/validator/ErrorMessagesTest.scala index eca5dc95..5e585016 100644 --- a/modules/shex/src/test/scala/es/weso/shex/validator/ErrorMessagesTest.scala +++ b/modules/shex/src/test/scala/es/weso/shex/validator/ErrorMessagesTest.scala @@ -4,9 +4,11 @@ import es.weso.rdf.jena.RDFAsJenaModel import es.weso.rdf.nodes.{IRI, RDFNode} import es.weso.shapeMaps.{ShapeMap, ShapeMapLabel, IRILabel} import es.weso.shex.Schema -import org.scalatest._ +import org.scalatest._ +import org.scalatest.funspec.AnyFunSpec +import org.scalatest.matchers.should.Matchers -class ErrorMessagesTest extends FunSpec with Matchers with EitherValues { +class ErrorMessagesTest extends AnyFunSpec with Matchers with EitherValues { describe("Error messages test") { it(s"Should generate good error message") { diff --git a/modules/shex/src/test/scala/es/weso/shex/validator/ExprTest.scala b/modules/shex/src/test/scala/es/weso/shex/validator/ExprTest.scala index 5bc071f0..bc68d386 100644 --- a/modules/shex/src/test/scala/es/weso/shex/validator/ExprTest.scala +++ b/modules/shex/src/test/scala/es/weso/shex/validator/ExprTest.scala @@ -3,9 +3,11 @@ package es.weso.shex.validator import es.weso.rdf.jena._ import es.weso.shapeMaps.ShapeMap import es.weso.shex._ -import org.scalatest._ +import org.scalatest._ +import org.scalatest.funspec.AnyFunSpec +import org.scalatest.matchers.should.Matchers -class ExprTest extends FunSpec with Matchers with EitherValues { +class ExprTest extends AnyFunSpec with Matchers with EitherValues { describe(s"Parsing exprs") { ignore("should parse a simple as") { diff --git a/modules/shex/src/test/scala/es/weso/shex/validator/IRITest.scala b/modules/shex/src/test/scala/es/weso/shex/validator/IRITest.scala index e3eb415d..5df661e8 100644 --- a/modules/shex/src/test/scala/es/weso/shex/validator/IRITest.scala +++ b/modules/shex/src/test/scala/es/weso/shex/validator/IRITest.scala @@ -3,9 +3,11 @@ package es.weso.shex.validator import org.scalatest._ import es.weso.rdf.jena.RDFAsJenaModel import es.weso.rdf.nodes.IRI -import es.weso.shex.Schema +import es.weso.shex.Schema +import org.scalatest.funspec.AnyFunSpec +import org.scalatest.matchers.should.Matchers -class IRITest extends FunSpec with Matchers with EitherValues { +class IRITest extends AnyFunSpec with Matchers with EitherValues { val rdf = RDFAsJenaModel.empty describe(s"Test IRI") { diff --git a/modules/shex/src/test/scala/es/weso/shex/validator/LocalFolderTest.scala b/modules/shex/src/test/scala/es/weso/shex/validator/LocalFolderTest.scala index a7038cbc..55698070 100644 --- a/modules/shex/src/test/scala/es/weso/shex/validator/LocalFolderTest.scala +++ b/modules/shex/src/test/scala/es/weso/shex/validator/LocalFolderTest.scala @@ -5,9 +5,11 @@ import java.io.File import com.typesafe.config.{Config, ConfigFactory} import es.weso.utils.FileUtils.getFilesFromFolderWithExt import cats.effect._ -import org.scalatest._ +import org.scalatest._ +import org.scalatest.funspec.AnyFunSpec +import org.scalatest.matchers.should.Matchers -class LocalFolderTest extends FunSpec with Matchers with EitherValues { +class LocalFolderTest extends AnyFunSpec with Matchers with EitherValues { val conf: Config = ConfigFactory.load val schemasFolder = conf.getString("localFolderTest") diff --git a/modules/shex/src/test/scala/es/weso/shex/validator/NodeInfoTest.scala b/modules/shex/src/test/scala/es/weso/shex/validator/NodeInfoTest.scala index b194952d..d97b5f77 100644 --- a/modules/shex/src/test/scala/es/weso/shex/validator/NodeInfoTest.scala +++ b/modules/shex/src/test/scala/es/weso/shex/validator/NodeInfoTest.scala @@ -3,9 +3,11 @@ package es.weso.shex.validator import es.weso.rdf.nodes._ import org.scalatest._ import es.weso.rdf.PREFIXES._ -import es.weso.rdf.jena.RDFAsJenaModel +import es.weso.rdf.jena.RDFAsJenaModel +import org.scalatest.funspec.AnyFunSpec +import org.scalatest.matchers.should.Matchers -class NodeInfoTest extends FunSpec with Matchers with EitherValues { +class NodeInfoTest extends AnyFunSpec with Matchers with EitherValues { val rdf = RDFAsJenaModel.empty describe("totalDigits") { diff --git a/modules/shex/src/test/scala/es/weso/shex/validator/RegexTest.scala b/modules/shex/src/test/scala/es/weso/shex/validator/RegexTest.scala index 38818984..35785f05 100644 --- a/modules/shex/src/test/scala/es/weso/shex/validator/RegexTest.scala +++ b/modules/shex/src/test/scala/es/weso/shex/validator/RegexTest.scala @@ -2,9 +2,11 @@ package es.weso.shex.validator import es.weso.rdf.jena.RDFAsJenaModel import org.scalatest._ -import scala.util.matching.Regex +import scala.util.matching.Regex +import org.scalatest.funspec.AnyFunSpec +import org.scalatest.matchers.should.Matchers -class RegexTest extends FunSpec with Matchers with EitherValues { +class RegexTest extends AnyFunSpec with Matchers with EitherValues { val rdf = RDFAsJenaModel.empty describe(s"Regex test") { diff --git a/modules/shex/src/test/scala/es/weso/shex/validator/ShouldValidateShapeMap.scala b/modules/shex/src/test/scala/es/weso/shex/validator/ShouldValidateShapeMap.scala index 54678a93..5e4d004f 100644 --- a/modules/shex/src/test/scala/es/weso/shex/validator/ShouldValidateShapeMap.scala +++ b/modules/shex/src/test/scala/es/weso/shex/validator/ShouldValidateShapeMap.scala @@ -5,9 +5,11 @@ import es.weso.shapeMaps.ShapeMap import es.weso.shex.Schema import org.scalatest._ -import scala.util._ +import scala.util._ +import org.scalatest.funspec.AnyFunSpecLike +import org.scalatest.matchers.should.Matchers -trait ShouldValidateShapeMap extends FunSpecLike with Matchers { +trait ShouldValidateShapeMap extends AnyFunSpecLike with Matchers { def shouldValidateWithShapeMap( diff --git a/modules/shex/src/test/scala/es/weso/shex/validator/ValidatorTest.scala b/modules/shex/src/test/scala/es/weso/shex/validator/ValidatorTest.scala index e073a00d..4455ff6e 100644 --- a/modules/shex/src/test/scala/es/weso/shex/validator/ValidatorTest.scala +++ b/modules/shex/src/test/scala/es/weso/shex/validator/ValidatorTest.scala @@ -4,9 +4,11 @@ import es.weso.rdf.RDFReader import es.weso.rdf.jena._ import es.weso.rdf.nodes._ import es.weso.shex._ -import org.scalatest._ +import org.scalatest._ +import org.scalatest.funspec.AnyFunSpec +import org.scalatest.matchers.should.Matchers -class ValidatorTest extends FunSpec with Matchers with EitherValues { +class ValidatorTest extends AnyFunSpec with Matchers with EitherValues { describe("ShEx validator") { val shapeLabel = IRILabel(IRI("http://example.org/S")) diff --git a/modules/shex/src/test/scala/es/weso/shex/validator/ValueCheckerTest.scala b/modules/shex/src/test/scala/es/weso/shex/validator/ValueCheckerTest.scala index c4768068..e0e37735 100644 --- a/modules/shex/src/test/scala/es/weso/shex/validator/ValueCheckerTest.scala +++ b/modules/shex/src/test/scala/es/weso/shex/validator/ValueCheckerTest.scala @@ -2,9 +2,11 @@ package es.weso.shex.validator import es.weso.rdf.nodes._ import es.weso.shex._ -import org.scalatest._ +import org.scalatest._ +import org.scalatest.funspec.AnyFunSpecLike +import org.scalatest.matchers.should.Matchers -class ValueCheckerTest extends ValueChecker(Schema.empty) with FunSpecLike with Matchers with EitherValues { +class ValueCheckerTest extends ValueChecker(Schema.empty) with AnyFunSpecLike with Matchers with EitherValues { describe("LanguageStem") { valueCheckerTest(LangLiteral("pepe", Lang("frc")), diff --git a/modules/shex/src/test/scala/rdf4j/es/weso/shex/validator/ShapeMapValidatorTest.scala b/modules/shex/src/test/scala/rdf4j/es/weso/shex/validator/ShapeMapValidatorTest.scala index f3cebce6..73907e1b 100644 --- a/modules/shex/src/test/scala/rdf4j/es/weso/shex/validator/ShapeMapValidatorTest.scala +++ b/modules/shex/src/test/scala/rdf4j/es/weso/shex/validator/ShapeMapValidatorTest.scala @@ -7,9 +7,11 @@ import cats.data.EitherT import cats.effect._ import org.scalatest._ -import scala.util._ +import scala.util._ +import org.scalatest.funspec.AnyFunSpec +import org.scalatest.matchers.should.Matchers -class ShapeMapValidator_RDF4jTest extends FunSpec with Matchers with EitherValues { +class ShapeMapValidator_RDF4jTest extends AnyFunSpec with Matchers with EitherValues { describe("Simple Shape") { val shexStr = diff --git a/modules/shexTest/src/main/scala/es/weso/shextest/manifest/ValidateManifest.scala b/modules/shexTest/src/main/scala/es/weso/shextest/manifest/ValidateManifest.scala index a082d69f..bcdf1d55 100644 --- a/modules/shexTest/src/main/scala/es/weso/shextest/manifest/ValidateManifest.scala +++ b/modules/shexTest/src/main/scala/es/weso/shextest/manifest/ValidateManifest.scala @@ -2,38 +2,41 @@ package es.weso.shextest.manifest import java.net.URI import java.nio.file.Paths -import es.weso.rdf.jena.RDFAsJenaModel -import es.weso.rdf.nodes.IRI -import es.weso.shapeMaps.{BNodeLabel => BNodeMapLabel, IRILabel => IRIMapLabel, Start => StartMap, _} -// import es.weso.shapeMaps.ShapeMap -import es.weso.utils.FileUtils -import org.scalatest._ -import scala.util.{Either, Left, Right, Try} + import cats.data.EitherT import cats.effect.IO import cats.implicits._ +import es.weso.rdf._ +import es.weso.rdf.jena.RDFAsJenaModel +import es.weso.rdf.nodes.{IRI, _} +import es.weso.shapeMaps.{BNodeLabel => BNodeMapLabel, IRILabel => IRIMapLabel, Start => StartMap, _} import es.weso.shex._ -import es.weso.shex.validator.{ExternalIRIResolver, Validator} import es.weso.shex.compact.CompareSchemas -import es.weso.shextest.manifest.Utils._ import es.weso.shex.implicits.decoderShEx._ import es.weso.shex.implicits.encoderShEx._ -import scala.io._ +import es.weso.shex.validator.{ExternalIRIResolver, Validator} +import es.weso.shextest.manifest.ManifestPrefixes._ +import es.weso.shextest.manifest.Utils._ +import es.weso.utils.FileUtils import io.circe.parser._ import io.circe.syntax._ -import es.weso.rdf._ -import es.weso.rdf.nodes._ -import ManifestPrefixes._ +import org.scalatest.funspec.AnyFunSpec +import org.scalatest.{OptionValues, TryValues} +import org.scalatest.matchers.should.Matchers + +import scala.io._ +import scala.util.{Either, Left, Right, Try} trait RunManifest { case class Result(name: String, isOk: Boolean, reason: String) - case class EntryParam(entry: es.weso.shextest.manifest.Entry, - name: String, - parentFolder: String, - nameIfSingle: Option[String], - ignoreList: List[String] - ) + case class EntryParam( + entry: es.weso.shextest.manifest.Entry, + name: String, + parentFolder: String, + nameIfSingle: Option[String], + ignoreList: List[String] + ) type EntryProcess = EntryParam => EitherT[IO, String, Option[Result]] def runManifest( @@ -68,7 +71,7 @@ trait RunManifest { .map { case (includeNode, manifest) => val folder = Try { Paths.get(includeNode.getLexicalForm).getParent.toString }.getOrElse("") - runManifest(includeNode.getLexicalForm, folder, parentFolder, nameIfSingle, ignoreList,withEntry) + runManifest(includeNode.getLexicalForm, folder, parentFolder, nameIfSingle, ignoreList, withEntry) } .sequence .map(_.flatten) @@ -76,11 +79,11 @@ trait RunManifest { } yield (vs1 ++ vs2.flatten[Result]) } -trait ValidateManifest extends FunSpec with Matchers with TryValues with OptionValues with RunManifest { +trait ValidateManifest extends AnyFunSpec with Matchers with TryValues with OptionValues with RunManifest { def showFailed(vs: List[Result], withReason: Boolean): String = { - vs.map(f => s"${f.name}${if (withReason) s": ${f.reason}" else ""}").mkString("\n") ++ - s"\nNumber of failed tests: ${vs.length}" + vs.map(f => s"${f.name}${if (withReason) s": ${f.reason}" else ""}").mkString("\n") ++ + s"\nNumber of failed tests: ${vs.length}" } def parseManifest( @@ -93,53 +96,55 @@ trait ValidateManifest extends FunSpec with Matchers with TryValues with OptionV ): Unit = { it(s"Should parse manifestTest $folder/$name") { val r = runManifest(name, folder, parentFolder, nameIfSingle, ignoreList, processEntryValidating) - r.value.unsafeRunSync.fold(e => { - val currentFolder = new java.io.File(".").getCanonicalPath - fail(s"Error: $e\nCurrent folder: $currentFolder") - }, vs => { - val failed = vs.filter(_.isOk == false ) - if (failed.length == 0) - info(s"No failures. Number of tests run: ${vs.length}\nIgnored list: ${ignoreList.mkString(",")}") - else - fail(s"Failed tests: ${showFailed(failed,verbose)}/${vs.length}") - }) + r.value.unsafeRunSync.fold( + e => { + val currentFolder = new java.io.File(".").getCanonicalPath + fail(s"Error: $e\nCurrent folder: $currentFolder") + }, + vs => { + val failed = vs.filter(_.isOk == false) + if (failed.length == 0) + info(s"No failures. Number of tests run: ${vs.length}\nIgnored list: ${ignoreList.mkString(",")}") + else + fail(s"Failed tests: ${showFailed(failed, verbose)}/${vs.length}") + } + ) } } def processEntryValidating: EntryProcess = ep => { - if (ep.nameIfSingle == None || - ep.nameIfSingle.getOrElse("") == ep.entry.name - ) { - if (ep.ignoreList contains(ep.entry.name)) { - result(ep.entry.name, true, s"Ignored ${ep.entry.name}") + if (ep.nameIfSingle == None || + ep.nameIfSingle.getOrElse("") == ep.entry.name) { + if (ep.ignoreList contains (ep.entry.name)) { + result(ep.entry.name, true, s"Ignored ${ep.entry.name}") } else { - val folderURI = Paths.get(ep.parentFolder).normalize.toUri - val base = Paths.get(".").toUri - - ep.entry match { + val folderURI = Paths.get(ep.parentFolder).normalize.toUri + val base = Paths.get(".").toUri - case v: ValidationTest => { - v.action match { - case focusAction: FocusAction => validateFocusAction(focusAction, base, v, true, v.name, folderURI) - case mr: MapResultAction => validateMapResult(mr, base, v, v.name, folderURI) - case ma: ManifestAction => result(v.name, false, s"Not implemented validate ManifestAction yet") + ep.entry match { + + case v: ValidationTest => { + v.action match { + case focusAction: FocusAction => validateFocusAction(focusAction, base, v, true, v.name, folderURI) + case mr: MapResultAction => validateMapResult(mr, base, v, v.name, folderURI) + case ma: ManifestAction => result(v.name, false, s"Not implemented validate ManifestAction yet") + } } - } - - case v: ValidationFailure => { - v.action match { - case focusAction: FocusAction => validateFocusAction(focusAction, base, v, false, v.name, folderURI) - case mr: MapResultAction => validateMapResult(mr, base, v, v.name, folderURI) - case ma: ManifestAction => result(v.name, false, s"Not implemented validationFailure ManifestAction yet") + + case v: ValidationFailure => { + v.action match { + case focusAction: FocusAction => validateFocusAction(focusAction, base, v, false, v.name, folderURI) + case mr: MapResultAction => validateMapResult(mr, base, v, v.name, folderURI) + case ma: ManifestAction => result(v.name, false, s"Not implemented validationFailure ManifestAction yet") + } } - } - case v: NegativeSyntax => negativeSyntax(v, folderURI) - case v: NegativeStructure => negativeStructure(v,folderURI) - case r: RepresentationTest => representationTest(r, folderURI) - case other => result(other.name,false, s"Unsupported type of entry: ${ep.entry}") + case v: NegativeSyntax => negativeSyntax(v, folderURI) + case v: NegativeStructure => negativeStructure(v, folderURI) + case r: RepresentationTest => representationTest(r, folderURI) + case other => result(other.name, false, s"Unsupported type of entry: ${ep.entry}") + } } - } } else EitherT.pure(None) } @@ -154,25 +159,26 @@ trait ValidateManifest extends FunSpec with Matchers with TryValues with OptionV case Some(iri) => FileUtils.getContents(folder + "/" + iri.str).map(_.toString) } - def representationTest(r: RepresentationTest, folderURI: URI): EitherT[IO, String, Option[Result]] = { - val resolvedJson = mkLocal(r.json, schemasBase, folderURI) // IRI(shexFolderURI).resolve(r.json).uri - val resolvedShEx = mkLocal(r.shex, schemasBase, folderURI) // IRI(shexFolderURI).resolve(r.shex).uri - val jsonStr = Source.fromURI(resolvedJson)("UTF-8").mkString - val schemaStr = Source.fromURI(resolvedShEx)("UTF-8").mkString + val resolvedJson = mkLocal(r.json, schemasBase, folderURI) // IRI(shexFolderURI).resolve(r.json).uri + val resolvedShEx = mkLocal(r.shex, schemasBase, folderURI) // IRI(shexFolderURI).resolve(r.shex).uri + val jsonStr = Source.fromURI(resolvedJson)("UTF-8").mkString + val schemaStr = Source.fromURI(resolvedShEx)("UTF-8").mkString Schema.fromString(schemaStr, "SHEXC", None) match { case Right(schema) => { decode[Schema](jsonStr) match { - case Left(err) => result(r.name,false,s"Error parsing Json ${r.json}: $err") + case Left(err) => result(r.name, false, s"Error parsing Json ${r.json}: $err") case Right(expectedSchema) => if (CompareSchemas.compareSchemas(schema, expectedSchema)) { parse(jsonStr) match { - case Left(err) => result(r.name, false,s"Schemas are equal but error parsing Json $jsonStr") + case Left(err) => result(r.name, false, s"Schemas are equal but error parsing Json $jsonStr") case Right(json) => { if (json.equals(schema.asJson)) { result(r.name, true, "JSONs are equal") } else { - result(r.name,false, + result( + r.name, + false, s"Json's are different\nSchema:${schema}\nJson generated: ${schema.asJson.spaces2}\nExpected: ${json.spaces2}" ) } @@ -183,7 +189,7 @@ trait ValidateManifest extends FunSpec with Matchers with TryValues with OptionV } } } - case Left(e) => result(r.name,false, s"Error parsing Schema: ${r.shex}: $e") + case Left(e) => result(r.name, false, s"Error parsing Schema: ${r.shex}: $e") } } @@ -223,7 +229,10 @@ trait ValidateManifest extends FunSpec with Matchers with TryValues with OptionV ok <- if (resultShapeMap.getConformantShapes(focus) contains lbl) { if (shouldValidate) result(name, true, "Conformant shapes match") else - result(name, false, s"Focus $focus conforms to $lbl but should not" ++ + result( + name, + false, + s"Focus $focus conforms to $lbl but should not" ++ s"\nData: \n${dataStr}\nSchema: ${schemaStr}\n" ++ s"${resultShapeMap.getInfo(focus, lbl)}\n" ++ s"Schema: ${schema}\n" ++ @@ -232,7 +241,9 @@ trait ValidateManifest extends FunSpec with Matchers with TryValues with OptionV } else { if (!shouldValidate) result(name, true, "Doesn't validate as expected") else - result(name, false, + result( + name, + false, s"Focus $focus does not conform to $lbl but should" ++ s"\nData: \n${dataStr}\nSchema: ${schemaStr}\n" ++ s"${resultShapeMap.getInfo(focus, lbl)}\n" ++ @@ -260,51 +271,74 @@ trait ValidateManifest extends FunSpec with Matchers with TryValues with OptionV val resultMapUri = mkLocal(resultIRI, validationBase, folderURI) val r: EitherT[IO, String, Option[Result]] = for { //_ <- testInfo(s"Validating mapResult: $name") - schemaStr <- derefUriIO(schemaUri) - resultMapStr <- derefUriIO(resultMapUri) - smapStr <- derefUriIO(shapeMapUri) - sm <- fromEither(ShapeMap.fromJson(smapStr).leftMap(s => s"Error parsing shapeMap: $s\nShapeMap:\n$smapStr")) - schema <- fromEither(Schema.fromString(schemaStr, "SHEXC", None).leftMap(s => s"Error parsing schema: $s\nSchemaStr:\n $schemaStr")) - fixedShapeMap <- fromEither(ShapeMap.fixShapeMap(sm, RDFAsJenaModel.empty, PrefixMap.empty, PrefixMap.empty).leftMap(s => s"Error fixing shape map: $s\nShapeMap: $sm")) + schemaStr <- derefUriIO(schemaUri) + resultMapStr <- derefUriIO(resultMapUri) + smapStr <- derefUriIO(shapeMapUri) + sm <- fromEither(ShapeMap.fromJson(smapStr).leftMap(s => s"Error parsing shapeMap: $s\nShapeMap:\n$smapStr")) + schema <- fromEither( + Schema + .fromString(schemaStr, "SHEXC", None) + .leftMap(s => s"Error parsing schema: $s\nSchemaStr:\n $schemaStr") + ) + fixedShapeMap <- fromEither( + ShapeMap + .fixShapeMap(sm, RDFAsJenaModel.empty, PrefixMap.empty, PrefixMap.empty) + .leftMap(s => s"Error fixing shape map: $s\nShapeMap: $sm") + ) dataUri = mkLocal(mr.data, schemasBase, folderURI) - strData <- derefUriIO(dataUri) - data <- RDFAsJenaModel.fromStringIO(strData, "TURTLE", None) - resultShapeMap <- fromEither(Validator(schema).validateShapeMap(data, fixedShapeMap).toEitherS.leftMap(s => s"Error validating: $s")) - jsonResult <- fromEither(JsonResult.fromJsonString(resultMapStr).leftMap(s => s"Error parsing JSON result: $s")) + strData <- derefUriIO(dataUri) + data <- RDFAsJenaModel.fromStringIO(strData, "TURTLE", None) + resultShapeMap <- fromEither( + Validator(schema).validateShapeMap(data, fixedShapeMap).toEitherS.leftMap(s => s"Error validating: $s") + ) + jsonResult <- fromEither( + JsonResult.fromJsonString(resultMapStr).leftMap(s => s"Error parsing JSON result: $s") + ) result <- if (jsonResult.compare(resultShapeMap)) result(name, true, "Json results match") - else result(name,false, s"Json results are different. Expected: ${jsonResult.asJson.spaces2}\nObtained: ${resultShapeMap.toString}") + else + result( + name, + false, + s"Json results are different. Expected: ${jsonResult.asJson.spaces2}\nObtained: ${resultShapeMap.toString}" + ) } yield result r } } } - def negativeSyntax(ns: NegativeSyntax, folderURI: URI): EitherT[IO,String, Option[Result]] = { - val schemaUri = mkLocal(ns.shex, negativeSyntaxBase, folderURI) + def negativeSyntax(ns: NegativeSyntax, folderURI: URI): EitherT[IO, String, Option[Result]] = { + val schemaUri = mkLocal(ns.shex, negativeSyntaxBase, folderURI) val r: EitherT[IO, String, Option[Result]] = for { - schemaStr <- derefUriIO(schemaUri) - result <- Schema.fromString(schemaStr, "SHEXC", None). - fold(s => result(ns.name, true, s), - schema => result(ns.name, false, s"Parsed OK with ${schema} but should have negative syntax. String: \n${schemaStr}") - ) + schemaStr <- derefUriIO(schemaUri) + result <- Schema + .fromString(schemaStr, "SHEXC", None) + .fold( + s => result(ns.name, true, s), + schema => + result(ns.name, false, s"Parsed OK with ${schema} but should have negative syntax. String: \n${schemaStr}") + ) } yield result r } - def negativeStructure(ns: NegativeStructure, folderURI: URI): EitherT[IO,String, Option[Result]] = { - val schemaUri = mkLocal(ns.shex, negativeSyntaxBase, folderURI) + def negativeStructure(ns: NegativeStructure, folderURI: URI): EitherT[IO, String, Option[Result]] = { + val schemaUri = mkLocal(ns.shex, negativeSyntaxBase, folderURI) val r: EitherT[IO, String, Option[Result]] = for { - schemaStr <- derefUriIO(schemaUri) - schema <- fromEither(Schema.fromString(schemaStr, "SHEXC", None).leftMap(e => s"Error reading schema $e\nSchema string:\n${schemaStr}")) - result <- schema.wellFormed. - fold(s => result(ns.name, false, s"Schema parsed ok but is not well formed: $s\nSchema string:\n${schemaStr}"), - schema => result(ns.name, true, s"Schema is well formed") - ) + schemaStr <- derefUriIO(schemaUri) + schema <- fromEither( + Schema + .fromString(schemaStr, "SHEXC", None) + .leftMap(e => s"Error reading schema $e\nSchema string:\n${schemaStr}") + ) + result <- schema.wellFormed.fold( + s => result(ns.name, false, s"Schema parsed ok but is not well formed: $s\nSchema string:\n${schemaStr}"), + schema => result(ns.name, true, s"Schema is well formed") + ) } yield result r } - def derefUriIO(uri: URI): EitherT[IO, String, String] = { EitherT( IO( diff --git a/modules/shexTest/src/test/scala/es/weso/shextest/manifest/JsonResultTest.scala b/modules/shexTest/src/test/scala/es/weso/shextest/manifest/JsonResultTest.scala index 9dfa3870..f44aefdf 100644 --- a/modules/shexTest/src/test/scala/es/weso/shextest/manifest/JsonResultTest.scala +++ b/modules/shexTest/src/test/scala/es/weso/shextest/manifest/JsonResultTest.scala @@ -5,9 +5,11 @@ import com.typesafe.config.{Config, ConfigFactory} import io.circe.parser._ import io.circe.syntax._ import org.scalatest._ -import scala.io.Source +import scala.io.Source +import org.scalatest.funspec.AnyFunSpec +import org.scalatest.matchers.should.Matchers -class JsonResultTest extends FunSpec with Matchers with TryValues with OptionValues{ +class JsonResultTest extends AnyFunSpec with Matchers with TryValues with OptionValues{ val conf: Config = ConfigFactory.load() val shexFolder = conf.getString("validationFolder") diff --git a/modules/shexTest/src/test/scala/es/weso/shextest/manifest/RDF2ManifestLocalTest.scala b/modules/shexTest/src/test/scala/es/weso/shextest/manifest/RDF2ManifestLocalTest.scala index 5f2f66f4..e2ddcdf8 100644 --- a/modules/shexTest/src/test/scala/es/weso/shextest/manifest/RDF2ManifestLocalTest.scala +++ b/modules/shexTest/src/test/scala/es/weso/shextest/manifest/RDF2ManifestLocalTest.scala @@ -3,19 +3,19 @@ package es.weso.shextest.manifest // import java.nio.file.Paths import com.typesafe.config.{Config, ConfigFactory} -import org.scalatest._ +import org.scalatest.funspec.AnyFunSpec -class RDF2ManifestLocalTest extends FunSpec with ValidateManifest { +class RDF2ManifestLocalTest extends AnyFunSpec with ValidateManifest { val conf: Config = ConfigFactory.load() -/* describe("RDF2Manifest inheritance") { + /* describe("RDF2Manifest inheritance") { val localFolder = conf.getString("localTestsFolder") parseManifestValidating("manifest","inheritance", localFolder, None) } */ describe("RDF2Manifest localTests") { val validationFolder = conf.getString("localTestsFolder") - parseManifest("manifest", "schemas", validationFolder, None,List(),false) - } + parseManifest("manifest", "schemas", validationFolder, None, List(), false) + } } diff --git a/modules/shexTest/src/test/scala/es/weso/shextest/manifest/RDF2ManifestTest.scala b/modules/shexTest/src/test/scala/es/weso/shextest/manifest/RDF2ManifestTest.scala index e01ebe47..c2de9232 100644 --- a/modules/shexTest/src/test/scala/es/weso/shextest/manifest/RDF2ManifestTest.scala +++ b/modules/shexTest/src/test/scala/es/weso/shextest/manifest/RDF2ManifestTest.scala @@ -3,48 +3,47 @@ package es.weso.shextest.manifest // import java.nio.file.Paths import com.typesafe.config.{Config, ConfigFactory} -import org.scalatest._ +import org.scalatest.funspec.AnyFunSpec -class RDF2ManifestTest extends FunSpec with ValidateManifest { +class RDF2ManifestTest extends AnyFunSpec with ValidateManifest { val conf: Config = ConfigFactory.load() describe("RDF2Manifest schemas") { val validationFolder = conf.getString("testsFolder") - parseManifest("manifest", "schemas", validationFolder, None,List(), false) - } + parseManifest("manifest", "schemas", validationFolder, None, List(), false) + } describe("RDF2Manifest negativeSyntax") { val validationFolder = conf.getString("testsFolder") - parseManifest("manifest", - "negativeSyntax", - validationFolder, - None, - List("1unknowndatatypeMaxInclusive"), - true) - } + parseManifest("manifest", "negativeSyntax", validationFolder, None, List("1unknowndatatypeMaxInclusive"), true) + } describe("RDF2Manifest negativeStructure") { val validationFolder = conf.getString("testsFolder") - parseManifest("manifest", - "negativeStructure", - validationFolder, - None, - List("1MissingRef", - "1focusMissingRefdot", - "includeExpressionNotFound", - "Cycle1Negation1", - "Cycle1Negation2", - "Cycle1Negation3", - "TwoNegation", - "Cycle2Negation", - "Cycle2Extra" - ), false) + parseManifest( + "manifest", + "negativeStructure", + validationFolder, + None, + List( + "1MissingRef", + "1focusMissingRefdot", + "includeExpressionNotFound", + "Cycle1Negation1", + "Cycle1Negation2", + "Cycle1Negation3", + "TwoNegation", + "Cycle2Negation", + "Cycle2Extra" + ), + false + ) } describe("RDF2Manifest validating") { val validationFolder = conf.getString("testsFolder") parseManifest("manifest", "validation", validationFolder, None, List(), false) - } - + } + } diff --git a/project/plugins.sbt b/project/plugins.sbt index 5e44e107..dc0a831c 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,6 +1,6 @@ -addSbtPlugin("com.eed3si9n" % "sbt-unidoc" % "0.4.2") -addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.10") -addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.9.0") +addSbtPlugin("com.eed3si9n" % "sbt-unidoc" % "0.4.2") +addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.10") +addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.9.0") // addSbtPlugin("com.typesafe.sbt" % "sbt-twirl" % "1.4.2") addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "1.4.0") addSbtPlugin("com.typesafe.sbt" % "sbt-ghpages" % "0.6.3") From 889bc27bd4492446cece539f908d9919b7327877 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Toni=20Cebria=CC=81n?= Date: Fri, 17 Jan 2020 10:10:27 +0100 Subject: [PATCH 3/4] Pass tests again --- .../localTests/shex-parsing-of-comments.shex | 7 ------- .../es/weso/shex/ParsingCommentsSpec.scala | 18 ------------------ 2 files changed, 25 deletions(-) delete mode 100644 modules/shex/src/test/resources/localTests/shex-parsing-of-comments.shex delete mode 100644 modules/shex/src/test/scala/es/weso/shex/ParsingCommentsSpec.scala diff --git a/modules/shex/src/test/resources/localTests/shex-parsing-of-comments.shex b/modules/shex/src/test/resources/localTests/shex-parsing-of-comments.shex deleted file mode 100644 index 31dc3ebd..00000000 --- a/modules/shex/src/test/resources/localTests/shex-parsing-of-comments.shex +++ /dev/null @@ -1,7 +0,0 @@ -prefix : -prefix foaf: -prefix xsd: - -:Person { - foaf:name xsd:string ; # Test -} \ No newline at end of file diff --git a/modules/shex/src/test/scala/es/weso/shex/ParsingCommentsSpec.scala b/modules/shex/src/test/scala/es/weso/shex/ParsingCommentsSpec.scala deleted file mode 100644 index eebd8212..00000000 --- a/modules/shex/src/test/scala/es/weso/shex/ParsingCommentsSpec.scala +++ /dev/null @@ -1,18 +0,0 @@ -package es.weso.shex - -import org.scalatest.EitherValues - -import scala.io.Source -import org.scalatest.flatspec.AnyFlatSpec -import org.scalatest.matchers.should.Matchers - -class ParsingCommentsSpec extends AnyFlatSpec with Matchers with EitherValues { - "Shex" should "parse comments" in { - val contentFile = Source.fromFile("modules/shex/src/test/resources/localTests/shex-parsing-of-comments.shex") - val parsing = Schema.fromString(contentFile.getLines().mkString, "ShexC", None) - parsing match { - case Right(_) => succeed - case Left(e) => fail(e) - } - } -} From 5209d998de7dd57333e40723c93f65183e297bad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Toni=20Cebria=CC=81n?= Date: Fri, 17 Jan 2020 10:24:41 +0100 Subject: [PATCH 4/4] Address Codereview issues --- .../src/test/scala/es/weso/shex/spec/TypingMapTest.scala | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/modules/shex/src/test/scala/es/weso/shex/spec/TypingMapTest.scala b/modules/shex/src/test/scala/es/weso/shex/spec/TypingMapTest.scala index e096ad9e..19925b9b 100644 --- a/modules/shex/src/test/scala/es/weso/shex/spec/TypingMapTest.scala +++ b/modules/shex/src/test/scala/es/weso/shex/spec/TypingMapTest.scala @@ -4,7 +4,4 @@ import org.scalatest._ import org.scalatest.funspec.AnyFunSpec import org.scalatest.matchers.should.Matchers -class TypingMapTest extends AnyFunSpec with Matchers with EitherValues { - - -} +class TypingMapTest extends AnyFunSpec with Matchers with EitherValues