Implement array message pack

This commit is contained in:
takeshita 2011-04-20 20:35:23 +09:00
parent 743d69ec0b
commit ed3ead06fe
3 changed files with 5 additions and 3 deletions

View File

@ -541,8 +541,8 @@ class ScalaFieldEntry(name : String) extends IFieldEntry{
def getJavaTypeName = {
if(getType.isArray){
//TODO implement here
getType.getName()
getType.getComponentType.getName + "[]"
}else{
getType.getName()
}

View File

@ -72,7 +72,7 @@ class BasicalTypes{
var dateVar : Date = null
var intArray : Array[Int] = Array()
}

View File

@ -51,6 +51,7 @@ class ScalaMessagePackTest extends Specification with JUnit /*with ScalaCheck*/
v.doubleVar = 2.5
v.strVar = "fugafuga"
v.dateVar = new Date(1233333)
v.intArray = Array(1,2,3,4,5)
val b = ScalaMessagePack.pack(v)
val des : BasicalTypes = ScalaMessagePack.unpack[BasicalTypes](b)
@ -63,6 +64,7 @@ class ScalaMessagePackTest extends Specification with JUnit /*with ScalaCheck*/
des.doubleVar must be_==(v.doubleVar)
des.strVar must be_==(v.strVar)
des.dateVar must be_==(v.dateVar)
des.intArray must containAll(v.intArray)
}