Author: gert
Date: 2007-08-31 10:21:40 -0400 (Fri, 31 Aug 2007)
New Revision: 85128

Added:
   trunk/gert/standalone/bug82615/
   trunk/gert/standalone/bug82615/default.build
   trunk/gert/standalone/bug82615/test.cs
   trunk/gert/standalone/bug82615/web/
   trunk/gert/standalone/bug82615/web/Default.aspx
   trunk/gert/standalone/bug82615/web/Default.aspx.cs
   trunk/gert/standalone/bug82615/web/Default.aspx.designer.cs
Log:
Added test for bug #82615.


Added: trunk/gert/standalone/bug82615/default.build
===================================================================
--- trunk/gert/standalone/bug82615/default.build        2007-08-31 14:17:16 UTC 
(rev 85127)
+++ trunk/gert/standalone/bug82615/default.build        2007-08-31 14:21:40 UTC 
(rev 85128)
@@ -0,0 +1,64 @@
+<project name="bug82615" 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="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">
+               <mkdir dir="web/bin" />
+               <csc target="library" define="${csc.defines}" 
output="web/bin/Mono.Web.dll" warnaserror="true" warninglevel="4">
+                       <sources basedir="web">
+                               <include name="*.cs" />
+                       </sources>
+                       <references>
+                               <include name="System.Data.dll" />
+                               <include name="System.Web.dll" />
+                       </references>
+               </csc>
+               <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/bug82615/default.build
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/gert/standalone/bug82615/test.cs
===================================================================
--- trunk/gert/standalone/bug82615/test.cs      2007-08-31 14:17:16 UTC (rev 
85127)
+++ trunk/gert/standalone/bug82615/test.cs      2007-08-31 14:21:40 UTC (rev 
85128)
@@ -0,0 +1,44 @@
+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 ("VISIBLE COLUMNS: 2 ") == -1) {
+                       Console.WriteLine (result);
+                       return 1;
+               }
+               if (result.IndexOf (" TOTAL COLUMNS: 3") == -1) {
+                       Console.WriteLine (result);
+                       return 1;
+               }
+               return 0;
+       }
+}


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

Added: trunk/gert/standalone/bug82615/web/Default.aspx
===================================================================
--- trunk/gert/standalone/bug82615/web/Default.aspx     2007-08-31 14:17:16 UTC 
(rev 85127)
+++ trunk/gert/standalone/bug82615/web/Default.aspx     2007-08-31 14:21:40 UTC 
(rev 85128)
@@ -0,0 +1,21 @@
+<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" 
Inherits="_Default" %>
+<!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>
+</head>
+<body>
+       <form id="form1" runat="server">
+               <div>
+                       <asp:GridView ID="GridView1" runat="server" 
AutoGenerateColumns="False">
+                               <Columns>
+                                       <asp:BoundField DataField="Field1" />
+                                       <asp:BoundField DataField="Field2" 
Visible="false"/>
+                                       <asp:BoundField DataField="Field3" />
+                               </Columns>
+                       </asp:GridView>
+               </div>
+               <asp:Label ID="label" runat="server"></asp:Label>
+       </form>
+</body>
+</html>


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

Added: trunk/gert/standalone/bug82615/web/Default.aspx.cs
===================================================================
--- trunk/gert/standalone/bug82615/web/Default.aspx.cs  2007-08-31 14:17:16 UTC 
(rev 85127)
+++ trunk/gert/standalone/bug82615/web/Default.aspx.cs  2007-08-31 14:21:40 UTC 
(rev 85128)
@@ -0,0 +1,47 @@
+using System;
+using System.Data;
+using System.Globalization;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+using System.Web.UI.HtmlControls;
+
+public partial class _Default : Page
+{
+       protected override void OnInit (EventArgs e)
+       {
+               base.OnInit (e);
+
+               GridView1.RowCreated += new GridViewRowEventHandler 
(GridView1_RowCreated);
+       }
+
+       void GridView1_RowCreated (object sender, GridViewRowEventArgs e)
+       {
+               int visibleColumns = 0;
+               foreach (DataControlField column in GridView1.Columns)
+                       if (column.Visible)
+                               visibleColumns++;
+
+               label.Text = string.Format (CultureInfo.InvariantCulture,
+                       "VISIBLE COLUMNS: {0} | TOTAL COLUMNS: {1}",
+                       visibleColumns, e.Row.Cells.Count);
+       }
+
+       protected void Page_Load (object sender, EventArgs e)
+       {
+               DataTable tbl = new DataTable ();
+               tbl.Columns.Add ("Field1", typeof (string));
+               tbl.Columns.Add ("Field2", typeof (string));
+               tbl.Columns.Add ("Field3", typeof (string));
+
+               for (int i = 0; i < 4; i++) {   
+                       DataRow row = tbl.NewRow ();
+                       for (int j = 0; j < 3; j++)
+                               row [j] = j.ToString ();
+                       tbl.Rows.Add (row);
+               }
+
+               GridView1.DataSource = tbl;
+               GridView1.DataBind ();
+       }
+}


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

Added: trunk/gert/standalone/bug82615/web/Default.aspx.designer.cs
===================================================================
--- trunk/gert/standalone/bug82615/web/Default.aspx.designer.cs 2007-08-31 
14:17:16 UTC (rev 85127)
+++ trunk/gert/standalone/bug82615/web/Default.aspx.designer.cs 2007-08-31 
14:21:40 UTC (rev 85128)
@@ -0,0 +1,9 @@
+using System.Web.UI.WebControls;
+using System.Web.UI.HtmlControls;
+
+public partial class _Default
+{
+       protected HtmlForm form1;
+       protected GridView GridView1;
+       protected Label label;
+}


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

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

Reply via email to