Thanks--
/lim/
-- Rules --
1) Please prefix the subject with [Ruby], [JVM] or [JS].
2) Please use interleaved answers http://en.wikipedia.org/wiki/Posting_style#Interleaved_style
3) If you have a question, don't reply to an existing message. Start a new topic instead.
You received this message because you are subscribed to the Google Groups Cukes group. To post to this group, send email to cu...@googlegroups.com. To unsubscribe from this group, send email to cukes+un...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/cukes?hl=en
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Not good. It worked some of time when I ran the test for a few times. I presume get() waits for the Future to complete before it returns the control to the caller to continue.
On Tuesday, December 10, 2013 6:36:39 PM UTC+8, Teck Hooi Lim wrote:Hi,
I failed to get this example to pass the test and the result was,
org.junit.ComparisonFailure:
Expected :212.0
Actual :
<Click to see difference>
at org.junit.Assert.assertEquals(Assert.java:115)
at org.junit.Assert.assertEquals(Assert.java:144)
at cucumber.examples.java.websockets.TemperatureStepdefs.i_should_see_temperature(TemperatureStepdefs.java:24)
at ✽.Then I should see 212.0 fahrenheit(cucumber/examples/java/websockets/temperature_conversion.feature:11)
org.junit.ComparisonFailure:
Expected :37.8
Actual :
It seemed to me that the tests were executed beforeTemperatureServer was ready to accept inputs. Hence, I added an arbitrary delay to TemperatureServer.start(),
public void start() throws IOException, ExecutionException, InterruptedException {
webServer.start();
Thread.sleep(1000); // arbitrary delay to let the Webbit complete its "startup sequence"
}
and it worked. My question is how do I get cucumber-jvm to wait until Webbit is ready to accept request from the browser instead of a random delay? I am using Linux with JDK 1.7. Please advise.
Thanks
/lim/