\r
// The main test class\r
[TestFixture]\r
- public class RemotingServicesTest\r
+ public class RemotingServicesTest : Assertion\r
{\r
private static int MarshalObjectId = 0;\r
\r
MarshalObject objMarshal = NewMarshalObject();\r
ObjRef objRef = RemotingServices.Marshal(objMarshal);\r
\r
- Assertion.Assert("#A01", objRef.URI != null);\r
+ Assert("#A01", objRef.URI != null);\r
\r
MarshalObject objRem = (MarshalObject) RemotingServices.Unmarshal(objRef);\r
- Assertion.AssertEquals("#A02", objMarshal.Id, objRem.Id);\r
+ AssertEquals("#A02", objMarshal.Id, objRem.Id);\r
\r
objRem.Id = 2;\r
- Assertion.AssertEquals("#A03", objMarshal.Id, objRem.Id);\r
+ AssertEquals("#A03", objMarshal.Id, objRem.Id);\r
\r
// TODO: uncomment when RemotingServices.Disconnect is implemented\r
//RemotingServices.Disconnect(objMarshal);\r
\r
objRef = RemotingServices.Marshal(objMarshal, objMarshal.Uri);\r
\r
- Assertion.Assert("#A04", objRef.URI.EndsWith(objMarshal.Uri));\r
+ Assert("#A04", objRef.URI.EndsWith(objMarshal.Uri));\r
// TODO: uncomment when RemotingServices.Disconnect is implemented\r
//RemotingServices.Disconnect(objMarshal); \r
}\r
ObjRef objRef = RemotingServices.Marshal(derivedObjMarshal, derivedObjMarshal.Uri, typeof(MarshalObject));\r
\r
// Check that the type of the marshaled object is MarshalObject\r
- Assertion.Assert("#A05", objRef.TypeInfo.TypeName.StartsWith((typeof(MarshalObject)).ToString()));\r
+ Assert("#A05", objRef.TypeInfo.TypeName.StartsWith((typeof(MarshalObject)).ToString()));\r
\r
// TODO: uncomment when RemotingServices.Disconnect is implemented\r
//RemotingServices.Disconnect(derivedObjMarshal);\r
{\r
MarshalObject objMarshal = NewMarshalObject();\r
\r
- Assertion.Assert("#A06", RemotingServices.GetObjectUri(objMarshal) == null);\r
+ Assert("#A06", RemotingServices.GetObjectUri(objMarshal) == null);\r
\r
ObjRef objRef = RemotingServices.Marshal(objMarshal);\r
\r
- Assertion.Assert("#A07", RemotingServices.GetObjectUri(objMarshal) != null);\r
+ Assert("#A07", RemotingServices.GetObjectUri(objMarshal) != null);\r
// TODO: uncomment when RemotingServices.Disconnect is implemented\r
//RemotingServices.Disconnect(objMarshal);\r
}\r
\r
IDictionary props = new Hashtable();\r
props["name"] = objMarshal.Uri;\r
- props["port"] = 1234;\r
+ props["port"] = 1236;\r
TcpChannel chn = new TcpChannel(props, null, null);\r
ChannelServices.RegisterChannel(chn);\r
\r
RemotingServices.Marshal(objMarshal,objMarshal.Uri);\r
\r
- MarshalObject objRem = (MarshalObject) RemotingServices.Connect(typeof(MarshalObject), "tcp://localhost:1234/" + objMarshal.Uri);\r
+ MarshalObject objRem = (MarshalObject) RemotingServices.Connect(typeof(MarshalObject), "tcp://localhost:1236/" + objMarshal.Uri);\r
\r
- Assertion.Assert("#A08", RemotingServices.IsTransparentProxy(objRem));\r
+ Assert("#A08", RemotingServices.IsTransparentProxy(objRem));\r
\r
ChannelServices.UnregisterChannel(chn);\r
\r
\r
IDictionary props = new Hashtable();\r
props["name"] = objMarshal.Uri;\r
- props["port"] = 1234;\r
+ props["port"] = 1237;\r
TcpChannel chn = new TcpChannel(props, null, null);\r
ChannelServices.RegisterChannel(chn);\r
\r
RemotingServices.Marshal(objMarshal,objMarshal.Uri);\r
\r
- MarshalObject objRem = (MarshalObject) RemotingServices.Connect(typeof(MarshalObject), "tcp://localhost:1234/" + objMarshal.Uri);\r
+ MarshalObject objRem = (MarshalObject) RemotingServices.Connect(typeof(MarshalObject), "tcp://localhost:1237/" + objMarshal.Uri);\r
// This line sould throw a RemotingException\r
// It is forbidden to export an object which is not\r
// a real object\r
TcpChannel chn = null;\r
try\r
{\r
- chn = new TcpChannel(1234);\r
+ chn = new TcpChannel(1235);\r
ChannelServices.RegisterChannel(chn);\r
\r
MarshalObject objMarshal = NewMarshalObject();\r
RemotingConfiguration.RegisterWellKnownServiceType(typeof(MarshalObject), objMarshal.Uri, WellKnownObjectMode.SingleCall);\r
\r
// use a proxy to catch the Message\r
- MyProxy proxy = new MyProxy(typeof(MarshalObject), (MarshalObject) Activator.GetObject(typeof(MarshalObject), "tcp://localhost:1234/" + objMarshal.Uri));\r
+ MyProxy proxy = new MyProxy(typeof(MarshalObject), (MarshalObject) Activator.GetObject(typeof(MarshalObject), "tcp://localhost:1235/" + objMarshal.Uri));\r
\r
MarshalObject objRem = (MarshalObject) proxy.GetTransparentProxy();\r
\r
objRem.Method1();\r
\r
// Tests RemotingServices.GetMethodBaseFromMethodMessage()\r
- Assertion.AssertEquals("#A09","Method1",proxy.MthBase.Name);\r
- Assertion.Assert("#A09.1", !proxy.IsMethodOverloaded);\r
+ AssertEquals("#A09","Method1",proxy.MthBase.Name);\r
+ Assert("#A09.1", !proxy.IsMethodOverloaded);\r
\r
objRem.Method2();\r
- Assertion.Assert("#A09.2", proxy.IsMethodOverloaded);\r
+ Assert("#A09.2", proxy.IsMethodOverloaded);\r
\r
// Tests RemotingServices.ExecuteMessage();\r
// If ExecuteMessage does it job well, Method1 should be called 2 times\r
- Assertion.AssertEquals("#A10", 2, MarshalObject.Called);\r
+ AssertEquals("#A10", 2, MarshalObject.Called);\r
}\r
finally\r
{\r
TcpChannel chn = null;\r
try\r
{\r
- chn = new TcpChannel(1234);\r
+ chn = new TcpChannel(1238);\r
ChannelServices.RegisterChannel(chn);\r
RemotingConfiguration.RegisterWellKnownServiceType(typeof(MarshalObject), "MarshalObject.rem", WellKnownObjectMode.Singleton);\r
\r
- MarshalObject objRem = (MarshalObject) Activator.GetObject(typeof(MarshalObject), "tcp://localhost:1234/MarshalObject.rem");\r
+ MarshalObject objRem = (MarshalObject) Activator.GetObject(typeof(MarshalObject), "tcp://localhost:1238/MarshalObject.rem");\r
\r
- Assertion.Assert("#A10.1", RemotingServices.IsTransparentProxy(objRem));\r
+ Assert("#A10.1", RemotingServices.IsTransparentProxy(objRem));\r
\r
objRem.Method1();\r
Thread.Sleep(20);\r
- Assertion.Assert("#A10.2", !MarshalObject.IsMethodOneWay);\r
+ Assert("#A10.2", !MarshalObject.IsMethodOneWay);\r
objRem.Method3();\r
Thread.Sleep(20);\r
- Assertion.Assert("#A10.2", MarshalObject.IsMethodOneWay);\r
+ Assert("#A10.2", MarshalObject.IsMethodOneWay);\r
}\r
finally\r
{\r
TcpChannel chn = null;\r
try\r
{\r
- chn = new TcpChannel(1234);\r
+ chn = new TcpChannel(1239);\r
ChannelServices.RegisterChannel(chn);\r
\r
// Register le factory as a SAO\r
RemotingConfiguration.RegisterWellKnownServiceType(typeof(MarshalObjectFactory), "MonoTests.System.Runtime.Remoting.RemotingServicesTest.Factory.soap", WellKnownObjectMode.Singleton);\r
\r
- MarshalObjectFactory objFactory = (MarshalObjectFactory) Activator.GetObject(typeof(MarshalObjectFactory), "tcp://localhost:1234/MonoTests.System.Runtime.Remoting.RemotingServicesTest.Factory.soap");\r
+ MarshalObjectFactory objFactory = (MarshalObjectFactory) Activator.GetObject(typeof(MarshalObjectFactory), "tcp://localhost:1239/MonoTests.System.Runtime.Remoting.RemotingServicesTest.Factory.soap");\r
\r
// Get a new "CAO"\r
MarshalObject objRem = objFactory.GetNewMarshalObject();\r
\r
ObjRef objRefRem = RemotingServices.GetObjRefForProxy((MarshalByRefObject)objRem);\r
\r
- Assertion.Assert("#A11", objRefRem != null);\r
+ Assert("#A11", objRefRem != null);\r
}\r
finally\r
{\r
TcpChannel chn = null;\r
try\r
{\r
- chn = new TcpChannel(1234);\r
+ chn = new TcpChannel(1241);\r
ChannelServices.RegisterChannel(chn);\r
\r
RemotingConfiguration.RegisterWellKnownServiceType(typeof(MarshalObject), "MonoTests.System.Runtime.Remoting.RemotingServicesTest.MarshalObject.soap", WellKnownObjectMode.Singleton);\r
\r
- MyProxy proxy = new MyProxy(typeof(MarshalObject), (MarshalByRefObject)Activator.GetObject(typeof(MarshalObject), "tcp://localhost:1234/MonoTests.System.Runtime.Remoting.RemotingServicesTest.MarshalObject.soap"));\r
+ MyProxy proxy = new MyProxy(typeof(MarshalObject), (MarshalByRefObject)Activator.GetObject(typeof(MarshalObject), "tcp://localhost:1241/MonoTests.System.Runtime.Remoting.RemotingServicesTest.MarshalObject.soap"));\r
MarshalObject objRem = (MarshalObject) proxy.GetTransparentProxy();\r
\r
RealProxy rp = RemotingServices.GetRealProxy(objRem);\r
\r
- Assertion.Assert("#A12", rp != null);\r
- Assertion.AssertEquals("#A13", "MonoTests.System.Runtime.Remoting.RemotingServicesInternal.MyProxy", rp.GetType().ToString());\r
+ Assert("#A12", rp != null);\r
+ AssertEquals("#A13", "MonoTests.System.Runtime.Remoting.RemotingServicesInternal.MyProxy", rp.GetType().ToString());\r
}\r
finally\r
{\r
TcpChannel chn = null;\r
try\r
{\r
- chn = new TcpChannel(1234);\r
+ chn = new TcpChannel(1242);\r
ChannelServices.RegisterChannel(chn);\r
\r
MarshalObject objRem = NewMarshalObject();\r
RemotingServices.SetObjectUriForMarshal(objRem, objRem.Uri);\r
RemotingServices.Marshal(objRem);\r
\r
- objRem = (MarshalObject) Activator.GetObject(typeof(MarshalObject), "tcp://localhost:1234/"+objRem.Uri);\r
- Assertion.Assert("#A14", objRem != null);\r
+ objRem = (MarshalObject) Activator.GetObject(typeof(MarshalObject), "tcp://localhost:1242/"+objRem.Uri);\r
+ Assert("#A14", objRem != null);\r
}\r
finally\r
{\r
Type type = typeof(MarshalObject);\r
try\r
{\r
- chn = new TcpChannel(1234);\r
+ chn = new TcpChannel(1243);\r
ChannelServices.RegisterChannel(chn);\r
\r
MarshalObject objRem = NewMarshalObject();\r
RemotingServices.Marshal(objRem);\r
\r
Type typeRem = RemotingServices.GetServerTypeForUri(RemotingServices.GetObjectUri(objRem));\r
- Assertion.AssertEquals("#A15", type, typeRem);\r
+ AssertEquals("#A15", type, typeRem);\r
}\r
finally\r
{\r
TcpChannel chn = null;\r
try\r
{\r
- chn = new TcpChannel(1234);\r
+ chn = new TcpChannel(1245);\r
ChannelServices.RegisterChannel(chn);\r
\r
RemotingConfiguration.RegisterWellKnownServiceType(typeof(MarshalObject), "MarshalObject.rem", WellKnownObjectMode.Singleton);\r
\r
- MarshalObject objRem = (MarshalObject) Activator.GetObject(typeof(MarshalObject), "tcp://localhost:1234/MarshalObject.rem");\r
+ MarshalObject objRem = (MarshalObject) Activator.GetObject(typeof(MarshalObject), "tcp://localhost:1245/MarshalObject.rem");\r
\r
- Assertion.Assert("#A16", RemotingServices.IsObjectOutOfAppDomain(objRem));\r
- Assertion.Assert("#A17", RemotingServices.IsObjectOutOfContext(objRem));\r
+ Assert("#A16", RemotingServices.IsObjectOutOfAppDomain(objRem));\r
+ Assert("#A17", RemotingServices.IsObjectOutOfContext(objRem));\r
\r
MarshalObject objMarshal = new MarshalObject();\r
- Assertion.Assert("#A18", !RemotingServices.IsObjectOutOfAppDomain(objMarshal));\r
- Assertion.Assert("#A19", !RemotingServices.IsObjectOutOfContext(objMarshal));\r
+ Assert("#A18", !RemotingServices.IsObjectOutOfAppDomain(objMarshal));\r
+ Assert("#A19", !RemotingServices.IsObjectOutOfContext(objMarshal));\r
}\r
finally\r
{\r