[Fat-develop] FAT/src/FAT.Web Default.aspx,1.2,1.3 Default.aspx.cs,1.2,1.3 DefaultPageModel.cs,1.3,1
Brought to you by:
exortech
|
From: <dmc...@pr...> - 2004-01-29 01:19:20
|
Update of /cvsroot/fat/FAT/src/FAT.Web In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13246/src/FAT.Web Modified Files: Default.aspx Default.aspx.cs DefaultPageModel.cs FAT.Web.csproj Global.asax.cs Web.config Log Message: Can now add HtmlDetails to TestLogger in FATFixtures. Details are dislayed in test results as clickable thumbnails in FAT.Web Index: Default.aspx =================================================================== RCS file: /cvsroot/fat/FAT/src/FAT.Web/Default.aspx,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Default.aspx 15 Jan 2004 00:56:58 -0000 1.2 --- Default.aspx 28 Jan 2004 22:14:48 -0000 1.3 *************** *** 1,4 **** <%@ Register Tagprefix="FAT" Namespace="FAT.Web" Assembly="FAT.Web" %> ! <%@ Page language="c#" Codebehind="Default.aspx.cs" AutoEventWireup="false" Inherits="FAT.Web.Default" %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > <HTML> --- 1,4 ---- <%@ Register Tagprefix="FAT" Namespace="FAT.Web" Assembly="FAT.Web" %> ! <%@ Page language="c#" Codebehind="Default.aspx.cs" AutoEventWireup="false" Inherits="FAT.Web.Default" EnableSessionState=true %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > <HTML> Index: Default.aspx.cs =================================================================== RCS file: /cvsroot/fat/FAT/src/FAT.Web/Default.aspx.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Default.aspx.cs 15 Jan 2004 00:56:58 -0000 1.2 --- Default.aspx.cs 28 Jan 2004 22:14:48 -0000 1.3 *************** *** 1,11 **** using FAT.Core; 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 FAT.Web --- 1,6 ---- using FAT.Core; + using FAT.Web.HtmlDetails; using System; using System.Web.UI.WebControls; namespace FAT.Web *************** *** 13,47 **** public class Default : System.Web.UI.Page { - protected Label instructions; - protected Label testNameLabel; protected TextBox testName; - protected Label testNameWarning; - protected Label fixtureLabel; protected TextBox fixture; - protected Label testLabel; protected TextBox test; - protected Label setupLabel; protected TextBox setup; - protected Label teardownLabel; protected TextBox teardown; protected Label fixtureWarning; protected Button run; protected PlaceHolder results; ! protected FAT.Web.TestTreeView TestTreeView1; ! protected System.Web.UI.WebControls.Label setUpLabel; ! protected System.Web.UI.WebControls.Label tearDownLabel; ! private DefaultPageModel model = new DefaultPageModel(); private void Page_Load(object sender, System.EventArgs e) { - fixtureWarning.Text = null; } private void Run_Click(object source, EventArgs args) { try { ITestResult testResult = model.Run(testName.Text, fixture.Text, test.Text, setup.Text, teardown.Text); ! results.Controls.Add(model.CreateResultsTable(testResult)); } catch (FATException ex) --- 8,35 ---- public class Default : System.Web.UI.Page { protected TextBox testName; protected TextBox fixture; protected TextBox test; protected TextBox setup; protected TextBox teardown; protected Label fixtureWarning; protected Button run; protected PlaceHolder results; ! private DefaultPageModel model; private void Page_Load(object sender, System.EventArgs e) { } private void Run_Click(object source, EventArgs args) { + model = new DefaultPageModel(); + fixtureWarning.Text = null; + try { ITestResult testResult = model.Run(testName.Text, fixture.Text, test.Text, setup.Text, teardown.Text); ! ! results.Controls.Add(model.CreateResultsTable(testResult, HtmlDetailsStore.Instance(new Session(Session)))); } catch (FATException ex) Index: DefaultPageModel.cs =================================================================== RCS file: /cvsroot/fat/FAT/src/FAT.Web/DefaultPageModel.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** DefaultPageModel.cs 20 Jan 2004 06:01:20 -0000 1.3 --- DefaultPageModel.cs 28 Jan 2004 22:14:48 -0000 1.4 *************** *** 1,6 **** --- 1,8 ---- using FAT.Core; using FAT.Core.Configuration; + using FAT.Web.HtmlDetails; using System; using System.Text; + using System.Web.UI; using System.Web.UI.WebControls; *************** *** 29,33 **** } ! public Table CreateResultsTable(ITestResult result) { Table table = new Table(); --- 31,35 ---- } ! public Table CreateResultsTable(ITestResult result, IHtmlDetailsStore htmlDetailsStore) { Table table = new Table(); *************** *** 44,56 **** { TableRow stepRow = new TableRow(); ! stepRow.Cells.Add(CreateImageCell(step.TestStatus)); stepRow.Cells.Add(CreateCell(step.Name)); stepRow.Cells.Add(CreateCell(step.TestStatus.ToString())); stepRow.Cells.Add(CreateCell(step.Message.ToString())); table.Rows.Add(stepRow); } return table; } private TableCell CreateHeaderCell(string header) { --- 46,73 ---- { TableRow stepRow = new TableRow(); ! stepRow.Cells.Add(CreateImageCell(CreateImageUrl(step.TestStatus))); stepRow.Cells.Add(CreateCell(step.Name)); stepRow.Cells.Add(CreateCell(step.TestStatus.ToString())); stepRow.Cells.Add(CreateCell(step.Message.ToString())); + stepRow.Cells.Add(CreateHtmlDetailsCell(step.HtmlDetailsLog, htmlDetailsStore)); table.Rows.Add(stepRow); } + return table; } + private TableCell CreateHtmlDetailsCell(HtmlDetailsLog HtmlDetailsLog, IHtmlDetailsStore htmlDetailsStore) + { + if (HtmlDetailsLog == null) + { + return CreateCell(""); + } + else + { + string id = htmlDetailsStore.Add(new HtmlDetailsEnhancer(HtmlDetailsLog.Url, HtmlDetailsLog.Html)); + return CreateImageHyperLinkCell(HtmlDetailsRequestHelper.CreateImageUrl(id), HtmlDetailsRequestHelper.CreateHtmlWithAbsoluteUrlsUrl(id)); + } + } + private TableCell CreateHeaderCell(string header) { *************** *** 67,76 **** } ! private TableCell CreateImageCell(TestStatus status) { Image image = new Image(); ! // image.ImageUrl = CreateImageUrl(status); TableCell cell = new TableCell(); ! cell.Controls.Add(image); return cell; } --- 84,109 ---- } ! private TableCell CreateImageCell(string url) { Image image = new Image(); ! image.ImageUrl = url; ! ! return CreateTableCell(image); ! } ! ! private TableCell CreateImageHyperLinkCell(string imageUrl, string clickUrl) ! { ! HyperLink image = new HyperLink(); ! image.NavigateUrl = clickUrl; ! image.ImageUrl = imageUrl; ! image.Target = "_blank"; ! ! return CreateTableCell(image); ! } ! ! private TableCell CreateTableCell(Control control) ! { TableCell cell = new TableCell(); ! cell.Controls.Add(control); return cell; } Index: FAT.Web.csproj =================================================================== RCS file: /cvsroot/fat/FAT/src/FAT.Web/FAT.Web.csproj,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** FAT.Web.csproj 15 Jan 2004 00:56:58 -0000 1.2 --- FAT.Web.csproj 28 Jan 2004 22:14:48 -0000 1.3 *************** *** 152,155 **** --- 152,225 ---- /> <File + RelPath = "HtmlDetails\HtmlDetailsEnhancer.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "HtmlDetails\HtmlDetailsRequestContext.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "HtmlDetails\HtmlDetailsRequestHandler.ashx" + SubType = "Code" + BuildAction = "Content" + /> + <File + RelPath = "HtmlDetails\HtmlDetailsRequestHelper.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "HtmlDetails\HtmlDetailsStore.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "HtmlDetails\IEnumIDList.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "HtmlDetails\IExtractImage.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "HtmlDetails\IHtmlDetailsRequestContext.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "HtmlDetails\IHtmlDetailsStore.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "HtmlDetails\ISession.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "HtmlDetails\IShellFolder.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "HtmlDetails\Session.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "HtmlDetails\Shell32.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "HtmlDetails\Shell32Exception.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "images\Green.jpg" BuildAction = "Content" Index: Global.asax.cs =================================================================== RCS file: /cvsroot/fat/FAT/src/FAT.Web/Global.asax.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Global.asax.cs 13 Dec 2003 00:09:02 -0000 1.1 --- Global.asax.cs 28 Jan 2004 22:14:48 -0000 1.2 *************** *** 1,2 **** --- 1,3 ---- + using FAT.Web.HtmlDetails; using System; using System.Collections; *************** *** 7,13 **** namespace FAT.Web { - /// <summary> - /// Summary description for Global. - /// </summary> public class Global : System.Web.HttpApplication { --- 8,11 ---- *************** *** 24,28 **** protected void Session_Start(Object sender, EventArgs e) { ! } --- 22,26 ---- protected void Session_Start(Object sender, EventArgs e) { ! HtmlDetailsStore.CreateInstance(new Session(Session)); } Index: Web.config =================================================================== RCS file: /cvsroot/fat/FAT/src/FAT.Web/Web.config,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Web.config 20 Jan 2004 06:01:20 -0000 1.3 --- Web.config 28 Jan 2004 22:14:48 -0000 1.4 *************** *** 8,15 **** <FAT> <Assemblies> ! <Assembly>D:\dev\FAT\build\FAT.Acceptance.dll</Assembly> </Assemblies> <TestPaths> ! <TestPath>D:\dev\FAT\sample\Calculator</TestPath> </TestPaths> </FAT> --- 8,15 ---- <FAT> <Assemblies> ! <Assembly>C:\dev\FAT\build\FAT.Acceptance.dll</Assembly> </Assemblies> <TestPaths> ! <TestPath>C:\dev\FAT\sample\Calculator</TestPath> </TestPaths> </FAT> |