summaryrefslogtreecommitdiff
path: root/csharp/test/Ice/dispatcher/TestI.cs
diff options
context:
space:
mode:
Diffstat (limited to 'csharp/test/Ice/dispatcher/TestI.cs')
-rw-r--r--csharp/test/Ice/dispatcher/TestI.cs83
1 files changed, 83 insertions, 0 deletions
diff --git a/csharp/test/Ice/dispatcher/TestI.cs b/csharp/test/Ice/dispatcher/TestI.cs
new file mode 100644
index 00000000000..057057c7736
--- /dev/null
+++ b/csharp/test/Ice/dispatcher/TestI.cs
@@ -0,0 +1,83 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2015 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+
+using Test;
+using System.Threading;
+
+public class TestI : TestIntfDisp_
+{
+ private static void test(bool b)
+ {
+ if(!b)
+ {
+ throw new System.Exception();
+ }
+ }
+
+ public TestI()
+ {
+ }
+
+ override public void
+ op(Ice.Current current)
+ {
+ test(Dispatcher.isDispatcherThread());
+ }
+
+ override public void
+ opWithPayload(byte[] seq, Ice.Current current)
+ {
+ test(Dispatcher.isDispatcherThread());
+ }
+
+ public override void sleep(int to, Ice.Current current)
+ {
+ Thread.Sleep(to);
+ }
+
+ override public void
+ shutdown(Ice.Current current)
+ {
+ test(Dispatcher.isDispatcherThread());
+ current.adapter.getCommunicator().shutdown();
+ }
+}
+
+public class TestControllerI : TestIntfControllerDisp_
+{
+ private static void test(bool b)
+ {
+ if(!b)
+ {
+ throw new System.Exception();
+ }
+ }
+
+ override public void
+ holdAdapter(Ice.Current current)
+ {
+ test(Dispatcher.isDispatcherThread());
+ _adapter.hold();
+ }
+
+ override public void
+ resumeAdapter(Ice.Current current)
+ {
+ test(Dispatcher.isDispatcherThread());
+ _adapter.activate();
+ }
+
+ public
+ TestControllerI(Ice.ObjectAdapter adapter)
+ {
+ _adapter = adapter;
+ }
+
+ private Ice.ObjectAdapter _adapter;
+};