Update of /cvsroot/springnet/Spring.Net/test/Spring/Spring.Web.Tests/TestSupport
In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv733/TestSupport
Modified Files:
TestWebContext.cs
Log Message:
prepared for SPRNET-838
Index: TestWebContext.cs
===================================================================
RCS file: /cvsroot/springnet/Spring.Net/test/Spring/Spring.Web.Tests/TestSupport/TestWebContext.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** TestWebContext.cs 28 Nov 2007 23:26:27 -0000 1.2
--- TestWebContext.cs 21 Jan 2008 07:04:46 -0000 1.3
***************
*** 24,27 ****
--- 24,28 ----
using System.Collections.Specialized;
using System.IO;
+ using System.Threading;
using System.Web;
using System.Web.Hosting;
***************
*** 37,46 ****
{
private TextWriter _out;
!
public TestWebContext(string virtualPath, string page)
{
_out = new StringWriter();
! string physDir = AppDomain.CurrentDomain.BaseDirectory + "\\";
! HttpWorkerRequest wr = new SimpleWorkerRequest(virtualPath, physDir, page, string.Empty, _out);
HttpContext ctx = new HttpContext(wr);
HttpContext.Current = ctx;
--- 38,56 ----
{
private TextWriter _out;
! private HttpWorkerRequest _wr;
!
public TestWebContext(string virtualPath, string page)
{
_out = new StringWriter();
! HttpWorkerRequest wr;
! if (Thread.GetDomain().GetData(".appPath") != null)
! {
! wr = new SimpleWorkerRequest(page, string.Empty, _out);
! }
! else
! {
! string physDir = AppDomain.CurrentDomain.BaseDirectory + "\\";
! wr = new SimpleWorkerRequest(virtualPath, physDir, page, string.Empty, _out);
! }
HttpContext ctx = new HttpContext(wr);
HttpContext.Current = ctx;
***************
*** 51,54 ****
--- 61,70 ----
#endif
ctx.Request.Browser = browser;
+ _wr = wr;
+ }
+
+ public HttpWorkerRequest HttpWorkerRequest
+ {
+ get { return _wr; }
}
|