@Ethan - thanks -  why was the test was failing?

D.

On Sat, Feb 5, 2011 at 3:00 PM,  <[email protected]> wrote:
> Author: esjewett
> Date: Sat Feb  5 14:00:20 2011
> New Revision: 1067442
>
> URL: http://svn.apache.org/viewvc?rev=1067442&view=rev
> Log:
> [ESME-330] This fixes the problem with the test that was no longer working 
> correctly.
>
> Modified:
>    esme/trunk/server/src/test/scala/org/apache/esme/api/API2Test.scala
>
> Modified: esme/trunk/server/src/test/scala/org/apache/esme/api/API2Test.scala
> URL: 
> http://svn.apache.org/viewvc/esme/trunk/server/src/test/scala/org/apache/esme/api/API2Test.scala?rev=1067442&r1=1067441&r2=1067442&view=diff
> ==============================================================================
> --- esme/trunk/server/src/test/scala/org/apache/esme/api/API2Test.scala 
> (original)
> +++ esme/trunk/server/src/test/scala/org/apache/esme/api/API2Test.scala Sat 
> Feb  5 14:00:20 2011
> @@ -30,7 +30,8 @@ import Helpers._
>  import org.apache.esme._
>  import model._
>  import net.liftweb.http._
> -import testing.{ReportFailure, TestKit, HttpResponse, TestFramework, 
> TestResponse}
> +import testing.{ReportFailure, TestKit, HttpResponse, TestFramework, 
> TestResponse}
> +import scala.xml.{Text}
>
>  import _root_.junit.framework.AssertionFailedError
>
> @@ -592,18 +593,20 @@ object Api2Specs extends Specification w
>         for{
>           sess <- post_session
>           mess_res <- sess.post("user/messages", "message"->"test")
> +          mess_xml <- mess_res.xml
>           wait <- sleep(1000)
> -          mess_res <- sess.post("user/messages",
> +          mess_res2 <- sess.post("user/messages",
>                                 "message" -> "test_convo",
> -                                "replyto" -> 9)
> +                                "replyto" -> (mess_xml \\ "message" \ 
> "id").text)
>           wait2 <- sleep(1000)
> -          res <- sess.get("conversations/9")
> -        } {
> -          res.code must be equalTo 200
> -          ( res.xml.open_! \\ "message" ).last must 
> \\(<conversation>9</conversation>)
> -          ( res.xml.open_! \\ "message" ).last must \\(<replyto>9</replyto>)
> -          ( res.xml.open_! \\ "message" ).first must 
> \\(<conversation>9</conversation>)
> -          ( res.xml.open_! \\ "message" ).first must \\(<replyto></replyto>)
> +          res <- sess.get("/conversations/" + (mess_xml \\ "message" \ 
> "id").text)
> +        } {
> +          val conv_id = (mess_xml \\ "message" \ "id").text
> +          res.code must be equalTo 200
> +          ( res.xml.openOr(Text("")) \\ "message" ).last must 
> \\(<conversation>{conv_id}</conversation>)
> +          ( res.xml.openOr(Text("")) \\ "message" ).last must 
> \\(<replyto>{conv_id}</replyto>)
> +          ( res.xml.openOr(Text("")) \\ "message" ).first must 
> \\(<conversation>{conv_id}</conversation>)
> +          ( res.xml.openOr(Text("")) \\ "message" ).first must 
> \\(<replyto></replyto>)
>         }
>       }
>
>
>
>

Reply via email to