On Tue, Jun 12, 2012 at 2:43 PM, etorreborre <
etorr...@gmail.com> wrote:
> This issue should be fixed now with the latest 1.12-SNAPSHOT.
Thanks, but I still can't get the correct values. Just tried with a
little more systematic approach:
@RunWith(classOf[JUnitRunner])
class SerializersSpec extends mutable.Specification {
args(sequential=true)
val s = CaseObjectSerializer[MyTrait] {
case "O1" => O1
case "O2" => O2
}
"CaseObjectSerializer" should {
"correctly write/read case class containing case objects" in {
implicit val formats = Serialization.formats(NoTypeHints) + s
val orig = C(42, O1)
val written = Serialization.write(orig)
val read = Serialization.read[C](written)
read must_== orig
}
"wait 3 secs" in {
Thread.sleep(3000)
1 must_== 1
}
"wait 6 secs" in {
Thread.sleep(6000)
1 must_== 1
}
}
}
Running this as a JUnit test in Eclipse gives the following timings:
Total 8.979s
correctly write....: 2.97s
wait 3s: 6.001s
wait 6s: 0.003s
The generated xml contains this:
?xml version="1.0" encoding="UTF-8"?>
<testsuite errors="0" failures="0" hostname="jnmmbp.local"
name="fleetzone.unittest.SerializersSpec" tests="6" time="0.096"
timestamp="2012-06-12T16:19:49">
<properties />
<ignored-testcase classname="fleetzone.unittest.SerializersSpec"
name="CaseObjectSerializer should::correctly write/read case class
containing case objects" time="0.0" />
<testcase classname="fleetzone.unittest.SerializersSpec"
name="CaseObjectSerializer should::correctly write/read case class
containing case objects" time="0.0080" />
<ignored-testcase classname="fleetzone.unittest.SerializersSpec"
name="CaseObjectSerializer should::wait 3 secs" time="0.0" />
<testcase classname="fleetzone.unittest.SerializersSpec"
name="CaseObjectSerializer should::wait 3 secs" time="0.0" />
<ignored-testcase classname="fleetzone.unittest.SerializersSpec"
name="CaseObjectSerializer should::wait 6 secs" time="0.0" />
<testcase classname="fleetzone.unittest.SerializersSpec"
name="CaseObjectSerializer should::wait 6 secs" time="0.0" />
<system-out><![CDATA[]]></system-out>
<system-err><![CDATA[]]></system-err>
</testsuite>
Note both the timings and the number of tests reported...
/Jeppe