Views
2 years ago

DNDJ 3-6 June.indd - sys-con.com's archive of magazines - SYS ...

DNDJ 3-6 June.indd - sys-con.com's archive of magazines - SYS ...

Patterns and

Patterns and Practicesthat the events// can be hooked to remotelypublic class TestEventDispatcher :MarshalByRefObject{...// Event that is fired when a test is completedpublic event TestCompletedEventHandlerTestCompleted;public virtual void OnTestCompleted(TestResultEventArgs e){if (TestCompleted != null){//Invokes the delegates.TestCompleted(this, e);}}...}/// Code in Zanebug GUI// Hook to the TestCompleted event when a teststarts running// When the event is fired, it will call theUpdateTestNode method, passing in the TestResultTestEventDispatcher dispatcher = newTestEventDispatcher();dispatcher.TestCompleted += new TestCompletedEventHandler(this.UpdateTestNode);// This method updates the GUI, changing the teststatus to either Green, Red or Yellow// depending on the TestResult. Also incrementsthe progress bar by 1.private void UpdateTestNode(object sender,TestResultEventArgs e){lock(this){this.testSuiteTree.UpdateTestNode(this._current-TestAssembly.Name, e.TestResult);}}Listing 8: Logging to UDP with TraceTool and log4netListing 9: A Serializable TestAssemblyResult/// /// TestAssemblyResult contains the results for agiven TestAssembly/// after having been executed by the test engine.////// Itʼs marked as Serializable to allow for theobject to be sent/// accross remote boundaries in a stateless, valueobject form./// ///[Serializable]public class TestAssemblyResult : AbstractTestResult{protected string _assemblyName = “”;protected string _assemblyFullName = “”;protected string _location = null;protected DateTime _runTime = DateTime.Now;public TestAssemblyResult(TestAssembly ta){this.Name = ta.Name;}// The location of the TestAssemblypublic string Location{get { return this._location; }set { this._location = value; }}// The name of the assemblypublic string AssemblyName{get { return this._assemblyName; }set { this._assemblyName = value; }}// The full name of the assemblypublic string AssemblyFullName{get { return this._assemblyFullName; }set { this._assemblyFullName = value; }}// The time that the test was runpublic DateTime RunTime{get{return this._runTime;}set{this._runTime = value;}The source code and the remainder of}the listings are available by viewingthis article online at http://dotnet.}sys-con.com/read/issue/archives/(Vol: 3 Iss: 6)48June 2005 • dotnetdevelopersjournal.com

introductorysubscription offer!A TRULY INDEPENDENTVOICE IN THE WORLD OF .NET.NET Developer’s Journal is the leadingindependent monthly publication targeted at .NETdevelopers, particularly advanced developers. It brings.NET developers everything they need to know in orderto create great software.Publishedmonthly, .NETDeveloper’sJournal coverseverything of interest todevelopers working withMicrosoft .NET technologies– all from acompletely independentand nonbiased perspective.Articles are carefullyselected for their primetechnical content – technicaldetails aren’t watered down withSUBSCRIBE ONLINE!www.sys-con.com/dotnet/or Call1 888 303-5282Here’s what you’ll find inevery issue of .netdj:Security WatchMobile .NET.NET TrendsTech TipsStandards WatchBusiness Alerts.NET NewsBook and SoftwareAnnouncements.NET Developer’s Journal is for .NETdevelopers of all levels, especially those “inthe trenches” creating .NET code on a dailybasis:• For beginners:Each issue contains step-by-step tutorials.• For intermediate developers:There are more advanced articles.• For advanced .NET developers:In-depth technical articles and columnswritten by acknowledged .NET experts.Regardless of their experience level, .NETDeveloper’s Journal assumes that everyonereading it shares a common desire to understandas much about .NET – and the businessforces shaping it – as possible. Our aimis to help bring our reader-developers closerand closer to that goal with each and everynew issue!lots of needless opinion and commentary.Apart from the technical content, expert analystsand software industry commentators keep developersand their managers abreast of the businessforces influencing .NET’s rapid development.Wholly independent of both Microsoft Corporationand the other main players now shaping the course of.NET and Web services, .NET Developer’s Journalrepresents a constant, neutral, expert voice on thestate of .NET today – the good, the bad, and theugly…no exceptions.SAVE16%OFFTHE ANNUAL COVER PRICEGet 12 issues of .NETDJfor only $ 69 99 !OFFER SUBJECT TO CHANGE WITHOUT NOTICEANNUALCOVER PRICE:$83.88YOU PAY$69 99YOU SAVE$13.89OFF THE ANNUALCOVER PRICE

DNDJ February 3-2.indd - sys-con.com's archive of magazines ...
DNDJ 4-8.indd - sys-con.com's archive of magazines - SYS-CON ...
DNDJ 6-3 web.indd - sys-con.com's archive of magazines - SYS ...
DNDJ 6-4 web.indd - sys-con.com's archive of magazines - SYS ...
DNDJ 4-9.indd - sys-con.com's archive of magazines - SYS-CON ...
DNDJ 3-7 July.indd - sys-con.com's archive of magazines - SYS ...
DNDJ 6-3WEB.indd - sys-con.com's archive of magazines - SYS ...
DNDJ 3-11 Nov.indd - sys-con.com's archive of magazines - SYS ...
JDJ 10-10.indd - sys-con.com's archive of magazines - SYS-CON ...
JAVA Vol 3 Issue4 - sys-con.com's archive of magazines
Conclusion - sys-con.com's archive of magazines
jdjedge conference & expo - sys-con.com's archive of magazines ...
JDJ 10-6.indd - sys-con.com's archive of magazines - SYS-CON Media
issue 6 - sys-con.com's archive of magazines - SYS-CON Media
DNDJ 2-8.qxd - sys-con.com's archive of magazines - SYS-CON ...
SCOTT McNEALY - sys-con.com's archive of magazines - SYS-CON ...
LWM 3-12.indd - sys-con.com's archive of magazines - SYS-CON ...
Figure 1 - sys-con.com's archive of magazines - SYS-CON Media
LinuxWorld.com - sys-con.com's archive of magazines - SYS-CON ...
in PowerBuilder - sys-con.com's archive of magazines - SYS-CON ...
JDJ 10-12 Dec.indd - sys-con.com's archive of magazines
NET - sys-con.com's archive of magazines - SYS-CON Media
JDJ 12-1 Jan.indd - sys-con.com's archive of magazines - SYS-CON ...
CFDJ 8-5.indd - sys-con.com's archive of magazines - SYS-CON ...
JDJ 10-3.indd - sys-con.com's archive of magazines - SYS-CON Media
Download - sys-con.com's archive of magazines - SYS-CON Media
Download - sys-con.com's archive of magazines - SYS-CON Media
WebSphere vs WebLogic: - sys-con.com's archive of magazines ...
ISSJ 3-1.indd - sys-con.com's archive of magazines - SYS-CON Media