merged from trunk

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/branches/common/common-clients/2.0@74513 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
fabio.simeoni 2013-05-03 22:05:18 +00:00
parent 48e934b2c5
commit e58ebe247e
1 changed files with 2 additions and 5 deletions

View File

@ -172,13 +172,10 @@ public class AsyncDelegateTest {
@Test @Test
public void callbacksGetResults() throws Exception { public void callbacksGetResults() throws Exception {
final CountDownLatch latch = new CountDownLatch(1);
//stage call //stage call
Answer<?> answer = new Answer<Object>() { Answer<?> answer = new Answer<Object>() {
@Override @Override
public Object answer(InvocationOnMock invocation) throws Throwable { public Object answer(InvocationOnMock invocation) throws Throwable {
latch.countDown();
return value; return value;
} }
}; };
@ -190,8 +187,8 @@ public class AsyncDelegateTest {
Future<?> future = delegate.makeAsync(call,callback); Future<?> future = delegate.makeAsync(call,callback);
//make sure we test after call has been delivered //make sure the callback has had time to arrive
latch.await(5, SECONDS); Thread.sleep(400);
verify(callback).done(value); verify(callback).done(value);