File tree Expand file tree Collapse file tree
main/java/org/msgpack/core Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ package org .msgpack .core ;
2+
3+ /**
4+ * Created by leo on 2014/02/24.
5+ */
6+ public class MessagePack {
7+ static byte [] pack (Object obj ) {
8+ // TODO
9+ return null ;
10+ }
11+
12+ static <E > E unpack (byte [] msg ) {
13+ // TODO
14+ return null ;
15+ }
16+
17+
18+
19+
20+ }
Original file line number Diff line number Diff line change 22
33import org .msgpack .annotation .Message ;
44
5- @ Message
65public class Person {
76 public int id ;
87 public String name ;
Original file line number Diff line number Diff line change 11package org .msgpack .core
22import org .scalatest .prop .PropertyChecks ._
3- import org .msgpack .MessagePack
43import org .msgpack .annotation .Message
54
65
@@ -17,25 +16,26 @@ class MessagePackerTest extends MessagePackSpec {
1716 " MessagePacker" should {
1817
1918 " serialize primitives" in {
20- pending
21- val p = new MessagePacker (null )
2219
2320 forAll{ (i: Int ) =>
24-
21+ val msg = MessagePack .pack(i)
22+ val v = MessagePack .unpack[Int ](msg)
23+ v shouldBe i
2524 }
2625
2726
2827 }
2928
3029 " be used with 0.6.x" in {
3130 val p = new Person (1 , " leo" )
32- val v6 = new MessagePack ()
31+ val v6 = new org.msgpack. MessagePack ()
3332 v6.setClassLoader(classOf [Message ].getClassLoader())
3433
35- // v6.register(classOf[Person])
34+ v6.register(classOf [Person ])
3635 val packed = v6.write(p)
3736
3837
38+
3939 }
4040
4141 }
You can’t perform that action at this time.
0 commit comments