今天我想寫一些測試使用ImpermamentDatabase
,Neo4j的網頁上:http://docs.neo4j.org/chunked/stable/tutorials-java-unit-testing.html它說,neo4j-kernel
罐子必須<type>test-jar</type>
添加爲它containt測試類。春天數據的Neo4j 2.3.4 - ImpermamentDatabase和依賴罐子版本
現在,這裏是我的build.sbt
:
name := """scheduling-backend"""
version := "1.0"
scalaVersion := "2.10.2"
resolvers += "spray repo" at "http://repo.spray.io"
resolvers += "spray nightlies" at "http://nightlies.spray.io"
resolvers += "SpringSource Milestone Repository" at "http://repo.springsource.org/milestone"
resolvers += "Neo4j Cypher DSL Repository" at "http://m2.neo4j.org/content/repositories/releases"
libraryDependencies ++= Seq(
"com.typesafe.akka" %% "akka-actor" % "2.2.0",
"com.typesafe.akka" %% "akka-slf4j" % "2.2.0",
"ch.qos.logback" % "logback-classic" % "1.0.13",
"io.spray" % "spray-can" % "1.2-20130712",
"io.spray" % "spray-routing" % "1.2-20130712",
"io.spray" %% "spray-json" % "1.2.3",
"org.specs2" %% "specs2" % "1.14" % "test",
"io.spray" % "spray-testkit" % "1.2-20130712" % "test",
"com.typesafe.akka" %% "akka-testkit" % "2.2.0" % "test",
"com.novocode" % "junit-interface" % "0.7" % "test->default",
"org.springframework.scala" % "spring-scala" % "1.0.0.M2",
"org.springframework.data" % "spring-data-neo4j" % "2.3.4.RELEASE",
"org.springframework.data" % "spring-data-neo4j-rest" % "2.3.4.RELEASE",
"javax.validation" % "validation-api" % "1.1.0.Final",
"com.github.nscala-time" %% "nscala-time" % "0.8.0"
)
scalacOptions ++= Seq(
"-unchecked",
"-deprecation",
"-Xlint",
"-Ywarn-dead-code",
"-language:_",
"-target:jvm-1.7",
"-encoding", "UTF-8"
)
testOptions += Tests.Argument(TestFrameworks.JUnit, "-v")
在Intellij
看時,我可以看到我在1.9.3
版本有例如neo4j-kernel
依賴,不應該將其包含在2.X
版本罐子?
另一個問題,是安全的,我只是在最新版本test-jar
類型添加neo4j-kernel
或者我應該將其添加在1.9.3
版本(如現有的JAR)
感謝您的答案,我切換到'3.0.0'版本並添加了''org.neo4j「%」neo4j-kernel「%」2.0.1「%」test「classifier」tests「'並且一切正常。 – Andna
很高興聽到:) – amb