incubator-esme-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhir...@apache.org
Subject svn commit: r940771 - in /incubator/esme/trunk/server/src/main/scala/org/apache/esme: lib/MsgParser.scala model/Action.scala
Date Tue, 04 May 2010 08:42:31 GMT
Author: rhirsch
Date: Tue May  4 08:42:31 2010
New Revision: 940771

URL: http://svn.apache.org/viewvc?rev=940771&view=rev
Log:
[ESME-198] We need an action that tests for a specific message id

Modified:
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/MsgParser.scala
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/Action.scala

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/MsgParser.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/MsgParser.scala?rev=940771&r1=940770&r2=940771&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/MsgParser.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/MsgParser.scala Tue May
 4 08:42:31 2010
@@ -304,7 +304,7 @@ object MsgParser extends Parsers with Im
   
   lazy val testFactor: Parser[TestAction] = (notTest |
   testAt | testRegex | testString |
-  testTag | testPool |
+  testTag | testPool | testConv |
   testResent |
   testParen | testPercent |
   testDates | testLogin |
@@ -383,7 +383,12 @@ object MsgParser extends Parsers with Im
   whiteSpace ~ '(' ~ whiteSpace ~> _testExpr <~ whiteSpace ~ ')' ~ whiteSpace ^^ {
     case x => ParenAction(x)
   }
-
+  
+  lazy val testConv: Parser[TestAction] =
+  whiteSpace ~ acceptCI("conv:") ~> rep1(digit) <~ whiteSpace ^^ {
+    case id => ConvAction(id.mkString.toLong)
+  }
+  
   lazy val testPool: Parser[TestAction] =
   (whiteSpace ~ acceptCI("pool:") ~> rep1(digit) <~ whiteSpace ^^ {case id => PoolAction(id.mkString.toLong)})
|
   (poolName ^^ {

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/Action.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/Action.scala?rev=940771&r1=940770&r2=940771&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/Action.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/Action.scala Tue May
 4 08:42:31 2010
@@ -110,7 +110,10 @@ object Action extends Action with LongKe
       
     case PoolAction =>
       (m, u, c, r) => m.pool.defined_?
-    
+      
+    case ConvAction(convId) =>
+      (m, u, c, r) => m.conversation.is == convId
+          
     case ResentAction(userId) =>
       (m, u, c, r) => r match {
         case ResendReason(`userId`) => true
@@ -355,6 +358,14 @@ case class AtUserAction(userId: Long) ex
   def toStr = "@"+userId
 }
 
+case object ConvAction extends TestAction {
+  def toStr = "conv"
+}
+
+case class ConvAction(convId: Long) extends TestAction {
+  def toStr = "conv:" + convId
+}
+
 case object PoolAction extends TestAction {
   def toStr = "pool"
 }



Mime
View raw message