updated test case to ensure that sorted sets have diff scores
This commit is contained in:
parent
6c200163cf
commit
378deb72b0
1 changed files with 5 additions and 4 deletions
|
|
@ -17,12 +17,12 @@ import Actor._
|
|||
* @author <a href="http://debasishg.blogspot.com">Debasish Ghosh</a>
|
||||
*/
|
||||
|
||||
case class Add(email: String, value: String)
|
||||
case class AddEmail(email: String, value: String)
|
||||
case class GetAll(email: String)
|
||||
|
||||
class MySortedSet extends Transactor {
|
||||
def receive = {
|
||||
case Add(userEmail, value) => {
|
||||
case AddEmail(userEmail, value) => {
|
||||
val registryId = "userValues:%s".format(userEmail)
|
||||
val storageSet = RedisStorage.getSortedSet(registryId)
|
||||
storageSet.add(value.getBytes, System.nanoTime.toFloat)
|
||||
|
|
@ -58,8 +58,9 @@ class RedisTicket513Spec extends
|
|||
val a = actorOf[MySortedSet]
|
||||
a.start
|
||||
it("should work with transactors") {
|
||||
(a !! Add("test.user@gmail.com", "foo")).get should equal(1)
|
||||
(a !! Add("test.user@gmail.com", "bar")).get should equal(2)
|
||||
(a !! AddEmail("test.user@gmail.com", "foo")).get should equal(1)
|
||||
Thread.sleep(10)
|
||||
(a !! AddEmail("test.user@gmail.com", "bar")).get should equal(2)
|
||||
(a !! GetAll("test.user@gmail.com")).get.asInstanceOf[List[_]].size should equal(2)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue