pangho / jconch

Automatically exported from code.google.com/p/jconch
0 stars 0 forks source link

Support asynchronous test coordination similar to how GWTTestCase does #5

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I'd like a feature for asynchronous test coordination similar to how
GWTTestCase works. 

In particular, I'd like this test case to pass: 

@Test(timeout=1000)
public void testCoordination() {

    final TestCoordinator coord = new TestCoordinator();

    MyComponent component = new MyComponent();
    component.addActionListener(new ActionListener(){
        public void actionPerformed(ActionEvent e) {
            Assert.assertNotNull(e.getSource());
            Assert.assertEquals("click", e.getActionCommand());
            coord.finishTest();
        }
    });

    component.click();
    coord.delayTestFinish();

    component.click();
    coord.delayTestFinish(1000);

    component.click();
    coord.delayTestFinish(1, TimeUnit.SECONDS);
}

I have a patch for your review. 

Original issue reported on code.google.com by HamletDRC on 14 Dec 2009 at 8:08

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Here is a patch with passing unit tests and passing example. 

Original comment by HamletDRC on 15 Dec 2009 at 1:30

Attachments:

GoogleCodeExporter commented 9 years ago
marked fixed. maybe someone else should run example to double check? 

Original comment by HamletDRC on 18 Dec 2009 at 7:42