Author: gert
Date: 2007-10-31 18:05:42 -0500 (Wed, 31 Oct 2007)
New Revision: 88615
Added:
trunk/gert/standalone/bug80761/
trunk/gert/standalone/bug80761/default.build
trunk/gert/standalone/bug80761/eventclient.cs
trunk/gert/standalone/bug80761/eventserver.cs
trunk/gert/standalone/bug80761/eventshared.cs
Modified:
trunk/gert/standalone/known-issues
Log:
Added test for bug #80761.
Added: trunk/gert/standalone/bug80761/default.build
===================================================================
--- trunk/gert/standalone/bug80761/default.build 2007-10-31 22:45:45 UTC
(rev 88614)
+++ trunk/gert/standalone/bug80761/default.build 2007-10-31 23:05:42 UTC
(rev 88615)
@@ -0,0 +1,72 @@
+<project name="bug80761" default="rebuild">
+ <target name="mono-2.0">
+ <property name="csc.defines"
value="NET_1_0,NET_1_1,NET_2_0,ONLY_2_0,MONO" />
+ </target>
+
+ <target name="net-2.0">
+ <property name="csc.defines"
value="NET_1_0,NET_1_1,NET_2_0,ONLY_2_0" />
+ </target>
+
+ <property name="frameworks" value="mono-2.0,net-2.0" />
+
+ <target name="clean">
+ <delete>
+ <fileset>
+ <include name="client.exe" />
+ <include name="out" />
+ <include name="server.exe" />
+ <include name="shared.dll" />
+ </fileset>
+ </delete>
+ </target>
+
+ <target name="build">
+ <property name="original.targetframework"
value="${nant.settings.currentframework}" />
+
+ <foreach property="framework" item="String" in="${frameworks}"
delim=",">
+ <if test="${framework::exists(framework)}">
+ <property name="nant.settings.currentframework"
value="${framework}" />
+ <call
target="${nant.settings.currentframework}" />
+ <call target="run" />
+ <call target="clean" />
+ </if>
+ </foreach>
+
+ <property name="nant.settings.currentframework"
value="${original.targetframework}" />
+ </target>
+
+ <target name="compile">
+ <csc target="library" define="${csc.defines}"
output="shared.dll" warnaserror="true" warninglevel="4">
+ <sources>
+ <include name="eventshared.cs" />
+ </sources>
+ </csc>
+ <csc target="exe" define="${csc.defines}" output="client.exe"
warnaserror="true" warninglevel="4">
+ <sources>
+ <include name="eventclient.cs" />
+ </sources>
+ <references>
+ <include name="shared.dll" />
+ </references>
+ </csc>
+ <csc target="exe" define="${csc.defines}" output="server.exe"
warnaserror="true" warninglevel="4">
+ <sources>
+ <include name="eventserver.cs" />
+ </sources>
+ <references>
+ <include name="shared.dll" />
+ <include name="System.Runtime.Remoting.dll" />
+ </references>
+ </csc>
+ </target>
+
+ <target name="run" depends="compile">
+ <exec program="server.exe" managed="true" spawn="true"
pidproperty="server.pid" />
+ <sleep milliseconds="1000" />
+ <exec program="client.exe" managed="true" output="out" />
+ <fail if="${file::exists('out')}" />
+ <kill pid="${server.pid}" />
+ </target>
+
+ <target name="rebuild" depends="clean, build" />
+</project>
Property changes on: trunk/gert/standalone/bug80761/default.build
___________________________________________________________________
Name: svn:eol-style
+ native
Added: trunk/gert/standalone/bug80761/eventclient.cs
===================================================================
--- trunk/gert/standalone/bug80761/eventclient.cs 2007-10-31 22:45:45 UTC
(rev 88614)
+++ trunk/gert/standalone/bug80761/eventclient.cs 2007-10-31 23:05:42 UTC
(rev 88615)
@@ -0,0 +1,25 @@
+using System;
+using System.Reflection;
+
+class Program
+{
+ static void Main()
+ {
+ string service = "tcp://localhost:5000/";
+ ITest test = (ITest) Activator.GetObject (typeof (ITest),
service + "Test");
+ test.Test (DateTime.Now);
+ test.TestEvent += new EventHandler (TestHandler);
+ test.TestEvent += new EventHandler (TestHandler);
+ test.Info = typeof (Program).GetMethod("Foo")
+ .MakeGenericMethod (new Type[] {typeof (int)});
+ test.Raise();
+ }
+
+ public static void Foo<T>()
+ {
+ }
+
+ public static void TestHandler (object sender, EventArgs eventArgs)
+ {
+ }
+}
Property changes on: trunk/gert/standalone/bug80761/eventclient.cs
___________________________________________________________________
Name: svn:eol-style
+ native
Added: trunk/gert/standalone/bug80761/eventserver.cs
===================================================================
--- trunk/gert/standalone/bug80761/eventserver.cs 2007-10-31 22:45:45 UTC
(rev 88614)
+++ trunk/gert/standalone/bug80761/eventserver.cs 2007-10-31 23:05:42 UTC
(rev 88615)
@@ -0,0 +1,56 @@
+using System;
+using System.Collections;
+using System.IO;
+using System.Reflection;
+using System.Threading;
+using System.Runtime.Remoting;
+using System.Runtime.Serialization.Formatters;
+using System.Runtime.Remoting.Channels;
+using System.Runtime.Remoting.Channels.Tcp;
+
+public class MyTest : MarshalByRefObject, ITest
+{
+ public void Raise ()
+ {
+ if (TestEvent != null)
+ TestEvent (this, EventArgs.Empty);
+ }
+
+ public event EventHandler TestEvent;
+
+ public MethodInfo Info
+ {
+ get { return info; }
+ set { info = value; }
+ }
+
+ MethodInfo info;
+
+ public void Test (DateTime d)
+ {
+ }
+}
+
+public class TestImpl
+{
+ static void Main ()
+ {
+ BinaryServerFormatterSinkProvider provider = new
BinaryServerFormatterSinkProvider ();
+ provider.TypeFilterLevel = TypeFilterLevel.Full;
+
+ IDictionary props = new Hashtable ();
+ props ["port"] = 5000;
+ props ["name"] = "originalTcpChannel";
+
+ TcpChannel channel = new TcpChannel (props, null, provider);
+#if NET_2_0
+ ChannelServices.RegisterChannel(channel, false);
+#else
+ ChannelServices.RegisterChannel (channel);
+#endif
+
+ RemotingServices.Marshal (new MyTest (), "Test");
+
+ Console.ReadLine ();
+ }
+}
Property changes on: trunk/gert/standalone/bug80761/eventserver.cs
___________________________________________________________________
Name: svn:eol-style
+ native
Added: trunk/gert/standalone/bug80761/eventshared.cs
===================================================================
--- trunk/gert/standalone/bug80761/eventshared.cs 2007-10-31 22:45:45 UTC
(rev 88614)
+++ trunk/gert/standalone/bug80761/eventshared.cs 2007-10-31 23:05:42 UTC
(rev 88615)
@@ -0,0 +1,10 @@
+using System;
+using System.Reflection;
+
+public interface ITest
+{
+ void Raise();
+ event EventHandler TestEvent;
+ MethodInfo Info { get; set; }
+ void Test (DateTime d);
+}
Property changes on: trunk/gert/standalone/bug80761/eventshared.cs
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/gert/standalone/known-issues
===================================================================
--- trunk/gert/standalone/known-issues 2007-10-31 22:45:45 UTC (rev 88614)
+++ trunk/gert/standalone/known-issues 2007-10-31 23:05:42 UTC (rev 88615)
@@ -15,6 +15,7 @@
bug80701/**
bug80714/**
bug80735/**
+bug80761/**
bug81023/**
bug81032/**
bug81034/**
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches