Update of /cvsroot/springnet/Spring.Net/test/Spring/Spring.Web.Tests/Data/Spring/Web/Support/PageHandlerFactoryTests
In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv23425/test/Spring/Spring.Web.Tests/Data/Spring/Web/Support/PageHandlerFactoryTests
Added Files:
DisablesSession.aspx MaintainsSession1.aspx
MaintainsSession2.aspx TransferAfterSetResult.aspx
TransferAfterSetResultSave.aspx Web.Config.net-1.1
Web.Config.net-2.0
Log Message:
nant build script's variable ${nowarn.numbers.test} renamed to ${nowarn.numbers.test.default}
DataBindingPanel -> added design-time support (SPRNET-774)
DataBindingPanel -> added examples to SpringWebQuickstart "EasyEmplyeeInfo" (SPRNET-787)
integrated NUnitAspEx (SPRNET-788)
added PageHandlerFactory tests w.r.t. Server.Transfer() (SPRNET-763)
--- NEW FILE: Web.Config.net-2.0 ---
<?xml version="1.0"?>
<configuration>
<configSections>
<sectionGroup name="spring">
<section name="context" type="Spring.Context.Support.WebContextHandler, Spring.Web"/>
<section name="objects" type="Spring.Context.Support.DefaultSectionHandler, Spring.Core"/>
</sectionGroup>
<sectionGroup name="common">
<section name="logging" type="Common.Logging.ConfigurationSectionHandler, Common.Logging" />
</sectionGroup>
</configSections>
<!-- to see logging output in the attached debugger -->
<common>
<logging>
<factoryAdapter type="Common.Logging.Simple.TraceLoggerFactoryAdapter, Common.Logging">
<arg key="Level" value="ALL" />
</factoryAdapter>
</logging>
</common>
<system.web>
<compilation debug="true" />
<!--
The following needs to be configured in order to enable Spring.NET Web Framework features
-->
<httpModules>
<add name="SpringModule" type="Spring.Context.Support.WebSupportModule, Spring.Web"/>
<add name="NUnitAspExModule" type="NUnitAspEx.AspTestExecutionModule, NUnitAspEx" />
</httpModules>
<httpHandlers>
<add verb="*" path="*.aspx" type="Spring.Web.Support.PageHandlerFactory, Spring.Web"/>
<add verb="*" path="*.testmethod" type="NUnitAspEx.AspTestMethodHandler, NUnitAspEx" validate="false" />
</httpHandlers>
</system.web>
<!-- demonstrates how to configure IHttpModule instances -->
<spring>
<context>
<resource uri="config://spring/objects"/>
</context>
<objects xmlns="http://www.springframework.net">
<object type="TransferAfterSetResult.aspx">
<property name="Results">
<dictionary>
<entry key="save" value="transfer:TransferAfterSetResultSave.aspx" />
</dictionary>
</property>
</object>
<object type="TransferAfterSetResultSave.aspx"/>
</objects>
</spring>
</configuration>
--- NEW FILE: MaintainsSession1.aspx ---
<%@ Page language="c#" AutoEventWireup="false" Inherits="Spring.Web.UI.Page" %><script language="c#" runat="server">
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
Session["maintainsSession"] = "somevalue";
}
</script>OK
--- NEW FILE: MaintainsSession2.aspx ---
<%@ Page language="c#" AutoEventWireup="false" Inherits="Spring.Web.UI.Page" %><script language="c#" runat="server">
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
NUnit.Framework.Assert.AreEqual( "somevalue", Session["maintainsSession"] );
}
</script>OK
--- NEW FILE: TransferAfterSetResultSave.aspx ---
<%@ Page language="c#" AutoEventWireup="false" EnableViewStateMac="false" Inherits="Spring.Web.UI.Page" %>
<%@ Reference Page="TransferAfterSetResult.aspx" %>
<script language="c#" runat="server">
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
NUnit.Framework.Assert.AreEqual( typeof(TransferAfterSetResult), this.PreviousPage.GetType() );
}
</script>OK
--- NEW FILE: Web.Config.net-1.1 ---
<?xml version="1.0"?>
<configuration>
<configSections>
<sectionGroup name="spring">
<section name="context" type="Spring.Context.Support.WebContextHandler, Spring.Web"/>
<section name="objects" type="Spring.Context.Support.DefaultSectionHandler, Spring.Core"/>
</sectionGroup>
<sectionGroup name="common">
<section name="logging" type="Common.Logging.ConfigurationSectionHandler, Common.Logging" />
</sectionGroup>
</configSections>
<!-- to see logging output in the attached debugger -->
<common>
<logging>
<factoryAdapter type="Common.Logging.Simple.TraceLoggerFactoryAdapter, Common.Logging">
<arg key="Level" value="ALL" />
</factoryAdapter>
</logging>
</common>
<system.web>
<compilation debug="true" />
<!--
The following needs to be configured in order to enable Spring.NET Web Framework features
-->
<httpModules>
<add name="SpringModule" type="Spring.Context.Support.WebSupportModule, Spring.Web"/>
<add name="NUnitAspExModule" type="NUnitAspEx.AspTestExecutionModule, NUnitAspEx" />
</httpModules>
<httpHandlers>
<add verb="*" path="*.aspx" type="Spring.Web.Support.PageHandlerFactory, Spring.Web"/>
<add verb="*" path="*.testmethod" type="NUnitAspEx.AspTestMethodHandler, NUnitAspEx" validate="false" />
</httpHandlers>
</system.web>
<!-- demonstrates how to configure IHttpModule instances -->
<spring>
<context>
<resource uri="config://spring/objects"/>
</context>
<objects xmlns="http://www.springframework.net">
<!-- "PreviousPage" property does not exist in net-1.1
<object type="TransferAfterSetResult.aspx">
<property name="Results">
<dictionary>
<entry key="save" value="transfer:TransferAfterSetResultSave.aspx" />
</dictionary>
</property>
</object>
<object type="TransferAfterSetResultSave.aspx"/>
-->
</objects>
</spring>
</configuration>
--- NEW FILE: DisablesSession.aspx ---
<%@ Page language="c#" EnableSessionState="false" AutoEventWireup="false" Inherits="Spring.Web.UI.Page" %><script language="c#" runat="server">
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
try
{
Session["disablesSession"] = "somevalue";
NUnit.Framework.Assert.Fail("must not be able to access session");
}
catch(HttpException)
{}
}
</script>OK
--- NEW FILE: TransferAfterSetResult.aspx ---
<%@ Page language="c#" AutoEventWireup="false" Inherits="Spring.Web.UI.Page" ClassName="TransferAfterSetResult" %>
<script language="c#" runat="server">
private void Save_Clicked(object sender, EventArgs e)
{
SetResult("save");
}
</script>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>GuestBook</title>
</HEAD>
<body>
<form id="GuestBook" method="post" runat="server">
<p><b>Guest Book:</b></p>
<u>Enter your name:</u>
<table>
<tr><td>Name:</td><td><asp:textbox id="name" Runat="server"></asp:textbox></td></tr>
</table>
<asp:Button ID="save" Runat="server" Text="Save" OnClick="Save_Clicked"></asp:Button>
</form>
</body>
</HTML>
|