I add some lock logic for two feeds. I implement it fit the Reentrant lock and crating some guard.
So it means that one feed can run trough another logic but if theres a seconde one it have to wait.
Everything works i also checked in on the UI if the second feed is waiting and it was ok.
But now i have to write a JUnit test for that. So we disscused how it should been done at we came to the solution that wwe should use the Semaphore class. So i read the API and try to understand. i think i have to use the aquire() and the release() Methods.
Do ever worked with that and give me some example to test a case like this?
Thanks in advance.
Aucun commentaire:
Enregistrer un commentaire