I created an issue and attached a patch. In general, I'd like a test
case like this to pass:
import jconch.testing.TestCoordinator
TestCoordinator coord = new TestCoordinator()
MyComponent component = new MyComponent()
component.addActionListener({ ActionEvent e ->
assert e.source != null
assert "click" == e.actionCommand
coord.finishTest()
} as ActionListener)
component.click()
coord.delayTestFinish()
component.click()
coord.delayTestFinish(1000)
component.click()
coord.delayTestFinish(1, TimeUnit.SECONDS)
The TestCoordinator is a replacement for manually managing
CountDownLatch objects to perform this type of behavior. (or even
wait/join). Also, it is reusable/resettable which CountDownLatch is
not.
I use something similar at work and like it. I saw that GWT has
something similar, so I copied the GWT API and rewrote it for JConch.
What are your thoughts?
--
Hamlet D'Arcy
haml...@gmail.com