'프로그래밍/Scala-Akka'에 해당되는 글 1건

336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

Akka 코딩 공작소 예제중에

 

ScalaTest 3.2.0 과는 다른 부분이 있어 기록해둠.

 

원래 코드는 아래와 같다.

import org.scalatest.{WordSpecLike, MustMatchers}
import akka.testkit.TestKit
import akka.actor._

//This test is ignored in the BookBuild, it's added to the defaultExcludedNames

class SilentActor01Test extends TestKit(ActorSystem("testsystem"))
  with WordSpecLike
  with MustMatchers
  with StopSystemAfterAll {
  // Commented to make the travis build pass, this is the original test in the book
  "A Silent Actor" must {
    "change state when it receives a message, single threaded" in {
      //Write the test, first fail
      fail("not implemented yet")
    }
    
    "change state when it receives a message, multi-threaded" in {
      //Write the test, first fail
      fail("not implemented yet")
    }
  }
}

 

ScalaTest 3.2.0 에서는 객체들 이름이 변경되었다, 자세한 내용은 아래 링크를 참고바란다.

 

www.scalatest.org/release_notes/3.2.0

 

ScalaTest

ScalaTest/Scalactic 3.2.0 Release Notes ScalaTest/Scalactic 3.2.0 (for Scala 2.10, 2.11, 2.12, and 2.13; on the JVM, JavaScript, native, and Dotty) includes the enhancements and bug fixes listed below. No source code using ScalaTest/Scalactic 3.1.2 should

www.scalatest.org

예제 코드의 변경사항만 적어보자면,

 

WordSpecLike -> AnyWordSpecLike 로 변경 (org.scalatest.wordspec.AnyWordSpecLike 패키지 사용)

MustMatchers -> Matchers 로 변경 (org.scalatest.matchers.must.Matchers 패키지 사용)

 

두가지다, 이부분을 적용해보면,

 

class SilentActor01Test extends TestKit(ActorSystem("testsystem"))
  with AnyWordSpecLike /*scalatest 3.2.0 에서 변경*/
  with Matchers /*scalatest 3.2.0 에서 변경*/
  with StopSystemAfterAll {

  "A Silent Actor" must {

    "change state when it receives a message, single threaded " in {
      //Write the test, first fail
      fail("not implemented yet")
    }

    "change state when it receives a message, multi-threaded" in {
      //Write the test, first fail
      fail("not implemented yet")
    }
  }
}

이렇게 된다. 빌드도 정상적으로 된다.

 

참고들 하시길.

블로그 이미지

캡틴토마스

그저 걷고 있는거지...

,