Author: gert
Date: 2007-06-11 12:11:58 -0400 (Mon, 11 Jun 2007)
New Revision: 79188

Added:
   trunk/gert/standalone/bug76295/
   trunk/gert/standalone/bug76295/default.build
   trunk/gert/standalone/bug76295/test.cs
   trunk/gert/standalone/bug81554/
   trunk/gert/standalone/bug81554/client.cs
   trunk/gert/standalone/bug81554/common.cs
   trunk/gert/standalone/bug81554/default.build
   trunk/gert/standalone/bug81554/server.cs
Modified:
   trunk/gert/standalone/known-issues
Log:
Added tests for bug #81554 and bug #76295.


Added: trunk/gert/standalone/bug76295/default.build
===================================================================
--- trunk/gert/standalone/bug76295/default.build        2007-06-11 15:05:46 UTC 
(rev 79187)
+++ trunk/gert/standalone/bug76295/default.build        2007-06-11 16:11:58 UTC 
(rev 79188)
@@ -0,0 +1,64 @@
+<project name="bug76295" default="rebuild">
+       <target name="mono-1.0">
+               <property name="csc.defines" 
value="NET_1_0,NET_1_1,ONLY_1_1,MONO" />
+       </target>
+
+       <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-1.1">
+               <property name="csc.defines" value="NET_1_0,NET_1_1,ONLY_1_1" />
+       </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-1.0,mono-2.0,net-1.1,net-2.0" />
+
+       <target name="clean">
+               <delete>
+                       <fileset>
+                               <include name="out" />
+                               <include name="test.exe" />
+                       </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="exe" define="${csc.defines}" output="test.exe" 
warnaserror="true" warninglevel="4">
+                       <nowarn>
+                               <warning number="0618" />
+                       </nowarn>
+                       <sources>
+                               <include name="test.cs" />
+                       </sources>
+                       <references>
+                               <include name="System.Runtime.Remoting.dll" />
+                       </references>
+               </csc>
+       </target>
+
+       <target name="run" depends="compile">
+               <exec program="test.exe" managed="true" output="out" />
+               <fail if="${file::exists('out')}" />
+       </target>
+
+       <target name="rebuild" depends="clean, build" />
+</project>


Property changes on: trunk/gert/standalone/bug76295/default.build
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/gert/standalone/bug76295/test.cs
===================================================================
--- trunk/gert/standalone/bug76295/test.cs      2007-06-11 15:05:46 UTC (rev 
79187)
+++ trunk/gert/standalone/bug76295/test.cs      2007-06-11 16:11:58 UTC (rev 
79188)
@@ -0,0 +1,29 @@
+using System;
+using System.Runtime.Remoting;
+using System.Runtime.Remoting.Channels;
+using System.Runtime.Remoting.Channels.Http;
+using System.Runtime.Remoting.Channels.Tcp;
+
+public interface TestIf
+{
+       int One ();
+}
+
+class MainClass : MarshalByRefObject, TestIf
+{
+       int TestIf.One ()
+       {
+               return 1;
+       }
+
+       static int Main ()
+       {
+               ChannelServices.RegisterChannel (new HttpChannel (1234));
+               RemotingServices.Marshal (new MainClass (), "TestUri", typeof 
(TestIf));
+
+               TestIf o = RemotingServices.Connect (typeof (TestIf), 
"http://localhost:1234/TestUri";) as TestIf;
+               if (o.One () != 1)
+                       return 1;
+               return 0;
+       }
+}


Property changes on: trunk/gert/standalone/bug76295/test.cs
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/gert/standalone/bug81554/client.cs
===================================================================
--- trunk/gert/standalone/bug81554/client.cs    2007-06-11 15:05:46 UTC (rev 
79187)
+++ trunk/gert/standalone/bug81554/client.cs    2007-06-11 16:11:58 UTC (rev 
79188)
@@ -0,0 +1,28 @@
+using System;
+using System.Net;
+using System.Runtime.Remoting;
+using System.Runtime.Remoting.Channels;
+using System.Runtime.Remoting.Channels.Tcp;
+
+class Program
+{
+       static int Main ()
+       {
+               TcpChannel chan = new TcpChannel ();
+#if NET_2_0
+               ChannelServices.RegisterChannel (chan, false);
+#else
+               ChannelServices.RegisterChannel (chan);
+#endif
+
+               Common.ISayHello helloObj = Activator.GetObject (typeof 
(Common.ISayHello),
+                       "tcp://localhost:8085/SayHello") as Common.ISayHello;
+
+               if (helloObj == null)
+                       Console.WriteLine ("Could not locate server");
+
+               if (helloObj.SayHello () != "Hello")
+                       return 1;
+               return 0;
+       }
+}


