Author: gert
Date: 2007-09-04 15:00:36 -0400 (Tue, 04 Sep 2007)
New Revision: 85316

Added:
   trunk/gert/standalone/bug82687/
   trunk/gert/standalone/bug82687/default.build
   trunk/gert/standalone/bug82687/test.cs
   trunk/gert/standalone/bug82687/web/
   trunk/gert/standalone/bug82687/web/Default.aspx
Log:
Added test for bug #82687.


Added: trunk/gert/standalone/bug82687/default.build
===================================================================
--- trunk/gert/standalone/bug82687/default.build        2007-09-04 18:59:31 UTC 
(rev 85315)
+++ trunk/gert/standalone/bug82687/default.build        2007-09-04 19:00:36 UTC 
(rev 85316)
@@ -0,0 +1,62 @@
+<project name="bug82687" 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="web/bin/**" />
+                               <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">
+                       <sources>
+                               <include name="test.cs" />
+                       </sources>
+                       <references>
+                               <include name="System.Web.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/bug82687/default.build
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/gert/standalone/bug82687/test.cs
===================================================================
--- trunk/gert/standalone/bug82687/test.cs      2007-09-04 18:59:31 UTC (rev 
85315)
+++ trunk/gert/standalone/bug82687/test.cs      2007-09-04 19:00:36 UTC (rev 
85316)
@@ -0,0 +1,48 @@
+using System;
+using System.IO;
+using System.Web;
+using System.Web.Hosting;
+
+class TinyHost : MarshalByRefObject
+{
+       static TinyHost CreateHost ()
+       {
+               string path = Path.Combine 
(AppDomain.CurrentDomain.BaseDirectory, "web");
+               string bin = Path.Combine (path, "bin");
+               string asm = Path.GetFileName (typeof 
(TinyHost).Assembly.Location);
+
+               Directory.CreateDirectory (bin);
+               File.Copy (asm, Path.Combine (bin, asm), true);
+
+               return (TinyHost) ApplicationHost.CreateApplicationHost (
+                       typeof (TinyHost), "/", path);
+       }
+
+       public void Execute (string page, TextWriter tw)
+       {
+               SimpleWorkerRequest req = new SimpleWorkerRequest (
+                       page, "", tw);
+               HttpRuntime.ProcessRequest (req);
+       }
+
+       static int Main ()
+       {
+               TinyHost h = CreateHost ();
+               StringWriter sw = new StringWriter ();
+               h.Execute ("Default.aspx", sw);
+               string result = sw.ToString ();
+               if (result.IndexOf ("id=\"ItemsGrid\"") == -1) {
+                       Console.WriteLine (result);
+                       return 1;
+               }
+               if (result.IndexOf ("<td>Item 0</td>") == -1) {
+                       Console.WriteLine (result);
+                       return 2;
+               }
+               if (result.IndexOf ("<td>Item 8</td>") == -1) {
+                       Console.WriteLine (result);
+                       return 2;
+               }
+               return 0;
+       }
+}


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

Added: trunk/gert/standalone/bug82687/web/Default.aspx
===================================================================
--- trunk/gert/standalone/bug82687/web/Default.aspx     2007-09-04 18:59:31 UTC 
(rev 85315)
+++ trunk/gert/standalone/bug82687/web/Default.aspx     2007-09-04 19:00:36 UTC 
(rev 85316)
@@ -0,0 +1,43 @@
+<%@ Page Language="C#" %>
+<%@ Import Namespace="System.Data" %>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
+<html xmlns="http://www.w3.org/1999/xhtml"; >
+<head runat="server">
+       <title>Untitled Page</title>
+       <script runat="server">
+               ICollection CreateDataSource() 
+               {
+                       DataTable dt = new DataTable();
+                       DataRow dr;
+
+                       dt.Columns.Add(new DataColumn("IntegerValue", 
typeof(Int32)));
+                       dt.Columns.Add(new DataColumn("StringValue", 
typeof(string)));
+                       dt.Columns.Add(new DataColumn("CurrencyValue", 
typeof(double)));
+
+                       for (int i = 0; i < 9; i++) {
+                               dr = dt.NewRow();
+                               dr[0] = i;
+                               dr[1] = "Item " + i.ToString();
+                               dr[2] = 1.23 * (i + 1);
+                               dt.Rows.Add(dr);
+                       }
+
+                       DataView dv = new DataView(dt);
+                       return dv;
+               }
+
+               void Page_Load(Object sender, EventArgs e) 
+               {
+                       if (!IsPostBack) {
+                               ItemsGrid.DataSource= CreateDataSource();
+                               ItemsGrid.DataBind();
+                       }
+               }
+       </script>
+</head>
+<body>
+       <form id="form1" runat="server">
+               <asp:datagrid id=ItemsGrid runat=server 
headerstyle-font-names=tahoma AutoGenerateColumns=true />
+       </form>
+</body>
+</html>


Property changes on: trunk/gert/standalone/bug82687/web/Default.aspx
___________________________________________________________________
Name: svn:eol-style
   + native

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

Reply via email to