Author: gert
Date: 2007-10-18 13:02:08 -0400 (Thu, 18 Oct 2007)
New Revision: 87768
Added:
trunk/gert/standalone/bug334931/
trunk/gert/standalone/bug334931/default.build
trunk/gert/standalone/bug334931/test.cs
trunk/gert/standalone/bug334931/web/
trunk/gert/standalone/bug334931/web/AlbumListing.aspx
trunk/gert/standalone/bug334931/web/AlbumListing.aspx.cs
trunk/gert/standalone/bug334931/web/AlbumRequestHandler.cs
trunk/gert/standalone/bug334931/web/albums/
trunk/gert/standalone/bug334931/web/albums/Web.config
Modified:
trunk/gert/standalone/known-issues
Log:
Added test for bug #334931.
Added: trunk/gert/standalone/bug334931/default.build
===================================================================
--- trunk/gert/standalone/bug334931/default.build 2007-10-18 16:59:20 UTC
(rev 87767)
+++ trunk/gert/standalone/bug334931/default.build 2007-10-18 17:02:08 UTC
(rev 87768)
@@ -0,0 +1,84 @@
+<project name="bug334931" default="rebuild">
+ <target name="mono-1.0">
+ <property name="csc.defines"
value="NET_1_0,NET_1_1,ONLY_1_1,MONO" />
+ <property name="xsp.package" value="xsp" />
+ </target>
+
+ <target name="mono-2.0">
+ <property name="csc.defines"
value="NET_1_0,NET_1_1,NET_2_0,ONLY_2_0,MONO" />
+ <property name="xsp.package" value="xsp-2" />
+ </target>
+
+ <target name="net-1.1">
+ <property name="csc.defines" value="NET_1_0,NET_1_1,ONLY_1_1" />
+ <property name="xsp.package" value="xsp" />
+ </target>
+
+ <target name="net-2.0">
+ <property name="csc.defines"
value="NET_1_0,NET_1_1,NET_2_0,ONLY_2_0" />
+ <property name="xsp.package" value="xsp-2" />
+ </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">
+ <mkdir dir="web/bin" />
+ <csc target="library" define="${csc.defines}"
output="web/bin/ServerTransfer.dll" warnaserror="true" warninglevel="4">
+ <sources basedir="web">
+ <include name="**/*.cs" />
+ </sources>
+ <references>
+ <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="${pkg-config::get-variable(xsp.package,'Executable')}" managed="true"
spawn="true" pidproperty="server.pid">
+ <arg value="--root" />
+ <arg dir="web" />
+ <arg value="--port" />
+ <arg value="8081" />
+ </exec>
+ <sleep milliseconds="1000" />
+ <exec program="test.exe" managed="true" output="out" />
+ <fail if="${file::exists('out')}" />
+ <kill pid="${server.pid}" />
+ <sleep milliseconds="1000" />
+ </target>
+
+ <target name="rebuild" depends="clean, build" />
+</project>
Property changes on: trunk/gert/standalone/bug334931/default.build
___________________________________________________________________
Name: svn:eol-style
+ native
Added: trunk/gert/standalone/bug334931/test.cs
===================================================================
--- trunk/gert/standalone/bug334931/test.cs 2007-10-18 16:59:20 UTC (rev
87767)
+++ trunk/gert/standalone/bug334931/test.cs 2007-10-18 17:02:08 UTC (rev
87768)
@@ -0,0 +1,33 @@
+using System;
+using System.IO;
+using System.Net;
+using System.Text;
+
+class Program
+{
+ static int Main ()
+ {
+ HttpWebRequest request = (HttpWebRequest) WebRequest.Create
("http://localhost:8081/albums/3.aspx");
+ request.Method = "GET";
+
+ try {
+ HttpWebResponse response = (HttpWebResponse)
request.GetResponse ();
+ using (StreamReader sr = new StreamReader
(response.GetResponseStream (), Encoding.UTF8, true)) {
+ string result = sr.ReadToEnd ();
+ if (result.IndexOf
("<title>albumListing</title>") == -1) {
+ Console.WriteLine (result);
+ return 1;
+ }
+ }
+ response.Close ();
+ } catch (WebException ex) {
+ if (ex.Response != null) {
+ StreamReader sr = new StreamReader
(ex.Response.GetResponseStream ());
+ Console.WriteLine (sr.ReadToEnd ());
+ return 1;
+ }
+ }
+
+ return 0;
+ }
+}
Property changes on: trunk/gert/standalone/bug334931/test.cs
___________________________________________________________________
Name: svn:eol-style
+ native
Added: trunk/gert/standalone/bug334931/web/AlbumListing.aspx
===================================================================
--- trunk/gert/standalone/bug334931/web/AlbumListing.aspx 2007-10-18
16:59:20 UTC (rev 87767)
+++ trunk/gert/standalone/bug334931/web/AlbumListing.aspx 2007-10-18
17:02:08 UTC (rev 87768)
@@ -0,0 +1,19 @@
+<%@ Page language="c#" Codebehind="AlbumListing.aspx.cs"
AutoEventWireup="false" Inherits="ServerTransfer.AlbumListing" %>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
+
+<html>
+ <head>
+ <title>albumListing</title>
+ <meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
+ <meta name="CODE_LANGUAGE" Content="C#">
+ <meta name=vs_defaultClientScript content="JavaScript">
+ <meta name=vs_targetSchema
content="http://schemas.microsoft.com/intellisense/ie5">
+ </head>
+ <body MS_POSITIONING="GridLayout">
+
+ <form id="Form1" method="post" runat="server">
+
+ </form>
+
+ </body>
+</html>
Property changes on: trunk/gert/standalone/bug334931/web/AlbumListing.aspx
___________________________________________________________________
Name: svn:eol-style
+ native
Added: trunk/gert/standalone/bug334931/web/AlbumListing.aspx.cs
===================================================================
--- trunk/gert/standalone/bug334931/web/AlbumListing.aspx.cs 2007-10-18
16:59:20 UTC (rev 87767)
+++ trunk/gert/standalone/bug334931/web/AlbumListing.aspx.cs 2007-10-18
17:02:08 UTC (rev 87768)
@@ -0,0 +1,29 @@
+using System;
+using System.Collections;
+using System.ComponentModel;
+using System.Web;
+using System.Web.SessionState;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+using System.Web.UI.HtmlControls;
+
+namespace ServerTransfer
+{
+ public class AlbumListing : Page
+ {
+ void Page_Load(object sender, System.EventArgs e)
+ {
+ }
+
+ override protected void OnInit(EventArgs e)
+ {
+ InitializeComponent();
+ base.OnInit(e);
+ }
+
+ private void InitializeComponent()
+ {
+ Load += new EventHandler(Page_Load);
+ }
+ }
+}
Property changes on: trunk/gert/standalone/bug334931/web/AlbumListing.aspx.cs
___________________________________________________________________
Name: svn:eol-style
+ native
Added: trunk/gert/standalone/bug334931/web/AlbumRequestHandler.cs
===================================================================
--- trunk/gert/standalone/bug334931/web/AlbumRequestHandler.cs 2007-10-18
16:59:20 UTC (rev 87767)
+++ trunk/gert/standalone/bug334931/web/AlbumRequestHandler.cs 2007-10-18
17:02:08 UTC (rev 87768)
@@ -0,0 +1,23 @@
+using System;
+using System.IO;
+using System.Web;
+using System.Text;
+using System.Collections;
+
+namespace ServerTransfer
+{
+ public class AlbumRequestHandler : IHttpHandler
+ {
+ public void ProcessRequest (HttpContext context)
+ {
+ context.Server.Transfer ("~/AlbumListing.aspx?albumID="
+
+ Path.GetFileName (context.Request.FilePath));
+ }
+
+ public bool IsReusable {
+ get {
+ return true;
+ }
+ }
+ }
+}
Property changes on: trunk/gert/standalone/bug334931/web/AlbumRequestHandler.cs
___________________________________________________________________
Name: svn:eol-style
+ native
Added: trunk/gert/standalone/bug334931/web/albums/Web.config
===================================================================
--- trunk/gert/standalone/bug334931/web/albums/Web.config 2007-10-18
16:59:20 UTC (rev 87767)
+++ trunk/gert/standalone/bug334931/web/albums/Web.config 2007-10-18
17:02:08 UTC (rev 87768)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<configuration>
+ <system.web>
+ <httpHandlers>
+ <add verb="*" path="*.aspx" validate="false"
type="ServerTransfer.AlbumRequestHandler, ServerTransfer" />
+ </httpHandlers>
+ </system.web>
+</configuration>
Property changes on: trunk/gert/standalone/bug334931/web/albums/Web.config
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/gert/standalone/known-issues
===================================================================
--- trunk/gert/standalone/known-issues 2007-10-18 16:59:20 UTC (rev 87767)
+++ trunk/gert/standalone/known-issues 2007-10-18 17:02:08 UTC (rev 87768)
@@ -97,3 +97,4 @@
bug333342/**
bug333686/**
bug334453/**
+bug334931/**
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches