50onRed / mock-jedis

Mock Jedis is a library for mocking out Jedis clients
MIT License
82 stars 47 forks source link

Add rpush and rpop commands #39

Open notak opened 8 years ago

notak commented 8 years ago

Didn't notice the PR from last year to do the same thing. I think from testing that this one implements the correct ordering on pushing multiple elements.

PC-AKumar commented 8 years ago

I believe this won't work as expected. The current lpush adds to the end of the list and lpop removes from the end of the list. To make the rpush and rpop work a) modifications will have to be made to the lpush and lpop methods to add to the start of the list and remove from the start of the list. b) rpush should add to the end of the list and remove should get an index of list.size() - 1

notak commented 8 years ago

It would be sensible to do that if you wanted to implement lrange. As it is this works just fine for lpush/lpop/rpush/rpop and I was just aiming for a minimal change set. The project seems to be dead anyway

PC-AKumar commented 8 years ago

lrange is already implemented in the library, its just not mentioned in the documentation. And yeah, this project is dead, I wonder why... I am sure people still need to mock jedis for their testing.

xuanyue202 commented 8 years ago

I forked a repo and maintain it on the maven central for the rpush/rpop features. Please see https://github.com/xuanyue202/mock-jedis

cdx-nebiyu commented 7 years ago

Thanks @xuanyue202 for resurrecting the project. Curious if you plan on actively maintaining your fork going forward?