Property changes on: trunk/gert/standalone/bug81554/client.cs
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/gert/standalone/bug81554/common.cs
===================================================================
--- trunk/gert/standalone/bug81554/common.cs    2007-06-11 15:05:46 UTC (rev 
79187)
+++ trunk/gert/standalone/bug81554/common.cs    2007-06-11 16:11:58 UTC (rev 
79188)
@@ -0,0 +1,27 @@
+using System;
+using System.Text;
+
+namespace Common
+{
+       public interface ISayHello
+       {
+               string SayHello();
+       }
+
+       public sealed class HelloClass : MarshalByRefObject, ISayHello
+       {
+               public HelloClass ()
+               {
+               }
+
+               string ISayHello.SayHello ()
+               {
+                       return "Hello";
+               }
+
+               public byte [] SayHello ()
+               {
+                       return Encoding.UTF8.GetBytes ("Hello");
+               }
+       }
+}


Property changes on: trunk/gert/standalone/bug81554/common.cs
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/gert/standalone/bug81554/default.build
===================================================================
--- trunk/gert/standalone/bug81554/default.build        2007-06-11 15:05:46 UTC 
(rev 79187)
+++ trunk/gert/standalone/bug81554/default.build        2007-06-11 16:11:58 UTC 
(rev 79188)
@@ -0,0 +1,80 @@
+<project name="bug81554" default="rebuild">
+       <target name="mono-1.0">
+               <property name="csc.defines" 
value="NET_1_0,NET_1_1,ONLY_1_1,MONO" />
+       </target>
+
+       <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-1.1">
+               <property name="csc.defines" value="NET_1_0,NET_1_1,ONLY_1_1" />
+       </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-1.0,mono-2.0,net-1.1,net-2.0" />
+
+       <target name="clean">
+               <delete>
+                       <fileset>
+                               <include name="client.exe" />
+                               <include name="common.dll" />
+                               <include name="out" />
+                               <include name="server.exe" />
+                       </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="common.dll" warnaserror="true" warninglevel="4">
+                       <sources>
+                               <include name="common.cs" />
+                       </sources>
+               </csc>
+               <csc target="exe" define="${csc.defines}" output="client.exe" 
warnaserror="true" warninglevel="4">
+                       <sources>
+                               <include name="client.cs" />
+                       </sources>
+                       <references>
+                               <include name="common.dll" />
+                               <include name="System.Runtime.Remoting.dll" />
+                       </references>
+               </csc>
+               <csc target="exe" define="${csc.defines}" output="server.exe" 
warnaserror="true" warninglevel="4">
+                       <sources>
+                               <include name="server.cs" />
+                       </sources>
+                       <references>
+                               <include name="common.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" />
+               <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/bug81554/default.build
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/gert/standalone/bug81554/server.cs
===================================================================
--- trunk/gert/standalone/bug81554/server.cs    2007-06-11 15:05:46 UTC (rev 
79187)
+++ trunk/gert/standalone/bug81554/server.cs    2007-06-11 16:11:58 UTC (rev 
79188)
@@ -0,0 +1,21 @@
+using System;
+using System.Runtime.Remoting;
+using System.Runtime.Remoting.Channels;
+using System.Runtime.Remoting.Channels.Tcp;
+
+class Program
+{
+       static void Main( string[] args )
+       {
+               TcpChannel chan = new TcpChannel (8085);
+#if NET_2_0
+               ChannelServices.RegisterChannel (chan, false);
+#else
+               ChannelServices.RegisterChannel (chan);
+#endif
+               RemotingConfiguration.RegisterWellKnownServiceType (typeof 
(Common.HelloClass),
+                       "SayHello", WellKnownObjectMode.Singleton);
+               Console.ReadLine();
+       }
+}
+


Property changes on: trunk/gert/standalone/bug81554/server.cs
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/gert/standalone/known-issues
===================================================================
--- trunk/gert/standalone/known-issues  2007-06-11 15:05:46 UTC (rev 79187)
+++ trunk/gert/standalone/known-issues  2007-06-11 16:11:58 UTC (rev 79188)
@@ -2,15 +2,17 @@
 bug59665/**
 bug61134/**
 bug72166/**
+bug76295/**
 bug77208/**
 bug78455/**
 bug78882/**
 bug80455/**
+bug81554/**
 bug81563/**
+bug81571/**
 bug81601/**
+bug81633/**
 bug81634/**
-bug81571/**
-bug81633/**
 bug81642/**
 bug81643/**
 bug81646/**

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to