summaryrefslogtreecommitdiff
path: root/csharp/test/Ice/ami/AllTests.cs
diff options
context:
space:
mode:
Diffstat (limited to 'csharp/test/Ice/ami/AllTests.cs')
-rw-r--r--csharp/test/Ice/ami/AllTests.cs40
1 files changed, 6 insertions, 34 deletions
diff --git a/csharp/test/Ice/ami/AllTests.cs b/csharp/test/Ice/ami/AllTests.cs
index c6defebb78c..81629acfcf4 100644
--- a/csharp/test/Ice/ami/AllTests.cs
+++ b/csharp/test/Ice/ami/AllTests.cs
@@ -23,43 +23,15 @@ namespace Ice
{
public override void reply(Ice.Current current)
{
- lock(this)
- {
- ++_replies;
- Monitor.Pulse(this);
- }
- }
-
- public void reset()
- {
- lock(this)
- {
- _replies = 0;
- }
+ _received = true;
}
- public bool waitReply(int expectedReplies, long timeout)
+ public bool checkReceived()
{
- lock(this)
- {
- long end = IceInternal.Time.currentMonotonicTimeMillis() + timeout;
- while(_replies < expectedReplies)
- {
- int delay =(int)(end - IceInternal.Time.currentMonotonicTimeMillis());
- if(delay > 0)
- {
- Monitor.Wait(this, delay);
- }
- else
- {
- break;
- }
- }
- return _replies == expectedReplies;
- }
+ return _received;
}
- private int _replies = 0;
+ private bool _received = false;
}
private class Cookie
@@ -3854,8 +3826,8 @@ namespace Ice
adapter.activate();
p.ice_getConnection().setAdapter(adapter);
- p.pingBiDir(reply.ice_getIdentity());
- replyI.waitReply(1, 100);
+ p.pingBiDir(reply);
+ test(replyI.checkReceived());
adapter.destroy();
}
}