38b0a61c74fd927e90cb97af5fbedd8a129a5802
[mono.git] / mcs / class / System.Runtime.Remoting / Test / RemotingServicesTest.cs
1 //\r
2 // System.Runtime.Remoting.RemotingServices NUnit V2.0 test class\r
3 //\r
4 // Author Jean-Marc ANDRE (jean-marc.andre@polymtl.ca)\r
5 //\r
6 // ToDo: I didn't write test functions for the method not yep\r
7 // implemented by Mono\r
8 \r
9 using System;\r
10 using System.Collections;\r
11 using NUnit.Framework;\r
12 using System.Reflection;\r
13 using System.Runtime.Remoting;\r
14 using System.Threading;\r
15 using System.Runtime.Remoting.Activation;\r
16 using System.Runtime.Remoting.Messaging;\r
17 using System.Runtime.Remoting.Proxies;\r
18 using System.Runtime.Remoting.Channels;\r
19 using System.Runtime.Remoting.Channels.Tcp;\r
20 \r
21 namespace MonoTests.System.Runtime.Remoting.RemotingServicesInternal\r
22 {\r
23         // We need our own proxy to intercept messages to remote object\r
24         // and forward them using RemotingServices.ExecuteMessage\r
25         public class MyProxy: RealProxy\r
26         {\r
27                 MarshalByRefObject target;\r
28                 IMessageSink _sink;\r
29                 MethodBase _mthBase;\r
30                 bool methodOverloaded = false;\r
31                 \r
32                 public MethodBase MthBase\r
33                 {\r
34                         get{ return _mthBase;}\r
35                 }\r
36                 \r
37                 public bool IsMethodOverloaded\r
38                 {\r
39                         get{return methodOverloaded;}\r
40                 }\r
41                 \r
42                 public MyProxy(Type serverType, MarshalByRefObject target): base(serverType)\r
43                 {\r
44                         this.target = target;\r
45                         \r
46                         IChannel[] registeredChannels = ChannelServices.RegisteredChannels;\r
47                         string ObjectURI;\r
48                         \r
49                         // A new IMessageSink chain has to be created\r
50                         // since the RemotingServices.GetEnvoyChainForProxy() is not yet\r
51                         // implemented.\r
52                         foreach(IChannel channel in registeredChannels)\r
53                         {\r
54                                 IChannelSender channelSender = channel as IChannelSender;\r
55                                 if(channelSender != null)\r
56                                 {\r
57                                         _sink = (IMessageSink) channelSender.CreateMessageSink(RemotingServices.GetObjectUri(target), null, out ObjectURI);\r
58                                 }\r
59                         }\r
60                         \r
61                 }\r
62                 \r
63                 // Messages will be intercepted here and redirected\r
64                 // to another object.\r
65                 public override IMessage Invoke(IMessage msg)\r
66                 {\r
67                         try\r
68                         {\r
69                                 if(msg is IConstructionCallMessage)\r
70                                 {\r
71                                         IActivator remActivator = (IActivator) RemotingServices.Connect(typeof(IActivator), "tcp://localhost:1234/RemoteActivationService.rem");\r
72                                         IConstructionReturnMessage crm = remActivator.Activate((IConstructionCallMessage)msg);\r
73                                         return crm;\r
74                                 }\r
75                                 else\r
76                                 {\r
77                                         methodOverloaded = RemotingServices.IsMethodOverloaded((IMethodMessage)msg);\r
78                                         \r
79                                         _mthBase = RemotingServices.GetMethodBaseFromMethodMessage((IMethodMessage)msg);\r
80                                         MethodCallMessageWrapper mcm = new MethodCallMessageWrapper((IMethodCallMessage) msg);\r
81                                         mcm.Uri = RemotingServices.GetObjectUri((MarshalByRefObject)target);\r
82                                         MarshalByRefObject objRem = (MarshalByRefObject)Activator.CreateInstance(GetProxiedType());\r
83                                         RemotingServices.ExecuteMessage((MarshalByRefObject)objRem, (IMethodCallMessage)msg);\r
84                                         IMessage rtnMsg = null;\r
85                                         \r
86                                         try\r
87                                         {\r
88                                                 rtnMsg = _sink.SyncProcessMessage(msg);\r
89                                         }\r
90                                         catch(Exception e)\r
91                                         {\r
92                                                 Console.WriteLine(e.Message);\r
93                                         }\r
94                                         \r
95                                         Console.WriteLine ("RR:" + rtnMsg);\r
96                                         return rtnMsg;\r
97                                 }\r
98                         }\r
99                         catch (Exception ex)\r
100                         {\r
101                                 Console.WriteLine (ex);\r
102                                 return null;\r
103                         }\r
104                 }\r
105         } // end MyProxy\r
106         \r
107         // This class is used to create "CAO"\r
108         public class MarshalObjectFactory: MarshalByRefObject\r
109         {\r
110                 public MarshalObject GetNewMarshalObject()\r
111                 {\r
112                         return new MarshalObject();\r
113                 }\r
114         }\r
115         \r
116         // A class used by the tests\r
117         public class MarshalObject: ContextBoundObject\r
118         {\r
119                 public MarshalObject()\r
120                 {\r
121                         \r
122                 }\r
123                 \r
124                 public MarshalObject(int id, string uri)\r
125                 {\r
126                         this.id = id;\r
127                         this.uri = uri;\r
128                 }\r
129                 public int Id\r
130                 {\r
131                         get{return id;}\r
132                         set{id = value;}\r
133                 }\r
134                 public string Uri\r
135                 {\r
136                         get{return uri;}\r
137                 }\r
138                 \r
139                 public void Method1()\r
140                 {\r
141                         _called++;\r
142                         methodOneWay = RemotingServices.IsOneWay(MethodBase.GetCurrentMethod());                        \r
143                 }\r
144                 \r
145                 public void Method2()\r
146                 {\r
147                         methodOneWay = RemotingServices.IsOneWay(MethodBase.GetCurrentMethod());                        \r
148                 }\r
149                 \r
150                 public void Method2(int i)\r
151                 {\r
152                         methodOneWay = RemotingServices.IsOneWay(MethodBase.GetCurrentMethod());                        \r
153                         \r
154                 }\r
155                 \r
156                 [OneWay()]\r
157                 public void Method3()\r
158                 {\r
159                         methodOneWay = RemotingServices.IsOneWay(MethodBase.GetCurrentMethod());                        \r
160                         \r
161                 }\r
162                 \r
163                 public static int Called\r
164                 {\r
165                         get{return _called;}\r
166                 }\r
167                 \r
168                 public static bool IsMethodOneWay\r
169                 {\r
170                         get{return methodOneWay;}\r
171                 }\r
172                 \r
173                 \r
174                 private static int _called;\r
175                 private int id = 0;\r
176                 private string uri;\r
177                 private static bool methodOneWay = false;\r
178         }\r
179         \r
180         // Another class used by the tests\r
181         public class DerivedMarshalObject: MarshalObject\r
182         {\r
183                 public DerivedMarshalObject(){}\r
184                 \r
185                 public DerivedMarshalObject(int id, string uri): base(id, uri) {}\r
186         }       \r
187         \r
188         interface A\r
189         {\r
190         }\r
191         \r
192         interface B: A\r
193         { \r
194         }\r
195         \r
196         public class CC: MarshalByRefObject\r
197         { \r
198         }\r
199         \r
200         public class DD: MarshalByRefObject\r
201         { \r
202         }\r
203         \r
204         \r
205 } // namespace MonoTests.System.Runtime.Remoting.RemotingServicesInternal\r
206 \r
207 namespace MonoTests.Remoting\r
208 {\r
209         using MonoTests.System.Runtime.Remoting.RemotingServicesInternal;\r
210         \r
211         // The main test class\r
212         [TestFixture]\r
213         public class RemotingServicesTest : Assertion\r
214         {\r
215                 private static int MarshalObjectId = 0;\r
216                         \r
217                 public RemotingServicesTest()\r
218                 {\r
219                         MarshalObjectId = 0;\r
220                 }\r
221                 \r
222                 // Helper function that create a new\r
223                 // MarshalObject with an unique ID\r
224                 private static MarshalObject NewMarshalObject()\r
225                 {\r
226                         string uri = "MonoTests.System.Runtime.Remoting.RemotingServicesTest.MarshalObject" + MarshalObjectId.ToString();\r
227                         MarshalObject objMarshal = new MarshalObject(MarshalObjectId, uri);\r
228                         \r
229                         MarshalObjectId++;\r
230                         \r
231                         return objMarshal;\r
232                 }\r
233                 \r
234                 // Another helper function\r
235                 private DerivedMarshalObject NewDerivedMarshalObject()\r
236                 {\r
237                         string uri = "MonoTests.System.Runtime.Remoting.RemotingServicesTest.DerivedMarshalObject" + MarshalObjectId.ToString();\r
238                         DerivedMarshalObject objMarshal = new DerivedMarshalObject(MarshalObjectId, uri);\r
239                         \r
240                         MarshalObjectId++;\r
241                         \r
242                         return objMarshal;\r
243                 }\r
244                 \r
245                 // The two folling method test RemotingServices.Marshal()\r
246                 [Test]\r
247                 public void Marshal1()\r
248                 {\r
249                         \r
250                         MarshalObject objMarshal = NewMarshalObject();\r
251                         ObjRef objRef = RemotingServices.Marshal(objMarshal);\r
252                         \r
253                         Assert("#A01", objRef.URI != null);\r
254                         \r
255                         MarshalObject objRem = (MarshalObject) RemotingServices.Unmarshal(objRef);\r
256                         AssertEquals("#A02", objMarshal.Id, objRem.Id);\r
257                         \r
258                         objRem.Id = 2;\r
259                         AssertEquals("#A03", objMarshal.Id, objRem.Id);\r
260                         \r
261                         // TODO: uncomment when RemotingServices.Disconnect is implemented\r
262                         //RemotingServices.Disconnect(objMarshal);\r
263                         \r
264                         objMarshal = NewMarshalObject();\r
265                         \r
266                         objRef = RemotingServices.Marshal(objMarshal, objMarshal.Uri);\r
267                         \r
268                         Assert("#A04", objRef.URI.EndsWith(objMarshal.Uri));\r
269                         // TODO: uncomment when RemotingServices.Disconnect is implemented\r
270                         //RemotingServices.Disconnect(objMarshal);              \r
271                 }\r
272                 \r
273                 [Test]\r
274                 public void Marshal2()\r
275                 {\r
276                         DerivedMarshalObject derivedObjMarshal = NewDerivedMarshalObject();\r
277                         \r
278                         ObjRef objRef = RemotingServices.Marshal(derivedObjMarshal, derivedObjMarshal.Uri, typeof(MarshalObject));\r
279                         \r
280                         // Check that the type of the marshaled object is MarshalObject\r
281                         Assert("#A05", objRef.TypeInfo.TypeName.StartsWith((typeof(MarshalObject)).ToString()));\r
282                         \r
283                         // TODO: uncomment when RemotingServices.Disconnect is implemented\r
284                         //RemotingServices.Disconnect(derivedObjMarshal);\r
285                 }\r
286                 \r
287                 // Tests RemotingServices.GetObjectUri()\r
288                 [Test]\r
289                 public void GetObjectUri()\r
290                 {\r
291                         MarshalObject objMarshal = NewMarshalObject();\r
292                         \r
293                         Assert("#A06", RemotingServices.GetObjectUri(objMarshal) == null);\r
294                         \r
295                         ObjRef objRef = RemotingServices.Marshal(objMarshal);\r
296                         \r
297                         Assert("#A07", RemotingServices.GetObjectUri(objMarshal) != null);\r
298                         // TODO: uncomment when RemotingServices.Disconnect is implemented\r
299                         //RemotingServices.Disconnect(objMarshal);\r
300                 }\r
301                 \r
302                 // Tests RemotingServices.Connect\r
303                 [Test]\r
304                 public void Connect()\r
305                 {\r
306                         MarshalObject objMarshal = NewMarshalObject();\r
307                         \r
308                         IDictionary props = new Hashtable();\r
309                         props["name"] = objMarshal.Uri;\r
310                         props["port"] = 1236;\r
311                         TcpChannel chn = new TcpChannel(props, null, null);\r
312                         ChannelServices.RegisterChannel(chn);\r
313                         \r
314                         RemotingServices.Marshal(objMarshal,objMarshal.Uri);\r
315                         \r
316                         MarshalObject objRem = (MarshalObject) RemotingServices.Connect(typeof(MarshalObject), "tcp://localhost:1236/" + objMarshal.Uri);\r
317                         \r
318                         Assert("#A08", RemotingServices.IsTransparentProxy(objRem));\r
319                         \r
320                         ChannelServices.UnregisterChannel(chn);\r
321                         \r
322                         RemotingServices.Disconnect(objMarshal);\r
323                 }\r
324                 \r
325                 // Tests RemotingServices.Marshal()\r
326                 [Test]\r
327                 [ExpectedException(typeof(RemotingException))]  \r
328                 public void MarshalThrowException()\r
329                 {\r
330                         MarshalObject objMarshal = NewMarshalObject();\r
331                         \r
332                         IDictionary props = new Hashtable();\r
333                         props["name"] = objMarshal.Uri;\r
334                         props["port"] = 1237;\r
335                         TcpChannel chn = new TcpChannel(props, null, null);\r
336                         ChannelServices.RegisterChannel(chn);\r
337                         \r
338                         RemotingServices.Marshal(objMarshal,objMarshal.Uri);\r
339                         \r
340                         MarshalObject objRem = (MarshalObject) RemotingServices.Connect(typeof(MarshalObject), "tcp://localhost:1237/" + objMarshal.Uri);\r
341                         // This line sould throw a RemotingException\r
342                         // It is forbidden to export an object which is not\r
343                         // a real object\r
344                         try\r
345                         {\r
346                                 RemotingServices.Marshal(objRem, objMarshal.Uri);\r
347                         }\r
348                         catch(Exception e)\r
349                         {\r
350                                 ChannelServices.UnregisterChannel(chn);\r
351                         \r
352                         // TODO: uncomment when RemotingServices.Disconnect is implemented\r
353                         //RemotingServices.Disconnect(objMarshal);\r
354                         \r
355                                 throw e;\r
356                         }               \r
357                 }\r
358                 \r
359                 // Tests RemotingServices.ExecuteMessage()\r
360                 // also tests GetMethodBaseFromMessage()\r
361                 // IsMethodOverloaded()\r
362                 [Test]\r
363                 public void ExecuteMessage()\r
364                 {\r
365                         TcpChannel chn = null;\r
366                         try\r
367                         {\r
368                                 chn = new TcpChannel(1235);\r
369                                 ChannelServices.RegisterChannel(chn);\r
370                                 \r
371                                 MarshalObject objMarshal = NewMarshalObject();\r
372                                 RemotingConfiguration.RegisterWellKnownServiceType(typeof(MarshalObject), objMarshal.Uri, WellKnownObjectMode.SingleCall);\r
373                                 \r
374                                 // use a proxy to catch the Message\r
375                                 MyProxy proxy = new MyProxy(typeof(MarshalObject), (MarshalObject) Activator.GetObject(typeof(MarshalObject), "tcp://localhost:1235/" + objMarshal.Uri));\r
376                                 \r
377                                 MarshalObject objRem = (MarshalObject) proxy.GetTransparentProxy();\r
378                                 \r
379                                 objRem.Method1();\r
380                                 \r
381                                 // Tests RemotingServices.GetMethodBaseFromMethodMessage()\r
382                                 AssertEquals("#A09","Method1",proxy.MthBase.Name);\r
383                                 Assert("#A09.1", !proxy.IsMethodOverloaded);\r
384                                 \r
385                                 objRem.Method2();\r
386                                 Assert("#A09.2", proxy.IsMethodOverloaded);\r
387                         \r
388                                 // Tests RemotingServices.ExecuteMessage();\r
389                                 // If ExecuteMessage does it job well, Method1 should be called 2 times\r
390                                 AssertEquals("#A10", 2, MarshalObject.Called);\r
391                         }\r
392                         finally\r
393                         {\r
394                                 if(chn != null) ChannelServices.UnregisterChannel(chn);\r
395                         }\r
396                 }\r
397                 \r
398                 // Tests the IsOneWay method\r
399                 [Test]\r
400                 public void IsOneWay()\r
401                 {\r
402                         TcpChannel chn = null;\r
403                         try\r
404                         {\r
405                                 chn = new TcpChannel(1238);\r
406                                 ChannelServices.RegisterChannel(chn);\r
407                                 RemotingConfiguration.RegisterWellKnownServiceType(typeof(MarshalObject), "MarshalObject.rem", WellKnownObjectMode.Singleton);\r
408                                 \r
409                                 MarshalObject objRem = (MarshalObject) Activator.GetObject(typeof(MarshalObject), "tcp://localhost:1238/MarshalObject.rem");\r
410                                 \r
411                                 Assert("#A10.1", RemotingServices.IsTransparentProxy(objRem));\r
412                                 \r
413                                 objRem.Method1();\r
414                                 Thread.Sleep(20);\r
415                                 Assert("#A10.2", !MarshalObject.IsMethodOneWay);\r
416                                 objRem.Method3();\r
417                                 Thread.Sleep(20);\r
418                                 Assert("#A10.3", MarshalObject.IsMethodOneWay);\r
419                         }\r
420                         finally\r
421                         {\r
422                                 if(chn != null) ChannelServices.UnregisterChannel(chn);\r
423                         }\r
424                 }\r
425                 \r
426                 [Test]\r
427                 public void GetObjRefForProxy()\r
428                 {\r
429                         TcpChannel chn = null;\r
430                         try\r
431                         {\r
432                                 chn = new TcpChannel(1239);\r
433                                 ChannelServices.RegisterChannel(chn);\r
434                                 \r
435                                 // Register le factory as a SAO\r
436                                 RemotingConfiguration.RegisterWellKnownServiceType(typeof(MarshalObjectFactory), "MonoTests.System.Runtime.Remoting.RemotingServicesTest.Factory.soap", WellKnownObjectMode.Singleton);\r
437                                 \r
438                                 MarshalObjectFactory objFactory = (MarshalObjectFactory) Activator.GetObject(typeof(MarshalObjectFactory), "tcp://localhost:1239/MonoTests.System.Runtime.Remoting.RemotingServicesTest.Factory.soap");\r
439                                 \r
440                                 // Get a new "CAO"\r
441                                 MarshalObject objRem = objFactory.GetNewMarshalObject();\r
442                                 \r
443                                 ObjRef objRefRem = RemotingServices.GetObjRefForProxy((MarshalByRefObject)objRem);\r
444                                 \r
445                                 Assert("#A11", objRefRem != null);\r
446                         }\r
447                         finally\r
448                         {\r
449                                 if(chn != null) ChannelServices.UnregisterChannel(chn);                         \r
450                         }\r
451                 }\r
452                 \r
453                 // Tests GetRealProxy\r
454                 [Test]\r
455                 public void GetRealProxy()\r
456                 {\r
457                         TcpChannel chn = null;\r
458                         try\r
459                         {\r
460                                 chn = new TcpChannel(1241);\r
461                                 ChannelServices.RegisterChannel(chn);\r
462                                 \r
463                                 RemotingConfiguration.RegisterWellKnownServiceType(typeof(MarshalObject), "MonoTests.System.Runtime.Remoting.RemotingServicesTest.MarshalObject.soap", WellKnownObjectMode.Singleton);\r
464                                 \r
465                                 MyProxy proxy = new  MyProxy(typeof(MarshalObject), (MarshalByRefObject)Activator.GetObject(typeof(MarshalObject), "tcp://localhost:1241/MonoTests.System.Runtime.Remoting.RemotingServicesTest.MarshalObject.soap"));\r
466                                 MarshalObject objRem = (MarshalObject) proxy.GetTransparentProxy();\r
467                                 \r
468                                 RealProxy rp = RemotingServices.GetRealProxy(objRem);\r
469                                 \r
470                                 Assert("#A12", rp != null);\r
471                                 AssertEquals("#A13", "MonoTests.System.Runtime.Remoting.RemotingServicesInternal.MyProxy", rp.GetType().ToString());\r
472                         }\r
473                         finally\r
474                         {\r
475                                 if(chn != null) ChannelServices.UnregisterChannel(chn);\r
476                         }\r
477                 }\r
478                 \r
479                 // Tests SetObjectUriForMarshal()\r
480                 [Test]\r
481                 public void SetObjectUriForMarshal()\r
482                 {\r
483                         TcpChannel chn = null;\r
484                         try\r
485                         {\r
486                                 chn = new TcpChannel(1242);\r
487                                 ChannelServices.RegisterChannel(chn);\r
488                                 \r
489                                 MarshalObject objRem = NewMarshalObject();\r
490                                 RemotingServices.SetObjectUriForMarshal(objRem, objRem.Uri);\r
491                                 RemotingServices.Marshal(objRem);\r
492                                 \r
493                                 objRem = (MarshalObject) Activator.GetObject(typeof(MarshalObject), "tcp://localhost:1242/"+objRem.Uri);\r
494                                 Assert("#A14", objRem != null);\r
495                         }\r
496                         finally\r
497                         {\r
498                                 if(chn != null) ChannelServices.UnregisterChannel(chn);\r
499                         }                       \r
500                         \r
501                 }\r
502                 \r
503                 // Tests GetServeurTypeForUri()\r
504                 [Test]\r
505                 public void GetServeurTypeForUri()\r
506                 {\r
507                         TcpChannel chn = null;\r
508                         Type type = typeof(MarshalObject);\r
509                         try\r
510                         {\r
511                                 chn = new TcpChannel(1243);\r
512                                 ChannelServices.RegisterChannel(chn);\r
513                                 \r
514                                 MarshalObject objRem = NewMarshalObject();\r
515                                 RemotingServices.SetObjectUriForMarshal(objRem, objRem.Uri);\r
516                                 RemotingServices.Marshal(objRem);\r
517                                 \r
518                                 Type typeRem = RemotingServices.GetServerTypeForUri(RemotingServices.GetObjectUri(objRem));\r
519                                 AssertEquals("#A15", type, typeRem);\r
520                         }\r
521                         finally\r
522                         {\r
523                                 if(chn != null) ChannelServices.UnregisterChannel(chn);\r
524                         }                       \r
525                 }\r
526                 \r
527                 // Tests IsObjectOutOfDomain\r
528                 // Tests IsObjectOutOfContext\r
529                 [Test]\r
530                 public void IsObjectOutOf()\r
531                 {\r
532                         TcpChannel chn = null;\r
533                         try\r
534                         {\r
535                                 chn = new TcpChannel(1245);\r
536                                 ChannelServices.RegisterChannel(chn);\r
537                                 \r
538                                 RemotingConfiguration.RegisterWellKnownServiceType(typeof(MarshalObject), "MarshalObject2.rem", WellKnownObjectMode.Singleton);\r
539                                 \r
540                                 MarshalObject objRem = (MarshalObject) Activator.GetObject(typeof(MarshalObject), "tcp://localhost:1245/MarshalObject2.rem");\r
541                                 \r
542                                 Assert("#A16", RemotingServices.IsObjectOutOfAppDomain(objRem));\r
543                                 Assert("#A17", RemotingServices.IsObjectOutOfContext(objRem));\r
544                                 \r
545                                 MarshalObject objMarshal = new MarshalObject();\r
546                                 Assert("#A18", !RemotingServices.IsObjectOutOfAppDomain(objMarshal));\r
547                                 Assert("#A19", !RemotingServices.IsObjectOutOfContext(objMarshal));\r
548                         }\r
549                         finally\r
550                         {\r
551                                 ChannelServices.UnregisterChannel(chn);\r
552                         }\r
553                 }\r
554                 \r
555                 [Test]\r
556                 public void ConnectProxyCast ()\r
557                 {\r
558                         object o;\r
559                         RemotingConfiguration.Configure (null);\r
560                         \r
561                         o = RemotingServices.Connect (typeof(MarshalByRefObject), "tcp://localhost:3434/ff1.rem");\r
562                         Assert ("#m1", o is DD);\r
563                         Assert ("#m2", o is A);\r
564                         Assert ("#m3", o is B);\r
565                         Assert ("#m4", !(o is CC));\r
566                         \r
567                         o = RemotingServices.Connect (typeof(A), "tcp://localhost:3434/ff3.rem");\r
568                         Assert ("#a1", o is DD);\r
569                         Assert ("#a2", o is A);\r
570                         Assert ("#a3", o is B);\r
571                         Assert ("#a4", !(o is CC));\r
572                         \r
573                         o = RemotingServices.Connect (typeof(DD), "tcp://localhost:3434/ff4.rem");\r
574                         Assert ("#d1", o is DD);\r
575                         Assert ("#d2", o is A);\r
576                         Assert ("#d3", o is B);\r
577                         Assert ("#d4", !(o is CC));\r
578                         \r
579                         o = RemotingServices.Connect (typeof(CC), "tcp://localhost:3434/ff5.rem");\r
580                         Assert ("#c1", !(o is DD));\r
581                         Assert ("#c2", o is A);\r
582                         Assert ("#c3", o is B);\r
583                         Assert ("#c4", o is CC);\r
584                 }\r
585                 \r
586         } // end class RemotingServicesTest\r
587 } // end of namespace MonoTests.Remoting\r