diff --git a/apps/routerconsole/java/build.xml b/apps/routerconsole/java/build.xml index a2a1878dc8115a34e35217694a4264c692fca6e5..56c399b9878704b05d5f33bda31fdf156870199e 100644 --- a/apps/routerconsole/java/build.xml +++ b/apps/routerconsole/java/build.xml @@ -455,10 +455,14 @@ <!-- scala paths --> <target name="scala.init"> <property name="scala-library.jar" value="${scalatest.libs}/scala-library.jar" /> + <property name="scala-xml.jar" value="${scalatest.libs}/scala-xml.jar" /> + <property name="scalactic.jar" value="${scalatest.libs}/scalactic.jar" /> <property name="scalatest.jar" value="${scalatest.libs}/scalatest.jar" /> + <property name="mockito.home" value="${ant.home}/lib" /> <taskdef resource="scala/tools/ant/antlib.xml"> <classpath> <pathelement location="${scalatest.libs}/scala-compiler.jar" /> + <pathelement location="${scalatest.libs}/scala-reflect.jar" /> <pathelement location="${scala-library.jar}" /> </classpath> </taskdef> @@ -475,8 +479,11 @@ <scalac srcdir="./test/scalatest" destdir="./build/obj_scala" deprecation="on" > <classpath> <pathelement location="${scala-library.jar}" /> + <pathelement location="${scalactic.jar}" /> <pathelement location="${scalatest.jar}" /> - <pathelement location="${scalatest.libs}/mockito-all.jar" /> + <pathelement location="${mockito.home}/byte-buddy.jar" /> + <pathelement location="${mockito.home}/objenesis.jar" /> + <pathelement location="${mockito.home}/mockito-core.jar" /> <pathelement location="../../../core/java/build/i2pscalatest.jar" /> <pathelement location="../../../router/java/build/routerscalatest.jar" /> <pathelement location="./build/obj" /> @@ -513,6 +520,8 @@ <classpath> <pathelement location="${classpath}" /> <pathelement location="${scala-library.jar}" /> + <pathelement location="${scala-xml.jar}" /> + <pathelement location="${scalactic.jar}" /> <pathelement location="${scalatest.jar}" /> <pathelement location="./build/obj_cobertura" /> <pathelement location="./build/obj" /> diff --git a/apps/routerconsole/java/test/scalatest/net/i2p/router/update/ConsoleUpdateManagerSpec.scala b/apps/routerconsole/java/test/scalatest/net/i2p/router/update/ConsoleUpdateManagerSpec.scala index a4754c6c880112a689241da98b448952e90ba671..be4feba04c24afc515c0d3222e01cc26a0f88502 100644 --- a/apps/routerconsole/java/test/scalatest/net/i2p/router/update/ConsoleUpdateManagerSpec.scala +++ b/apps/routerconsole/java/test/scalatest/net/i2p/router/update/ConsoleUpdateManagerSpec.scala @@ -3,6 +3,7 @@ package net.i2p.router.update import org.scalatest.FunSpec import org.scalatest.mock.MockitoSugar +import net.i2p.app.ClientAppManager; import net.i2p.router.RouterContext /** @@ -11,7 +12,8 @@ import net.i2p.router.RouterContext class ConsoleUpdateManagerSpec extends FunSpec with UpdateManagerBehaviors with MockitoSugar { def consoleUpdateManager = { val mockCtx = mock[RouterContext] - val cum = new ConsoleUpdateManager(mockCtx) + val mockMgr = mock[ClientAppManager] + val cum = new ConsoleUpdateManager(mockCtx, mockMgr, null) cum } diff --git a/build.properties b/build.properties index 822d9c097244e2a889640444e661e2822e57b6a2..8aa9bb32757e3baa9c46afdb4d09aba5fa4d4ed4 100644 --- a/build.properties +++ b/build.properties @@ -90,10 +90,13 @@ javac.version=1.7 # Location of the libraries required for the ScalaTest tests. # Define this in override.properties or pass in on the command line. # The directory must contain the following library names: -# mockito-all.jar # scala-compiler.jar # scala-library.jar +# scala-reflect.jar +# scala-xml.jar +# scalactic.jar # scalatest.jar +# Tested using Scala 2.12.1, scala-xml 1.0.6, and ScalaTest 3.0.1 #scalatest.libs=/PATH/TO/SCALATEST/lib # Location of the junit libraries @@ -105,12 +108,14 @@ javac.version=1.7 # Defaults to the ant library path if not set # If set, this must point to a directory containing the files # hamcrest-core.jar, hamcrest-library.jar, and hamcrest-integration.jar +# Tested using Hamcrest 1.3 #hamcrest.home= # Location of the mockito libraries # Defaults to the ant library path if not set # If set, this must point to a directory containing the files # mockito-core.jar, byte-buddy.jar, objenesis.jar +# Tested using Mockito 2.5.0 which requires byte-buddy 1.5.12 and objenesis 2.4 #mockito.home= # Optional properties used in tests to enable additional tools. diff --git a/core/java/build.xml b/core/java/build.xml index 1f301ae591b7982b0dcf06ecc6bd1b7b33dce65e..ad7597559fd9efb4794fc1fa4f05f8c954673675 100644 --- a/core/java/build.xml +++ b/core/java/build.xml @@ -141,10 +141,13 @@ <!-- scala paths --> <target name="scala.init"> <property name="scala-library.jar" value="${scalatest.libs}/scala-library.jar" /> + <property name="scala-xml.jar" value="${scalatest.libs}/scala-xml.jar" /> + <property name="scalactic.jar" value="${scalatest.libs}/scalactic.jar" /> <property name="scalatest.jar" value="${scalatest.libs}/scalatest.jar" /> <taskdef resource="scala/tools/ant/antlib.xml"> <classpath> <pathelement location="${scalatest.libs}/scala-compiler.jar" /> + <pathelement location="${scalatest.libs}/scala-reflect.jar" /> <pathelement location="${scala-library.jar}" /> </classpath> </taskdef> @@ -158,6 +161,7 @@ <classpath> <pathelement location="${javac.classpath.mod}" /> <pathelement location="${scala-library.jar}" /> + <pathelement location="${scalactic.jar}" /> <pathelement location="${scalatest.jar}" /> <pathelement location="./build/obj" /> </classpath> @@ -264,6 +268,8 @@ <taskdef name="scalatest" classname="org.scalatest.tools.ScalaTestAntTask"> <classpath> <pathelement location="${scala-library.jar}" /> + <pathelement location="${scala-xml.jar}" /> + <pathelement location="${scalactic.jar}" /> <pathelement location="${scalatest.jar}" /> <pathelement location="./build/obj_cobertura" /> <pathelement location="./build/obj" /> diff --git a/core/java/test/scalatest/net/i2p/data/HashSpec.scala b/core/java/test/scalatest/net/i2p/data/HashSpec.scala index ae925ed62f18fcb62f928cedd724548513b07ac0..73b86fa02a649a00609969a1f65b14a624649483 100644 --- a/core/java/test/scalatest/net/i2p/data/HashSpec.scala +++ b/core/java/test/scalatest/net/i2p/data/HashSpec.scala @@ -1,12 +1,12 @@ package net.i2p.data import org.scalatest.FunSpec -import org.scalatest.matchers.ShouldMatchers +import org.scalatest.Matchers /** * @author str4d */ -class HashSpec extends FunSpec with ShouldMatchers { +class HashSpec extends FunSpec with Matchers { val hash = new Hash describe("A Hash") { diff --git a/core/java/test/scalatest/net/i2p/data/PrivateKeySpec.scala b/core/java/test/scalatest/net/i2p/data/PrivateKeySpec.scala index 2804be67d950ecc25ee274d9d2d1301f997846b3..bd028f8f16a6a058eb614cccec3f4ee7178cf52a 100644 --- a/core/java/test/scalatest/net/i2p/data/PrivateKeySpec.scala +++ b/core/java/test/scalatest/net/i2p/data/PrivateKeySpec.scala @@ -1,12 +1,12 @@ package net.i2p.data import org.scalatest.FunSpec -import org.scalatest.matchers.ShouldMatchers +import org.scalatest.Matchers /** * @author str4d */ -class PrivateKeySpec extends FunSpec with ShouldMatchers { +class PrivateKeySpec extends FunSpec with Matchers { val privateKey = new PrivateKey describe("A PrivateKey") { diff --git a/core/java/test/scalatest/net/i2p/data/PublicKeySpec.scala b/core/java/test/scalatest/net/i2p/data/PublicKeySpec.scala index b45230bb376d95b25bde8e0acd0cbf81862dcbff..d43fba2e8f17dbe240ba248356cd336c8bfef38b 100644 --- a/core/java/test/scalatest/net/i2p/data/PublicKeySpec.scala +++ b/core/java/test/scalatest/net/i2p/data/PublicKeySpec.scala @@ -1,12 +1,12 @@ package net.i2p.data import org.scalatest.FunSpec -import org.scalatest.matchers.ShouldMatchers +import org.scalatest.Matchers /** * @author str4d */ -class PublicKeySpec extends FunSpec with ShouldMatchers { +class PublicKeySpec extends FunSpec with Matchers { val publicKey = new PublicKey describe("A PublicKey") { diff --git a/core/java/test/scalatest/net/i2p/data/SessionKeySpec.scala b/core/java/test/scalatest/net/i2p/data/SessionKeySpec.scala index 7330b59686397dac29fbfb79013338edacd8d772..2c856848d01900b30296ac72336666797e14cc3f 100644 --- a/core/java/test/scalatest/net/i2p/data/SessionKeySpec.scala +++ b/core/java/test/scalatest/net/i2p/data/SessionKeySpec.scala @@ -1,12 +1,12 @@ package net.i2p.data import org.scalatest.FunSpec -import org.scalatest.matchers.ShouldMatchers +import org.scalatest.Matchers /** * @author str4d */ -class SessionKeySpec extends FunSpec with ShouldMatchers { +class SessionKeySpec extends FunSpec with Matchers { val sessionKey = new SessionKey describe("A SessionKey") { diff --git a/core/java/test/scalatest/net/i2p/data/SessionTagSpec.scala b/core/java/test/scalatest/net/i2p/data/SessionTagSpec.scala index c845585b94760cf9bfdf9fc014b48905aab536e5..e2d5988ccd026c53bac650e1a3fd5a802fc81210 100644 --- a/core/java/test/scalatest/net/i2p/data/SessionTagSpec.scala +++ b/core/java/test/scalatest/net/i2p/data/SessionTagSpec.scala @@ -1,12 +1,12 @@ package net.i2p.data import org.scalatest.FunSpec -import org.scalatest.matchers.ShouldMatchers +import org.scalatest.Matchers /** * @author str4d */ -class SessionTagSpec extends FunSpec with ShouldMatchers { +class SessionTagSpec extends FunSpec with Matchers { val sessionTag = new SessionTag describe("A SessionTag") { diff --git a/core/java/test/scalatest/net/i2p/data/SignatureSpec.scala b/core/java/test/scalatest/net/i2p/data/SignatureSpec.scala index 4476d9f8acc5debe9d3656ecceca519f9a142bff..dacb5d96e77af89b3d92f4722470f9d9937c05cf 100644 --- a/core/java/test/scalatest/net/i2p/data/SignatureSpec.scala +++ b/core/java/test/scalatest/net/i2p/data/SignatureSpec.scala @@ -1,12 +1,12 @@ package net.i2p.data import org.scalatest.FunSpec -import org.scalatest.matchers.ShouldMatchers +import org.scalatest.Matchers /** * @author str4d */ -class SignatureSpec extends FunSpec with ShouldMatchers { +class SignatureSpec extends FunSpec with Matchers { val signature = new Signature describe("A Signature") { diff --git a/core/java/test/scalatest/net/i2p/data/SigningPrivateKeySpec.scala b/core/java/test/scalatest/net/i2p/data/SigningPrivateKeySpec.scala index e6e9107ec0ab54074ff1ac218fb95381a5c55a38..6efa6c2ad4a216dc1f595127020caaa03b7222cc 100644 --- a/core/java/test/scalatest/net/i2p/data/SigningPrivateKeySpec.scala +++ b/core/java/test/scalatest/net/i2p/data/SigningPrivateKeySpec.scala @@ -1,12 +1,12 @@ package net.i2p.data import org.scalatest.FunSpec -import org.scalatest.matchers.ShouldMatchers +import org.scalatest.Matchers /** * @author str4d */ -class SigningPrivateKeySpec extends FunSpec with ShouldMatchers { +class SigningPrivateKeySpec extends FunSpec with Matchers { val signingPrivateKey = new SigningPrivateKey describe("A SigningPrivateKey") { diff --git a/core/java/test/scalatest/net/i2p/data/SigningPublicKeySpec.scala b/core/java/test/scalatest/net/i2p/data/SigningPublicKeySpec.scala index 6a9d450a5e8f51981e0130770aead5b5a11fad3d..49177d9ac5e46e00a810e69f0f6c2b623bbcb98f 100644 --- a/core/java/test/scalatest/net/i2p/data/SigningPublicKeySpec.scala +++ b/core/java/test/scalatest/net/i2p/data/SigningPublicKeySpec.scala @@ -1,12 +1,12 @@ package net.i2p.data import org.scalatest.FunSpec -import org.scalatest.matchers.ShouldMatchers +import org.scalatest.Matchers /** * @author str4d */ -class SigningPublicKeySpec extends FunSpec with ShouldMatchers { +class SigningPublicKeySpec extends FunSpec with Matchers { val signingPublicKey = new SigningPublicKey describe("A SigningPublicKey") { diff --git a/core/java/test/scalatest/net/i2p/data/TunnelIdSpec.scala b/core/java/test/scalatest/net/i2p/data/TunnelIdSpec.scala index f7e872dd03b1d5dae236219f295b47d1c486e8b6..c150555ba2e807c72dd60fc4dbf68bc3a6f2bb93 100644 --- a/core/java/test/scalatest/net/i2p/data/TunnelIdSpec.scala +++ b/core/java/test/scalatest/net/i2p/data/TunnelIdSpec.scala @@ -1,12 +1,12 @@ package net.i2p.data import org.scalatest.FunSpec -import org.scalatest.matchers.ShouldMatchers +import org.scalatest.Matchers /** * @author str4d */ -class TunnelIdSpec extends FunSpec with ShouldMatchers { +class TunnelIdSpec extends FunSpec with Matchers { describe("A TunnelId") { it("should be a 4 byte integer") (pending) } diff --git a/core/java/test/scalatest/net/i2p/util/VersionComparatorSpec.scala b/core/java/test/scalatest/net/i2p/util/VersionComparatorSpec.scala index 8cc5de312b756fb025d739757ee5c51391d1a786..6b00c13ae66385250b258f49b7497695933f668c 100644 --- a/core/java/test/scalatest/net/i2p/util/VersionComparatorSpec.scala +++ b/core/java/test/scalatest/net/i2p/util/VersionComparatorSpec.scala @@ -1,10 +1,10 @@ package net.i2p.util import org.scalatest.FunSpec -import org.scalatest.matchers.ShouldMatchers +import org.scalatest.Matchers -class VersionComparatorSpec extends FunSpec with ShouldMatchers { +class VersionComparatorSpec extends FunSpec with Matchers { private val vc = new VersionComparator diff --git a/router/java/build.xml b/router/java/build.xml index 1f42e4cd102b2f685d34aa02c5cd9249421a731b..c9b9e6643a9971ae8a1d724988ef97c6b0ca576c 100644 --- a/router/java/build.xml +++ b/router/java/build.xml @@ -116,10 +116,13 @@ <!-- scala paths --> <target name="scala.init"> <property name="scala-library.jar" value="${scalatest.libs}/scala-library.jar" /> + <property name="scala-xml.jar" value="${scalatest.libs}/scala-xml.jar" /> + <property name="scalactic.jar" value="${scalatest.libs}/scalactic.jar" /> <property name="scalatest.jar" value="${scalatest.libs}/scalatest.jar" /> <taskdef resource="scala/tools/ant/antlib.xml"> <classpath> <pathelement location="${scalatest.libs}/scala-compiler.jar" /> + <pathelement location="${scalatest.libs}/scala-reflect.jar" /> <pathelement location="${scala-library.jar}" /> </classpath> </taskdef> @@ -140,6 +143,7 @@ <classpath> <pathelement location="${javac.classpath}" /> <pathelement location="${scala-library.jar}" /> + <pathelement location="${scalactic.jar}" /> <pathelement location="${scalatest.jar}" /> <pathelement location="../../core/java/build/i2pscalatest.jar" /> <pathelement location="./build/obj" /> @@ -222,6 +226,8 @@ <taskdef name="scalatest" classname="org.scalatest.tools.ScalaTestAntTask"> <classpath> <pathelement location="${scala-library.jar}" /> + <pathelement location="${scala-xml.jar}" /> + <pathelement location="${scalactic.jar}" /> <pathelement location="${scalatest.jar}" /> <pathelement location="./build/obj_cobertura" /> <pathelement location="./build/obj" />