Changeset 91007735


Ignore:
Timestamp:
Dec 29, 2016 6:54:23 PM (4 years ago)
Author:
str4d <str4d@…>
Branches:
master
Children:
134cbd4
Parents:
14ca463
Message:

Update tests to use ScalaTest? 3.0.1

Files:
15 edited

Legend:

Unmodified
Added
Removed
  • apps/routerconsole/java/build.xml

    r14ca463 r91007735  
    456456    <target name="scala.init">
    457457        <property name="scala-library.jar" value="${scalatest.libs}/scala-library.jar" />
     458        <property name="scala-xml.jar" value="${scalatest.libs}/scala-xml.jar" />
     459        <property name="scalactic.jar" value="${scalatest.libs}/scalactic.jar" />
    458460        <property name="scalatest.jar" value="${scalatest.libs}/scalatest.jar" />
     461        <property name="mockito.home" value="${ant.home}/lib" />
    459462        <taskdef resource="scala/tools/ant/antlib.xml">
    460463            <classpath>
    461464                <pathelement location="${scalatest.libs}/scala-compiler.jar" />
     465                <pathelement location="${scalatest.libs}/scala-reflect.jar" />
    462466                <pathelement location="${scala-library.jar}" />
    463467            </classpath>
     
    476480            <classpath>
    477481                <pathelement location="${scala-library.jar}" />
     482                <pathelement location="${scalactic.jar}" />
    478483                <pathelement location="${scalatest.jar}" />
    479                 <pathelement location="${scalatest.libs}/mockito-all.jar" />
     484                <pathelement location="${mockito.home}/byte-buddy.jar" />
     485                <pathelement location="${mockito.home}/objenesis.jar" />
     486                <pathelement location="${mockito.home}/mockito-core.jar" />
    480487                <pathelement location="../../../core/java/build/i2pscalatest.jar" />
    481488                <pathelement location="../../../router/java/build/routerscalatest.jar" />
     
    514521                <pathelement location="${classpath}" />
    515522                <pathelement location="${scala-library.jar}" />
     523                <pathelement location="${scala-xml.jar}" />
     524                <pathelement location="${scalactic.jar}" />
    516525                <pathelement location="${scalatest.jar}" />
    517526                <pathelement location="./build/obj_cobertura" />
  • apps/routerconsole/java/test/scalatest/net/i2p/router/update/ConsoleUpdateManagerSpec.scala

    r14ca463 r91007735  
    44import org.scalatest.mock.MockitoSugar
    55
     6import net.i2p.app.ClientAppManager;
    67import net.i2p.router.RouterContext
    78
     
    1213    def consoleUpdateManager = {
    1314        val mockCtx = mock[RouterContext]
    14         val cum = new ConsoleUpdateManager(mockCtx)
     15        val mockMgr = mock[ClientAppManager]
     16        val cum = new ConsoleUpdateManager(mockCtx, mockMgr, null)
    1517        cum
    1618    }
  • build.properties

    r14ca463 r91007735  
    9191# Define this in override.properties or pass in on the command line.
    9292# The directory must contain the following library names:
    93 # mockito-all.jar
    9493# scala-compiler.jar
    9594# scala-library.jar
     95# scala-reflect.jar
     96# scala-xml.jar
     97# scalactic.jar
    9698# scalatest.jar
     99# Tested using Scala 2.12.1, scala-xml 1.0.6, and ScalaTest 3.0.1
    97100#scalatest.libs=/PATH/TO/SCALATEST/lib
    98101
     
    106109# If set, this must point to a directory containing the files
    107110#       hamcrest-core.jar, hamcrest-library.jar, and hamcrest-integration.jar
     111# Tested using Hamcrest 1.3
    108112#hamcrest.home=
    109113
     
    112116# If set, this must point to a directory containing the files
    113117#       mockito-core.jar, byte-buddy.jar, objenesis.jar
     118# Tested using Mockito 2.5.0 which requires byte-buddy 1.5.12 and objenesis 2.4
    114119#mockito.home=
    115120
  • core/java/build.xml

    r14ca463 r91007735  
    142142    <target name="scala.init">
    143143        <property name="scala-library.jar" value="${scalatest.libs}/scala-library.jar" />
     144        <property name="scala-xml.jar" value="${scalatest.libs}/scala-xml.jar" />
     145        <property name="scalactic.jar" value="${scalatest.libs}/scalactic.jar" />
    144146        <property name="scalatest.jar" value="${scalatest.libs}/scalatest.jar" />
    145147        <taskdef resource="scala/tools/ant/antlib.xml">
    146148            <classpath>
    147149                <pathelement location="${scalatest.libs}/scala-compiler.jar" />
     150                <pathelement location="${scalatest.libs}/scala-reflect.jar" />
    148151                <pathelement location="${scala-library.jar}" />
    149152            </classpath>
     
    159162                <pathelement location="${javac.classpath.mod}" />
    160163                <pathelement location="${scala-library.jar}" />
     164                <pathelement location="${scalactic.jar}" />
    161165                <pathelement location="${scalatest.jar}" />
    162166                <pathelement location="./build/obj" />
     
    265269            <classpath>
    266270                <pathelement location="${scala-library.jar}" />
     271                <pathelement location="${scala-xml.jar}" />
     272                <pathelement location="${scalactic.jar}" />
    267273                <pathelement location="${scalatest.jar}" />
    268274                <pathelement location="./build/obj_cobertura" />
  • core/java/test/scalatest/net/i2p/data/HashSpec.scala

    r14ca463 r91007735  
    22
    33import org.scalatest.FunSpec
    4 import org.scalatest.matchers.ShouldMatchers
     4import org.scalatest.Matchers
    55
    66/**
    77 * @author str4d
    88 */
    9 class HashSpec extends FunSpec with ShouldMatchers {
     9class HashSpec extends FunSpec with Matchers {
    1010    val hash = new Hash
    1111
  • core/java/test/scalatest/net/i2p/data/PrivateKeySpec.scala

    r14ca463 r91007735  
    22
    33import org.scalatest.FunSpec
    4 import org.scalatest.matchers.ShouldMatchers
     4import org.scalatest.Matchers
    55
    66/**
    77 * @author str4d
    88 */
    9 class PrivateKeySpec extends FunSpec with ShouldMatchers {
     9class PrivateKeySpec extends FunSpec with Matchers {
    1010    val privateKey = new PrivateKey
    1111
  • core/java/test/scalatest/net/i2p/data/PublicKeySpec.scala

    r14ca463 r91007735  
    22
    33import org.scalatest.FunSpec
    4 import org.scalatest.matchers.ShouldMatchers
     4import org.scalatest.Matchers
    55
    66/**
    77 * @author str4d
    88 */
    9 class PublicKeySpec extends FunSpec with ShouldMatchers {
     9class PublicKeySpec extends FunSpec with Matchers {
    1010    val publicKey = new PublicKey
    1111
  • core/java/test/scalatest/net/i2p/data/SessionKeySpec.scala

    r14ca463 r91007735  
    22
    33import org.scalatest.FunSpec
    4 import org.scalatest.matchers.ShouldMatchers
     4import org.scalatest.Matchers
    55
    66/**
    77 * @author str4d
    88 */
    9 class SessionKeySpec extends FunSpec with ShouldMatchers {
     9class SessionKeySpec extends FunSpec with Matchers {
    1010    val sessionKey = new SessionKey
    1111
  • core/java/test/scalatest/net/i2p/data/SessionTagSpec.scala

    r14ca463 r91007735  
    22
    33import org.scalatest.FunSpec
    4 import org.scalatest.matchers.ShouldMatchers
     4import org.scalatest.Matchers
    55
    66/**
    77 * @author str4d
    88 */
    9 class SessionTagSpec extends FunSpec with ShouldMatchers {
     9class SessionTagSpec extends FunSpec with Matchers {
    1010    val sessionTag = new SessionTag
    1111
  • core/java/test/scalatest/net/i2p/data/SignatureSpec.scala

    r14ca463 r91007735  
    22
    33import org.scalatest.FunSpec
    4 import org.scalatest.matchers.ShouldMatchers
     4import org.scalatest.Matchers
    55
    66/**
    77 * @author str4d
    88 */
    9 class SignatureSpec extends FunSpec with ShouldMatchers {
     9class SignatureSpec extends FunSpec with Matchers {
    1010    val signature = new Signature
    1111
  • core/java/test/scalatest/net/i2p/data/SigningPrivateKeySpec.scala

    r14ca463 r91007735  
    22
    33import org.scalatest.FunSpec
    4 import org.scalatest.matchers.ShouldMatchers
     4import org.scalatest.Matchers
    55
    66/**
    77 * @author str4d
    88 */
    9 class SigningPrivateKeySpec extends FunSpec with ShouldMatchers {
     9class SigningPrivateKeySpec extends FunSpec with Matchers {
    1010    val signingPrivateKey = new SigningPrivateKey
    1111
  • core/java/test/scalatest/net/i2p/data/SigningPublicKeySpec.scala

    r14ca463 r91007735  
    22
    33import org.scalatest.FunSpec
    4 import org.scalatest.matchers.ShouldMatchers
     4import org.scalatest.Matchers
    55
    66/**
    77 * @author str4d
    88 */
    9 class SigningPublicKeySpec extends FunSpec with ShouldMatchers {
     9class SigningPublicKeySpec extends FunSpec with Matchers {
    1010    val signingPublicKey = new SigningPublicKey
    1111
  • core/java/test/scalatest/net/i2p/data/TunnelIdSpec.scala

    r14ca463 r91007735  
    22
    33import org.scalatest.FunSpec
    4 import org.scalatest.matchers.ShouldMatchers
     4import org.scalatest.Matchers
    55
    66/**
    77 * @author str4d
    88 */
    9 class TunnelIdSpec extends FunSpec with ShouldMatchers {
     9class TunnelIdSpec extends FunSpec with Matchers {
    1010    describe("A TunnelId") {
    1111        it("should be a 4 byte integer") (pending)
  • core/java/test/scalatest/net/i2p/util/VersionComparatorSpec.scala

    r14ca463 r91007735  
    22
    33import org.scalatest.FunSpec
    4 import org.scalatest.matchers.ShouldMatchers
     4import org.scalatest.Matchers
    55
    66
    7 class VersionComparatorSpec extends FunSpec with ShouldMatchers {
     7class VersionComparatorSpec extends FunSpec with Matchers {
    88 
    99    private val vc = new VersionComparator
  • router/java/build.xml

    r14ca463 r91007735  
    117117    <target name="scala.init">
    118118        <property name="scala-library.jar" value="${scalatest.libs}/scala-library.jar" />
     119        <property name="scala-xml.jar" value="${scalatest.libs}/scala-xml.jar" />
     120        <property name="scalactic.jar" value="${scalatest.libs}/scalactic.jar" />
    119121        <property name="scalatest.jar" value="${scalatest.libs}/scalatest.jar" />
    120122        <taskdef resource="scala/tools/ant/antlib.xml">
    121123            <classpath>
    122124                <pathelement location="${scalatest.libs}/scala-compiler.jar" />
     125                <pathelement location="${scalatest.libs}/scala-reflect.jar" />
    123126                <pathelement location="${scala-library.jar}" />
    124127            </classpath>
     
    141144                <pathelement location="${javac.classpath}" />
    142145                <pathelement location="${scala-library.jar}" />
     146                <pathelement location="${scalactic.jar}" />
    143147                <pathelement location="${scalatest.jar}" />
    144148                <pathelement location="../../core/java/build/i2pscalatest.jar" />
     
    223227            <classpath>
    224228                <pathelement location="${scala-library.jar}" />
     229                <pathelement location="${scala-xml.jar}" />
     230                <pathelement location="${scalactic.jar}" />
    225231                <pathelement location="${scalatest.jar}" />
    226232                <pathelement location="./build/obj_cobertura" />
Note: See TracChangeset for help on using the changeset viewer.