Guest User

Untitled

a guest
Apr 20th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. import org.objenesis.strategy.StdInstantiatorStrategy
  2. import org.scalatest.{FlatSpecLike, Matchers}
  3.  
  4. class MyTest extends FlatSpecLike with Matchers {
  5. "the test" should "hasKnownProfiles" in {
  6. import com.twitter.chill.{KryoInstantiator, KryoPool}
  7.  
  8. val POOL_SIZE = 10
  9. val instantiator: KryoInstantiator = new KryoInstantiator()
  10. .setInstantiatorStrategy(new StdInstantiatorStrategy)
  11.  
  12. val kryo = KryoPool.withByteArrayOutputStream(POOL_SIZE, instantiator)
  13.  
  14. val scalaMap = Map("Hello" -> Seq(Map("toto" -> "caca")))
  15.  
  16. val ser = kryo.toBytesWithClass(scalaMap)
  17. val der = kryo.fromBytes(ser)
  18.  
  19. der shouldEqual (scalaMap)
  20. }
  21. }
Add Comment
Please, Sign In to add comment