summaryrefslogtreecommitdiff
path: root/csharp/test/Ice/interceptor/InterceptorI.cs
diff options
context:
space:
mode:
Diffstat (limited to 'csharp/test/Ice/interceptor/InterceptorI.cs')
-rw-r--r--csharp/test/Ice/interceptor/InterceptorI.cs44
1 files changed, 44 insertions, 0 deletions
diff --git a/csharp/test/Ice/interceptor/InterceptorI.cs b/csharp/test/Ice/interceptor/InterceptorI.cs
index 19d33bbbb58..c3f88efd13a 100644
--- a/csharp/test/Ice/interceptor/InterceptorI.cs
+++ b/csharp/test/Ice/interceptor/InterceptorI.cs
@@ -29,6 +29,24 @@ namespace Ice
dispatch(Ice.Request request)
{
Ice.Current current = request.getCurrent();
+
+ string context;
+ if(current.ctx.TryGetValue("raiseBeforeDispatch", out context))
+ {
+ if(context.Equals("user"))
+ {
+ throw new Test.InvalidInputException();
+ }
+ else if(context.Equals("notExist"))
+ {
+ throw new Ice.ObjectNotExistException();
+ }
+ else if(context.Equals("system"))
+ {
+ throw new MySystemException();
+ }
+ }
+
lastOperation_ = current.operation;
if(lastOperation_.Equals("addWithRetry") || lastOperation_.Equals("amdAddWithRetry"))
@@ -57,9 +75,35 @@ namespace Ice
current.ctx["retry"] = "no";
}
+ else if(current.ctx.TryGetValue("retry", out context) && context.Equals("yes"))
+ {
+ //
+ // Retry the dispatch to ensure that abandoning the result of the dispatch
+ // works fine and is thread-safe
+ //
+ servant_.ice_dispatch(request);
+ servant_.ice_dispatch(request);
+ }
var task = servant_.ice_dispatch(request);
lastStatus_ = task != null;
+
+ if(current.ctx.TryGetValue("raiseAfterDispatch", out context))
+ {
+ if(context.Equals("user"))
+ {
+ throw new Test.InvalidInputException();
+ }
+ else if(context.Equals("notExist"))
+ {
+ throw new Ice.ObjectNotExistException();
+ }
+ else if(context.Equals("system"))
+ {
+ throw new MySystemException();
+ }
+ }
+
return task;
}