Merge remote branch 'upstream/master'

This commit is contained in:
David Greco 2010-09-16 13:13:08 +02:00
commit d750aa3cf8
16 changed files with 51 additions and 55 deletions

View file

@ -0,0 +1,49 @@
package se.scalablesolutions.akka.actor.serialization
import org.scalatest.Spec
import org.scalatest.matchers.ShouldMatchers
import org.scalatest.BeforeAndAfterAll
import org.scalatest.junit.JUnitRunner
import org.junit.runner.RunWith
import se.scalablesolutions.akka.serialization.Serializer
import se.scalablesolutions.akka.serialization.Serializable.ScalaJSON
import scala.reflect._
import scala.annotation.target._
import sjson.json.JSONTypeHint
@BeanInfo class MyJsonObject(val key: String,
@(JSONTypeHint @field)(value = classOf[Int])
val map: Map[String, Int],
val standAloneInt: Int) extends ScalaJSON {
private def this() = this(null, null, -1)
override def toString(): String = try {
val mapValue: Int = map.getOrElse(key, -1)
println("Map value: %s".format(mapValue.asInstanceOf[AnyRef].getClass))
"Key: %s, Map value: %d, Stand Alone Int: %d".format(key, mapValue, standAloneInt)
} catch {
case e: ClassCastException => e.getMessage
case _ => "Unknown error"
}
}
@RunWith(classOf[JUnitRunner])
class Ticket436Spec extends
Spec with
ShouldMatchers with
BeforeAndAfterAll {
describe("Serialization of Maps containing Int") {
it("should be able to serialize and de-serialize preserving the data types of the Map") {
val key: String = "myKey"
val value: Int = 123
val standAloneInt: Int = 35
val message = new MyJsonObject(key, Map(key -> value), standAloneInt)
val json = message.toJSON
val copy = Serializer.ScalaJSON.fromJSON[MyJsonObject](json)
copy.asInstanceOf[MyJsonObject].map.get("myKey").get.isInstanceOf[Int] should equal(true)
}
}
}

View file

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>sjson.json</groupId>
<artifactId>sjson</artifactId>
<version>0.5-SNAPSHOT-2.8.Beta1</version>
<packaging>jar</packaging>
</project>

View file

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>sjson.json</groupId>
<artifactId>sjson</artifactId>
<version>0.5-SNAPSHOT-2.8.RC2</version>
<description>POM was created from install:install-file</description>
</project>

View file

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>sjson.json</groupId>
<artifactId>sjson</artifactId>
<version>0.6-SNAPSHOT-2.8.RC3</version>
<description>POM was created from install:install-file</description>
</project>

View file

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>sjson.json</groupId>
<artifactId>sjson</artifactId>
<version>0.7-2.8.0</version>
<description>POM was created from install:install-file</description>
</project>

View file

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>sjson.json</groupId>
<artifactId>sjson</artifactId>
<version>0.7-SNAPSHOT-2.8.0</version>
<description>POM was created from install:install-file</description>
</project>

View file

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>sjson.json</groupId>
<artifactId>sjson</artifactId>
<version>0.7-SNAPSHOT-2.8.RC7</version>
<description>POM was created from install:install-file</description>
</project>

View file

@ -3,6 +3,6 @@
<modelVersion>4.0.0</modelVersion>
<groupId>sjson.json</groupId>
<artifactId>sjson</artifactId>
<version>0.4</version>
<version>0.8-2.8.0</version>
<packaging>jar</packaging>
</project>

View file

@ -190,7 +190,7 @@ class AkkaParentProject(info: ProjectInfo) extends DefaultProject(info) {
lazy val sbinary = "sbinary" % "sbinary" % "2.8.0-0.3.1" % "compile"
lazy val sjson = "sjson.json" % "sjson" % "0.8-SNAPSHOT-2.8.0" % "compile"
lazy val sjson = "sjson.json" % "sjson" % "0.8-2.8.0" % "compile"
lazy val slf4j = "org.slf4j" % "slf4j-api" % SLF4J_VERSION % "compile"