esme-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vdic...@apache.org
Subject svn commit: r995525 - /incubator/esme/trunk/server/src/test/scala/org/apache/esme/api/TwitterAPITest.scala
Date Thu, 09 Sep 2010 18:08:54 GMT
Author: vdichev
Date: Thu Sep  9 18:08:54 2010
New Revision: 995525

URL: http://svn.apache.org/viewvc?rev=995525&view=rev
Log:
TwitterAPI test improvements for asynchronous events.

Modified:
    incubator/esme/trunk/server/src/test/scala/org/apache/esme/api/TwitterAPITest.scala

Modified: incubator/esme/trunk/server/src/test/scala/org/apache/esme/api/TwitterAPITest.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/test/scala/org/apache/esme/api/TwitterAPITest.scala?rev=995525&r1=995524&r2=995525&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/test/scala/org/apache/esme/api/TwitterAPITest.scala (original)
+++ incubator/esme/trunk/server/src/test/scala/org/apache/esme/api/TwitterAPITest.scala Thu
Sep  9 18:08:54 2010
@@ -35,8 +35,8 @@ import Helpers._
 import org.apache.esme._
 import model._
 import org.apache.esme.actor.Distributor
-import org.apache.esme.actor.Distributor.NewMessage
-import org.apache.esme.actor.Distributor.PublicTimelineListeners
+import org.apache.esme.actor.UserActor.MessageReceived
+import org.apache.esme.actor.Distributor.Listen
 import net.liftweb.http._
 import testing.{ReportFailure, TestKit, HttpResponse, TestFramework, TestResponse, Response}
 
@@ -100,7 +100,7 @@ object TwitterAPISpecs extends Specifica
   
   class BridgeActor(receiver: Actor) extends LiftActor {
     protected def messageHandler = {
-      case nm @ NewMessage(_) => receiver ! nm
+      case nm @ MessageReceived(_, _) => receiver ! nm
     }
   }
   
@@ -111,7 +111,7 @@ object TwitterAPISpecs extends Specifica
       react {
         case Wait => reply {
           receive {
-            case NewMessage(msg) => msg
+            case MessageReceived(msg, reason) => msg
           }
         }
       }
@@ -122,7 +122,8 @@ object TwitterAPISpecs extends Specifica
   val conductor = new ConductorActor
   conductor.start
   val liftActor = new BridgeActor(conductor)
-  Distributor ! PublicTimelineListeners(liftActor)
+  Distributor ! Listen(theUser.id.is, liftActor)
+  Distributor ! Listen(followerUser.id.is, liftActor)
   
   trait XmlResponse {
     self: TestResponse =>
@@ -205,7 +206,6 @@ object TwitterAPISpecs extends Specifica
       // or fail after 5 seconds
       val msgReceived = conductor !? (5000L, Wait)
       if (msgReceived.isEmpty) fail("no message received")
-      Thread.sleep(1000L)
       
       get("/statuses/home_timeline.xml", followerClient, Nil) \\(<text>user_msg</text>)
     }



Mime
View raw message