You can subscribe to this list here.
| 2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(142) |
Jun
(27) |
Jul
(122) |
Aug
(36) |
Sep
(59) |
Oct
(86) |
Nov
(140) |
Dec
(80) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(52) |
Feb
(153) |
Mar
(118) |
Apr
(143) |
May
(123) |
Jun
(64) |
Jul
(282) |
Aug
(469) |
Sep
(56) |
Oct
(201) |
Nov
(182) |
Dec
(31) |
| 2005 |
Jan
(229) |
Feb
(316) |
Mar
(187) |
Apr
(130) |
May
(190) |
Jun
(154) |
Jul
(148) |
Aug
(133) |
Sep
(209) |
Oct
(234) |
Nov
(100) |
Dec
(40) |
| 2006 |
Jan
(1) |
Feb
(87) |
Mar
(73) |
Apr
(126) |
May
(58) |
Jun
(8) |
Jul
(12) |
Aug
(14) |
Sep
(22) |
Oct
(33) |
Nov
(4) |
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
1
|
2
(2) |
3
(26) |
4
(15) |
5
|
6
|
7
|
|
8
|
9
|
10
(7) |
11
(31) |
12
(1) |
13
|
14
|
|
15
|
16
(4) |
17
|
18
(16) |
19
(10) |
20
|
21
|
|
22
(12) |
23
(22) |
24
(4) |
25
|
26
(1) |
27
|
28
(2) |
|
29
|
|
|
|
|
|
|
|
From: <cta...@us...> - 2004-02-28 20:13:05
|
Update of /cvsroot/ccnet/ccnet/project/core/sourcecontrol/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16691/project/core/sourcecontrol/test Modified Files: PvcsTest.cs Log Message: [Test] method attributes used instead of starting methods with "test" Index: PvcsTest.cs =================================================================== RCS file: /cvsroot/ccnet/ccnet/project/core/sourcecontrol/test/PvcsTest.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** PvcsTest.cs 23 Feb 2004 05:18:12 -0000 1.8 --- PvcsTest.cs 28 Feb 2004 19:55:27 -0000 1.9 *************** *** 1,3 **** --- 1,4 ---- using Exortech.NetReflector; + using NMock; using NUnit.Framework; using System; *************** *** 23,46 **** // Daylight savings time bug - // Comment this test in and forward system time to appropriate date - // to veryify daylight saving time detected. // This was necessary to resolve a bug with PVCS 7.5.1 (would not properly ! // detected modifications during periods where daylight savings was active) ! [Ignore("Date dependent test due to day light savings time bug in PVCS v7.5.1")] ! public void TestDetectedDayLightSavingsTime_PVCSDayLightSavingsBug() { Pvcs pvcs = new Pvcs(); ! Assert(pvcs.IsDayLightSavings()); } ! ! public void TestSubtractAnHour_PVCSDayLightSavingsBug() ! { Pvcs pvcs = new Pvcs(); ! DateTime date1 = new DateTime(2000, 1, 1, 1, 0, 0); ! DateTime anHourAgo = new DateTime(2000, 1, 1, 0, 0, 0); ! AssertEquals(anHourAgo, pvcs.SubtractAnHour(date1)); } ! public void TestValuePopulation() { Pvcs pvcs = CreatePvcs(); --- 24,53 ---- // Daylight savings time bug // This was necessary to resolve a bug with PVCS 7.5.1 (would not properly ! // detect modifications during periods where daylight savings was active) ! [Test] ! public void AdjustForDayLightSavingsBugDuringDayLightSavings() { Pvcs pvcs = new Pvcs(); ! TimeZone timeZoneWhereItIsAlwaysDayLightSavings = CreateMockTimeZone(true); ! pvcs.CurrentTimeZone = timeZoneWhereItIsAlwaysDayLightSavings; ! ! DateTime date = new DateTime(2000, 1, 1, 1, 0, 0); ! DateTime anHourBefore = new DateTime(2000, 1, 1, 0, 0, 0); ! AssertEquals(anHourBefore, pvcs.AdjustForDayLightSavingsBug(date)); } ! [Test] ! public void AdjustForDayLightSavingsBugOutsideDayLightSavings() ! { Pvcs pvcs = new Pvcs(); ! TimeZone timeZoneWhereItIsNeverDayLightSavings = CreateMockTimeZone(false); ! pvcs.CurrentTimeZone = (TimeZone) timeZoneWhereItIsNeverDayLightSavings; ! ! DateTime date = new DateTime(2000, 1, 1, 1, 0, 0); ! AssertEquals(date, pvcs.AdjustForDayLightSavingsBug(date)); } ! [Test] ! public void ValuePopulation() { Pvcs pvcs = CreatePvcs(); *************** *** 50,54 **** } ! public void TestCreateProcess() { Pvcs pvcs = CreatePvcs(); --- 57,62 ---- } ! [Test] ! public void CreateProcess() { Pvcs pvcs = CreatePvcs(); *************** *** 69,74 **** // TODO: stop cmd window from popping up with this test!!! [Ignore("Sort out mockpcli stuff")] ! public void TestGetModifications() { Pvcs pvcs = CreatePvcs(); --- 77,83 ---- // TODO: stop cmd window from popping up with this test!!! + [Test] [Ignore("Sort out mockpcli stuff")] ! public void GetModifications() { Pvcs pvcs = CreatePvcs(); *************** *** 80,84 **** } ! public void TestCreatePcliContents() { Pvcs pvcs = CreatePvcs(); --- 89,94 ---- } ! [Test] ! public void CreatePcliContents() { Pvcs pvcs = CreatePvcs(); *************** *** 91,95 **** { return ! @"set -vProject ""fooproject"" set -vSubProject ""barsub"" run ->pvcstemp.txt listversionedfiles -z -aw $Project $SubProject --- 101,105 ---- { return ! @"set -vProject ""fooproject"" set -vSubProject ""barsub"" run ->pvcstemp.txt listversionedfiles -z -aw $Project $SubProject *************** *** 97,101 **** "; } ! } ! } --- 107,117 ---- "; } ! ! private TimeZone CreateMockTimeZone(Boolean inDayLightSavings) ! { ! Mock mock = new DynamicMock(typeof(TimeZone)); ! mock.ExpectAndReturn("IsDaylightSavingTime", inDayLightSavings); ! return (TimeZone) mock.MockInstance; ! } ! } } |
|
From: <cta...@us...> - 2004-02-28 20:12:13
|
Update of /cvsroot/ccnet/ccnet/project/core/sourcecontrol In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16382/project/core/sourcecontrol Modified Files: Pvcs.cs Log Message: Refactoring of Daylight Savings bugfix to get it under test Index: Pvcs.cs =================================================================== RCS file: /cvsroot/ccnet/ccnet/project/core/sourcecontrol/Pvcs.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Pvcs.cs 23 Feb 2004 05:18:12 -0000 1.8 --- Pvcs.cs 28 Feb 2004 19:54:41 -0000 1.9 *************** *** 29,34 **** private string _arguments = COMMAND; private string _instructions = INSTRUCTIONS_TEMPLATE; - [ReflectorProperty("executable")] public string Executable --- 29,34 ---- private string _arguments = COMMAND; private string _instructions = INSTRUCTIONS_TEMPLATE; + private TimeZone _currentTimeZone = TimeZone.CurrentTimeZone; [ReflectorProperty("executable")] public string Executable *************** *** 66,69 **** --- 66,74 ---- } + public TimeZone CurrentTimeZone + { + set{ _currentTimeZone = value;} + } + protected override IHistoryParser HistoryParser { *************** *** 74,82 **** { // required due to DayLightSavings bug in PVCS 7.5.1 ! if (IsDayLightSavings()) ! { ! from = SubtractAnHour(from); ! to = SubtractAnHour(to); ! } string content = CreatePcliContents( --- 79,84 ---- { // required due to DayLightSavings bug in PVCS 7.5.1 ! from = AdjustForDayLightSavingsBug(from); ! to = AdjustForDayLightSavingsBug(to); string content = CreatePcliContents( *************** *** 120,135 **** } ! public Boolean IsDayLightSavings() ! { ! TimeZone tz = TimeZone.CurrentTimeZone; ! return tz.IsDaylightSavingTime(DateTime.Now); ! } ! ! public DateTime SubtractAnHour(DateTime date) { ! TimeSpan anHour = new TimeSpan(1, 0, 0); ! return date.Subtract(anHour); } - } } --- 122,134 ---- } ! public DateTime AdjustForDayLightSavingsBug(DateTime date) { ! if(_currentTimeZone.IsDaylightSavingTime(DateTime.Now)) ! { ! TimeSpan anHour = new TimeSpan(1, 0, 0); ! return date.Subtract(anHour); ! } ! return date; } } } |
|
From: <mg...@us...> - 2004-02-26 17:15:51
|
Update of /cvsroot/ccnet/ccnet/project/core/sourcecontrol In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4514/project/core/sourcecontrol Modified Files: Svn.cs Log Message: Subversion tagging support fixed, and should now take notice of tagOnSuccess setting to disable tagging. Index: Svn.cs =================================================================== RCS file: /cvsroot/ccnet/ccnet/project/core/sourcecontrol/Svn.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Svn.cs 23 Feb 2004 05:18:12 -0000 1.4 --- Svn.cs 26 Feb 2004 16:59:56 -0000 1.5 *************** *** 10,14 **** { internal readonly static string HISTORY_COMMAND_FORMAT = "log -v -r \"{{{0}}}:{{{1}}}\" --xml {2}"; ! internal readonly static string TAG_COMMAND_FORMAT = "copy {0} {1}"; internal readonly static string COMMAND_DATE_FORMAT = "yyyy-MM-ddTHH:mm:ssZ"; --- 10,14 ---- { internal readonly static string HISTORY_COMMAND_FORMAT = "log -v -r \"{{{0}}}:{{{1}}}\" --xml {2}"; ! internal readonly static string TAG_COMMAND_FORMAT = "copy -m \"CCNET build {0}\" {1} {2}"; internal readonly static string COMMAND_DATE_FORMAT = "yyyy-MM-ddTHH:mm:ssZ"; *************** *** 72,76 **** public override ProcessInfo CreateLabelProcessInfo(string label, DateTime timeStamp) { ! return new ProcessInfo(Executable, BuildTagProcessArgs(label)); } --- 72,83 ---- public override ProcessInfo CreateLabelProcessInfo(string label, DateTime timeStamp) { ! if(TagOnSuccess) ! { ! return new ProcessInfo(Executable, BuildTagProcessArgs(label)); ! } ! else ! { ! return null; ! } } *************** *** 82,86 **** internal string BuildTagProcessArgs(string label) { string tagUrl = _tagBaseUrl + "/" + label; ! return string.Format(TAG_COMMAND_FORMAT, _trunkUrl, tagUrl); } } --- 89,93 ---- internal string BuildTagProcessArgs(string label) { string tagUrl = _tagBaseUrl + "/" + label; ! return string.Format(TAG_COMMAND_FORMAT, label, _trunkUrl, tagUrl); } } |
|
From: <mik...@us...> - 2004-02-24 22:31:54
|
Update of /cvsroot/ccnet/ccnet/project/core/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6481/project/core/test Modified Files: LogFileTest.cs Log Message: Setting default start time to 1st Jan 1980, rather than DateTime(0). This is for (at least) Subversion support Index: LogFileTest.cs =================================================================== RCS file: /cvsroot/ccnet/ccnet/project/core/test/LogFileTest.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** LogFileTest.cs 2 Dec 2003 15:45:55 -0000 1.5 --- LogFileTest.cs 24 Feb 2004 22:17:24 -0000 1.6 *************** *** 173,177 **** public void TestCreateUrl() { ! string expected = "?log=log00010101000000Lbuild.0.xml"; string actual = LogFileUtil.CreateUrl(CreateIntegrationResult(IntegrationStatus.Success, new DateTime(2002, 02, 22, 12, 00, 00))); AssertEquals(expected, actual); --- 173,177 ---- public void TestCreateUrl() { ! string expected = "?log=log19800101000000Lbuild.0.xml"; string actual = LogFileUtil.CreateUrl(CreateIntegrationResult(IntegrationStatus.Success, new DateTime(2002, 02, 22, 12, 00, 00))); AssertEquals(expected, actual); *************** *** 191,195 **** public void TestCreateUrl_FailedBuild() { ! string expected = "?log=log00010101000000.xml"; string actual = LogFileUtil.CreateUrl(CreateIntegrationResult(IntegrationStatus.Failure, new DateTime(2002, 02, 22, 12, 00, 00))); AssertEquals(expected, actual); --- 191,195 ---- public void TestCreateUrl_FailedBuild() { ! string expected = "?log=log19800101000000.xml"; string actual = LogFileUtil.CreateUrl(CreateIntegrationResult(IntegrationStatus.Failure, new DateTime(2002, 02, 22, 12, 00, 00))); AssertEquals(expected, actual); |
|
From: <mik...@us...> - 2004-02-24 22:31:54
|
Update of /cvsroot/ccnet/ccnet/project/core/publishers/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6481/project/core/publishers/test Modified Files: EmailPublisherTest.cs XmlLogPublisherTest.cs Log Message: Setting default start time to 1st Jan 1980, rather than DateTime(0). This is for (at least) Subversion support Index: EmailPublisherTest.cs =================================================================== RCS file: /cvsroot/ccnet/ccnet/project/core/publishers/test/EmailPublisherTest.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** EmailPublisherTest.cs 2 Dec 2003 15:45:55 -0000 1.9 --- EmailPublisherTest.cs 24 Feb 2004 22:17:23 -0000 1.10 *************** *** 73,77 **** _publisher.IncludeDetails = false; string message = _publisher.CreateMessage(CreateIntegrationResult(IntegrationStatus.Success, IntegrationStatus.Success)); ! AssertEquals(@"CruiseControl.NET Build Results for project Project#9 (http://localhost/ccnet?log=log00010101000000Lbuild.0.xml)", message); } --- 73,77 ---- _publisher.IncludeDetails = false; string message = _publisher.CreateMessage(CreateIntegrationResult(IntegrationStatus.Success, IntegrationStatus.Success)); ! AssertEquals(@"CruiseControl.NET Build Results for project Project#9 (http://localhost/ccnet?log=log19800101000000Lbuild.0.xml)", message); } Index: XmlLogPublisherTest.cs =================================================================== RCS file: /cvsroot/ccnet/ccnet/project/core/publishers/test/XmlLogPublisherTest.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** XmlLogPublisherTest.cs 14 Dec 2003 13:28:35 -0000 1.9 --- XmlLogPublisherTest.cs 24 Feb 2004 22:17:23 -0000 1.10 *************** *** 198,202 **** { IntegrationResult result = CreateIntegrationResult(IntegrationStatus.Failure, true); ! string expected = "log00010101000000.xml"; AssertEquals(expected, _publisher.GetFilename(result)); } --- 198,202 ---- { IntegrationResult result = CreateIntegrationResult(IntegrationStatus.Failure, true); ! string expected = "log19800101000000.xml"; AssertEquals(expected, _publisher.GetFilename(result)); } *************** *** 205,209 **** { IntegrationResult result = CreateIntegrationResult(IntegrationStatus.Success, true); ! string expected = "log00010101000000Lbuild.1.xml"; AssertEquals(expected, _publisher.GetFilename(result)); } --- 205,209 ---- { IntegrationResult result = CreateIntegrationResult(IntegrationStatus.Success, true); ! string expected = "log19800101000000Lbuild.1.xml"; AssertEquals(expected, _publisher.GetFilename(result)); } |
|
From: <mik...@us...> - 2004-02-24 22:31:54
|
Update of /cvsroot/ccnet/ccnet/project/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6481/project/core Modified Files: IntegrationResult.cs Log Message: Setting default start time to 1st Jan 1980, rather than DateTime(0). This is for (at least) Subversion support Index: IntegrationResult.cs =================================================================== RCS file: /cvsroot/ccnet/ccnet/project/core/IntegrationResult.cs,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** IntegrationResult.cs 11 Feb 2004 07:01:21 -0000 1.10 --- IntegrationResult.cs 24 Feb 2004 22:17:24 -0000 1.11 *************** *** 20,25 **** string _label; string _output; ! DateTime _startTime; ! DateTime _endTime; Exception _exception; --- 20,25 ---- string _label; string _output; ! DateTime _startTime = new DateTime(1980, 1, 1); ! DateTime _endTime = new DateTime(1980, 1, 1); Exception _exception; |
|
From: <mik...@us...> - 2004-02-24 12:22:45
|
Update of /cvsroot/ccnet/ccnet/doc/cctray In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28731/doc/cctray Modified Files: index.html Log Message: minor doc update Index: index.html =================================================================== RCS file: /cvsroot/ccnet/ccnet/doc/cctray/index.html,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** index.html 10 Nov 2003 12:07:48 -0000 1.3 --- index.html 24 Feb 2004 12:08:23 -0000 1.4 *************** *** 137,142 **** <p class="Question">I've found a bug. Who can I tell?</p> ! <p class="Answer">Please send bug reports to the CCNet developer mailing list: ! <a href="mailto:ccn...@li...">ccn...@li...</a>.</p> <p> </p> --- 137,142 ---- <p class="Question">I've found a bug. Who can I tell?</p> ! <p class="Answer">Please send help requests to the CCNet user mailing list: ! <a href="mailto:ccn...@li...">ccn...@li...</a>.</p> <p> </p> |
|
From: <exo...@us...> - 2004-02-23 10:34:45
|
Update of /cvsroot/ccnet/website/site In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9087/site Modified Files: default.html download.html projectDetails.html Log Message: updating site docs Index: default.html =================================================================== RCS file: /cvsroot/ccnet/website/site/default.html,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** default.html 13 Jan 2004 17:32:15 -0000 1.4 --- default.html 23 Feb 2004 10:21:23 -0000 1.5 *************** *** 1,84 **** <h2>CruiseControl.NET</h2> <p> ! CruiseControl.NET is an automated Continuous Integration server for the ! Microsoft .NET platform. It is a functional port of the Java-based <a href="http://cruisecontrol.sourceforge.net"> ! CruiseControl</a> to the .NET platform. </p> ! <br> <h2>Key Features</h2> <ul> ! <li> ! CruiseControl.NET provides the benefits of automated <a href="http://www.martinfowler.com/articles/continuousIntegration.html"> ! Continuous Integration</a> ! to .NET projects. ! <li> ! Integration with <a href="http://nant.sf.net">Nant</a> and <a href="http://www.nunit.org/"> ! NUnit</a>. ! <li> ! Integration with major open source and proprietory Source Control systems: ! <ul> ! <li> ! CVS ! <li> ! Subversion ! <li> ! VSS ! <li> ! Perforce ! <li> ! StarTeam ! <li> ! PVCS</li> ! </ul> ! <li> ! Multiple visibility options: ! <ul> ! <li> ! ASP.NET enabled Web Applications ! <li> ! HTML and plain-text email ! <li> ! System Tray notification</li> ! </ul> ! <li> ! Customization options through pluggable architecture and source code ! availability.</li> </ul> <h2>Getting Started</h2> <ol> ! <li> ! <a href="?page=download.html">Download</a> ! CruiseControl.NET ! <li> ! Read the documentation <a href="docs/">online</a> or in the downloaded release</li> </ol> ! <br> <h2>News</h2> ! <H4>13th January 2004</H4> ! <p> ! CruiseControl.NET 0.4.2 now available - check the <a href="?page=download.html"> Download</a> page. ! This is <a href="http://ccnetlive.thoughtworks.com/CCNet-builds/85/">build 85</a> ! from <a href="http://ccnetlive.thoughtworks.com/ccnet">CCNetLive</a>, and a distribution fix for 0.4.1. ! Please feedback any bugs / documentation problems to the ccnet-user mailing list. ! </p> ! <H4>28th December 2003</H4> ! <p> ! CruiseControl.NET 0.4.1 now available - check the <a href="?page=download.html"> Download</a> page. ! This is <a href="http://ccnetlive.thoughtworks.com/CCNet-builds/81/">build 81</a> ! from <a href="http://ccnetlive.thoughtworks.com/ccnet">CCNetLive</a>. ! Please feedback any bugs / documentation problems to the ccnet-user mailing list. ! </p> ! <H4>25th November 2003</H4> ! <p> ! CruiseControl.NET 0.4 now available - check the <a href="?page=download.html"> Download</a> page. ! This is <a href="http://ccnetlive.thoughtworks.com/CCNet-builds/60/">build 60</a> ! from <a href="http://ccnetlive.thoughtworks.com/ccnet">CCNetLive</a>. ! Please feedback any bugs / documentation problems to the ccnet-user mailing list. ! <H4>30th July 2003</H4> ! <p>CruiseControl.NET now runs against itself, and produces published ! distributions for every successful build. Check it out at <a href="http://ccnetlive.thoughtworks.com/"> ! http://ccnetlive.thoughtworks.com/</a></p> ! <br> <h2>ThoughtWorks powered</h2> ! <p>CruiseControl.NET is developed by <a href="http://www.thoughtworks.com">ThoughtWorks</a>: ! leaders in Agile Software Development</p> --- 1,54 ---- <h2>CruiseControl.NET</h2> <p> ! CruiseControl.NET is an automated Continuous Integration server for the Microsoft .NET platform. ! It is a functional port of the Java-based <a href="http://cruisecontrol.sourceforge.net">CruiseControl</a> ! to the .NET platform. </p> ! <br/> <h2>Key Features</h2> <ul> ! <li>CruiseControl.NET provides the benefits of automated ! <a href="http://www.martinfowler.com/articles/continuousIntegration.html">Continuous Integration</a> to .NET projects.</li> ! <li>Integration with <a href="http://nant.sf.net"/>Nant</a> and <a href="http://www.nunit.org/">NUnit</a>.</li> ! <li>Integration with major open source and proprietory Source Control systems: ! <ul> ! <li>CVS</li> ! <li>VSS</li> ! <li>Perforce</li> ! <li>StarTeam</li> ! <li>PVCS</li> ! </ul> ! </li> ! <li>Multiple visibility options: ! <ul> ! <li>ASP.NET enabled Web Application</li> ! <li>HTML and plain-text email</li> ! <li>System Tray notification</li> ! </ul> ! </li> ! <li>Customization options through pluggable architecture and source code availability. </ul> + + <h2>Getting Started</h2> <ol> ! <li><a href="?page=download.html">Download</a> CruiseControl.NET</li> ! <li>Read the documentation <a href="docs/">online</a> or in the downloaded release</li> </ol> ! <br/> ! <h2>News</h2> ! ! <h4>30th July 2003</h4> ! <p>CruiseControl.NET now runs against itself, and produces published distributions for every successful build. Check it out at <a href="http://ccnetlive.thoughtworks.com/">http://ccnetlive.thoughtworks.com/</a></p> ! ! <h4>28th July 2003</h4> ! <p>CruiseControl.NET 0.4 pre-release is now available - check the <a href="?page=download.html">Download</a> page</p> ! ! <h4>8th June 2003</h4> ! <p>Website and documentation updates - documentation is now available <a href="docs/">online</a>.</p> ! ! <br/> ! <h2>ThoughtWorks powered</h2> ! <p>CruiseControl.NET is developed by <a href="http://www.thoughtworks.com">ThoughtWorks</a>: leaders in Agile Software Development</p> \ No newline at end of file Index: download.html =================================================================== RCS file: /cvsroot/ccnet/website/site/download.html,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** download.html 13 Jan 2004 17:32:15 -0000 1.4 --- download.html 23 Feb 2004 10:21:23 -0000 1.5 *************** *** 3,40 **** <p>CruiseControl.NET Beta Releases are available at this time</p> ! <p><b>NB: If you are upgrading from version 0.3.x to 0.4.x you need to update your ccnet.config file. You should backup your old CCNet builder and web folders before upgrading. Details ! on how to setup your ccnet.config file are available in the documentation included in the distributions.</b></p> ! ! <h4>CruiseControl.NET 0.4.2 (<a href="http://ccnetlive.thoughtworks.com/ccnet">CCNetLive</a> <a href="http://ccnetlive.thoughtworks.com/CCNet-builds/85/">build 85</a>)</h4> ! <ul> ! <li><a href="releases/0.4.2/CruiseControl.NET.zip">Binary distribution</a></li> ! <li><a href="releases/0.4.2/CruiseControl.NET.source.zip">Source Distribution</a></li> ! </ul> ! <p>Release 0.4.2 contains the following change over 0.4.1: ! <ul> ! <li>CCNet service executable now included</li> ! </ul> ! </p> ! <br /> ! <h4>CruiseControl.NET 0.4.1 (<a href="http://ccnetlive.thoughtworks.com/ccnet">CCNetLive</a> <a href="http://ccnetlive.thoughtworks.com/CCNet-builds/81/">build 81</a>)</h4> ! <ul> ! <li><a href="releases/0.4.1/CruiseControl.NET.zip">Binary distribution</a></li> ! <li><a href="releases/0.4.1/CruiseControl.NET.source.zip">Source Distribution</a></li> ! </ul> ! <p>Release 0.4.1 contains the following improvements over 0.4: <ul> ! <li>More configurable labelling</li> ! <li>Support for 'Subversion' Source Control</li> ! <li>Workaround for builds that generate invalid xml files (including those calling out to 'devenv')</li> ! <li>Various documentation updates</li> </ul> </p> ! <br /> ! <h4>CruiseControl.NET 0.4 (<a href="http://ccnetlive.thoughtworks.com/ccnet">CCNetLive</a> <a href="http://ccnetlive.thoughtworks.com/CCNet-builds/60/">build 60</a>)</h4> ! <ul> ! <li><a href="releases/0.4/CruiseControl.NET.zip">Binary distribution</a></li> ! <li><a href="releases/0.4/CruiseControl.NET.source.zip">Source Distribution</a></li> ! </ul> ! <br /> <h4>CruiseControl.NET 0.3.1</h4> <ul> --- 3,15 ---- <p>CruiseControl.NET Beta Releases are available at this time</p> ! <h4>CruiseControl.NET 0.4 (CCNetLive Build 60)</h4> <ul> ! <li><a href="http://prdownloads.sourceforge.net/ccnet/CruiseControl.NET.zip?download">Binary distribution</a></li> ! <li><a href="http://prdownloads.sourceforge.net/ccnet/CruiseControl.NET.source.zip?download">Source Distribution</a></li> </ul> + <p> + <b>NB: CCNet 0.4 requires you to update your config file - make sure you check the documentation. You should also backup your old CCNet builder and web folders</b> </p> ! <br/> <h4>CruiseControl.NET 0.3.1</h4> <ul> *************** *** 43,46 **** </ul> <br/> ! <p>For the very latest development builds, go to <a href="http://ccnetlive.thoughtworks.com/ccnet-builds">http://ccnetlive.thoughtworks.com/ccnet-builds</a> ! --- 18,20 ---- </ul> <br/> ! <p>For the very latest (but maybe less stable builds), go to <a href="http://ccnetlive.thoughtworks.com/ccnet-builds">http://ccnetlive.thoughtworks.com/ccnet-builds</a> \ No newline at end of file Index: projectDetails.html =================================================================== RCS file: /cvsroot/ccnet/website/site/projectDetails.html,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** projectDetails.html 9 Jun 2003 15:07:53 -0000 1.1 --- projectDetails.html 23 Feb 2004 10:21:23 -0000 1.2 *************** *** 65,68 **** --- 65,78 ---- <li>Mike Two</li> <li>Mike Roberts</li> + <li>Mike Mason</li> + <li>Ajey Gore</li> + <li>Chris Brown</li> + <li>Jeremy Stell-Smith</li> + <li>John Sullivan</li> + <li>Mike Royle</li> + <li>Ryan Moffat</li> + <li>Shen Tham</li> + <li>Sreekanth Vadagiri</li> + <li>Bill Caputo</li> </ul> We have no formal procedures at present for membership of this team and we we expect people to rotate in and out. |
|
From: <exo...@us...> - 2004-02-23 10:08:44
|
Update of /cvsroot/ccnet/ccnet/doc/server In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4345/doc/server Modified Files: ccnet.config.html management.html Added Files: fxcop.html Log Message: updated some ccnet documents --- NEW FILE: fxcop.html --- <html> <head> <title>FxCop and CruiseControl.NET</title> <link type="text/css" rel="stylesheet" href="../cruisecontrol.css"/> </head> <body> <h1>Getting FxCop to work with CruiseControl.NET</h1> <img align="right" src="../images/ccnet_logo_onwhite.gif" /> Follow the steps below to getfxcop results working and displayed in the ccnet web app: <ol> <li>include a call to FxCopCmd as an <exec> task in your nant build file like so: <pre> <target name="fxcop" depends="compile"> <exec program="D:\Program Files\Microsoft FxCop 1.23\FxCopCmd.exe" commandline="/p:Mutant1.fxcop /o:build\Mutant1.FxCop.xml" failonerror="false" /> </target> </pre> <ul> <li>note that it is important to include the '/o' flag to specify that you want fxcop to produce an xml report.</li> <li>also note that it is important to include the 'failonerror' attribute</li> </ul> <p/> </li> <li>merge the fxcop log file into the ccnet build log by setting up the <xmlLogger> element like this: <pre> <xmllogger> <logDir>..\web\log</logDir> <mergeFiles> <file>..\..\Mutant1\build\Mutant1.exe-results.xml</file> <file>..\..\Mutant1\build\Mutant1.FxCop.xml</file> </mergeFiles> </xmllogger> </pre> </li> <li>browse to the ccnet web app, click the FxCop link and the view the results of your fxcop report.</li> </ol> </body> </html> Index: ccnet.config.html =================================================================== RCS file: /cvsroot/ccnet/ccnet/doc/server/ccnet.config.html,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ccnet.config.html 28 Dec 2003 22:07:39 -0000 1.4 --- ccnet.config.html 23 Feb 2004 09:55:20 -0000 1.5 *************** *** 248,263 **** type <span style="FONT-STYLE: italic">(mandatory) </span>- For now we just support ! Nant, so you must set this as "nant" <li> executable <span style="FONT-STYLE: italic">(mandatory)</span> - The location of the nant.exe you want to use (it can be absolute, or relative ! to folder ccnet.exe is in.) Often this is set to a version of Nant that is checked into Source Control with your project.<br> <li> baseDirectory <span style="FONT-STYLE: italic">(mandatory)</span> ! - The directory you want Nant to be started in (normally the root directory of ! your project if that's where you store your Nant build files) <li> buildFile --- 248,263 ---- type <span style="FONT-STYLE: italic">(mandatory) </span>- For now we just support ! NAnt, so you must set this as "nant" <li> executable <span style="FONT-STYLE: italic">(mandatory)</span> - The location of the nant.exe you want to use (it can be absolute, or relative ! to folder ccnet.exe is in.) Often this is set to a version of NAnt that is checked into Source Control with your project.<br> <li> baseDirectory <span style="FONT-STYLE: italic">(mandatory)</span> ! - The directory you want NAnt to be started in (normally the root directory of ! your project if that's where you store your NAnt build files) <li> buildFile *************** *** 268,283 **** buildArgs <span style="FONT-STYLE: italic">(optional)</span> ! - You can use the 'buildArgs' tag to pass through any parameters to Nant. This ! is useful if you want to define some Nant properties, e.g. in the example we ! pass through the location of a CVS executable as a Nant property called ! 'cvs.executable' <li> targetList <span style="FONT-STYLE: italic">(optional) - </span>A set of targets to be ! called. If you don't specifiy at least one, Nant will use the project's default ! target. CruiseControl.NET does not call Nant once for each target, it just ! specifies all the targets when it calls Nant the one time for the build, so semantically specifying more than one target is the same as manually running ! Nant yourself with more than one target. <li> buildTimeout --- 268,286 ---- buildArgs <span style="FONT-STYLE: italic">(optional)</span> ! - You can use the 'buildArgs' tag to pass through any parameters to NAnt. This ! is useful if you want to define some NAnt properties, e.g. in the example we ! pass through the location of a CVS executable as a NAnt property called ! 'cvs.executable'. If you do specify this element, you should ensure that you ! include the following argument: <code>-logger:NAnt.Core.XmlLogger</code>. ! This argument is supplied to NAnt by default to instruct it to use the Xml logger. ! By specifying buildArgs elements, you are overriding the default argument. <li> targetList <span style="FONT-STYLE: italic">(optional) - </span>A set of targets to be ! called. If you don't specifiy at least one, NAnt will use the project's default ! target. CruiseControl.NET does not call NAnt once for each target, it just ! specifies all the targets when it calls NAnt the one time for the build, so semantically specifying more than one target is the same as manually running ! NAnt yourself with more than one target. <li> buildTimeout *************** *** 285,289 **** indicate the maximum amount of time in milliseconds CruiseControl.NET should wait for the build to finish. If you leave this element out, or set it to 0, ! then CruiseControl.NET will wait indefinitely for Nant to finish (so if Nant 'hangs', so will CruiseControl.NET)<br> </li> --- 288,292 ---- indicate the maximum amount of time in milliseconds CruiseControl.NET should wait for the build to finish. If you leave this element out, or set it to 0, ! then CruiseControl.NET will wait indefinitely for NAnt to finish (so if NAnt 'hangs', so will CruiseControl.NET)<br> </li> Index: management.html =================================================================== RCS file: /cvsroot/ccnet/ccnet/doc/server/management.html,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** management.html 16 Nov 2003 14:59:33 -0000 1.1 --- management.html 23 Feb 2004 09:55:20 -0000 1.2 *************** *** 7,10 **** --- 7,11 ---- <img align="right" src="../images/ccnet_logo_onwhite.gif" /> <h1>Enabling Management of a Server</h1> + TBD. </body> </html> \ No newline at end of file |
|
From: <exo...@us...> - 2004-02-23 10:08:40
|
Update of /cvsroot/ccnet/ccnet/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4345/doc Modified Files: index.html Log Message: updated some ccnet documents Index: index.html =================================================================== RCS file: /cvsroot/ccnet/ccnet/doc/index.html,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** index.html 14 Jan 2004 19:04:41 -0000 1.10 --- index.html 23 Feb 2004 09:55:20 -0000 1.11 *************** *** 69,72 **** --- 69,75 ---- <A href="server/SubversionExamples.html">Subversion Examples</A> </li> + <li> + <A href="server/FxCop.html">FxCop Integration</A> + </li> </UL> </li> |
|
From: <exo...@us...> - 2004-02-23 06:29:51
|
Update of /cvsroot/ccnet/ccnet/project/web In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32060/project/web Removed Files: web2002.csproj Log Message: removed all old 2002 project and solution files. --- web2002.csproj DELETED --- |
|
From: <exo...@us...> - 2004-02-23 06:29:51
|
Update of /cvsroot/ccnet/ccnet/project/service In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32060/project/service Removed Files: service2002.csproj Log Message: removed all old 2002 project and solution files. --- service2002.csproj DELETED --- |
|
From: <exo...@us...> - 2004-02-23 06:29:50
|
Update of /cvsroot/ccnet/ccnet/project/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32060/project/core Removed Files: core2002.csproj Log Message: removed all old 2002 project and solution files. --- core2002.csproj DELETED --- |
|
From: <exo...@us...> - 2004-02-23 06:29:50
|
Update of /cvsroot/ccnet/ccnet/project In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32060/project Removed Files: ccnet2002.sln Log Message: removed all old 2002 project and solution files. --- ccnet2002.sln DELETED --- |
|
From: <exo...@us...> - 2004-02-23 06:29:47
|
Update of /cvsroot/ccnet/ccnet/project/WebService In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32060/project/WebService Removed Files: WebService2002.csproj Log Message: removed all old 2002 project and solution files. --- WebService2002.csproj DELETED --- |
|
From: <exo...@us...> - 2004-02-23 06:29:47
|
Update of /cvsroot/ccnet/ccnet/project/console In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32060/project/console Removed Files: console2002.csproj Log Message: removed all old 2002 project and solution files. --- console2002.csproj DELETED --- |
|
From: <exo...@us...> - 2004-02-23 06:29:47
|
Update of /cvsroot/ccnet/ccnet/project/integration In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32060/project/integration Removed Files: integration2002.csproj Log Message: removed all old 2002 project and solution files. --- integration2002.csproj DELETED --- |
|
From: <exo...@us...> - 2004-02-23 06:29:47
|
Update of /cvsroot/ccnet/ccnet/project/Remote In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32060/project/Remote Removed Files: Remote2002.csproj Log Message: removed all old 2002 project and solution files. --- Remote2002.csproj DELETED --- |
|
From: <exo...@us...> - 2004-02-23 06:29:47
|
Update of /cvsroot/ccnet/ccnet/project/CCTray In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32060/project/CCTray Removed Files: CCTray2002.csproj Log Message: removed all old 2002 project and solution files. --- CCTray2002.csproj DELETED --- |
|
From: <exo...@us...> - 2004-02-23 06:29:47
|
Update of /cvsroot/ccnet/ccnet/project/WebServiceProxy In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32060/project/WebServiceProxy Removed Files: WebServiceProxy2002.csproj Log Message: removed all old 2002 project and solution files. --- WebServiceProxy2002.csproj DELETED --- |
|
From: <exo...@us...> - 2004-02-23 05:31:53
|
Update of /cvsroot/ccnet/ccnet/project/core/builder In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22176/project/core/builder Modified Files: NAntBuilder.cs Log Message: - created new ProcessExecutor, ProcessInfo, ProcessResult and ProcessReader classes for executing external processes and reading the results in via standard output and standard error - updated source control classes and nantbuilder classes to use new process classes Index: NAntBuilder.cs =================================================================== RCS file: /cvsroot/ccnet/ccnet/project/core/builder/NAntBuilder.cs,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** NAntBuilder.cs 11 Feb 2004 07:01:22 -0000 1.10 --- NAntBuilder.cs 23 Feb 2004 05:18:10 -0000 1.11 *************** *** 1,9 **** using System; using System.Threading; - using System.Diagnostics; using System.IO; - - using Exortech.NetReflector; - using ThoughtWorks.CruiseControl.Core.Config; using ThoughtWorks.CruiseControl.Core.Util; --- 1,6 ---- + using Exortech.NetReflector; using System; using System.Threading; using System.IO; using ThoughtWorks.CruiseControl.Core.Config; using ThoughtWorks.CruiseControl.Core.Util; *************** *** 15,18 **** --- 12,16 ---- public class NAntBuilder : IBuilder { + private const int DEFAULT_BUILD_TIMEOUT = 600; private readonly string DEFAULT_BUILDARGS = "-logger:" + Configuration.NAntLogger; *************** *** 21,28 **** private string _buildArgs; private string _buildfile; ! private int _buildTimeoutSeconds; private string[] _targets = new string[0]; ! public NAntBuilder() { _buildArgs = DEFAULT_BUILDARGS; --- 19,26 ---- private string _buildArgs; private string _buildfile; ! private int _buildTimeoutSeconds = DEFAULT_BUILD_TIMEOUT; private string[] _targets = new string[0]; ! public NAntBuilder() { _buildArgs = DEFAULT_BUILDARGS; *************** *** 34,68 **** public string Executable { ! get { return _executable; } ! set { _executable = value; } ! } [ReflectorProperty("baseDirectory")] public string BaseDirectory { ! get { return _baseDirectory; } ! set { _baseDirectory = value; } } //TODO: can this be optional? [ReflectorProperty("buildFile")] public string BuildFile { ! get { return _buildfile; } ! set { _buildfile = value; } } ! [ReflectorProperty("buildArgs", Required=false)] public string BuildArgs { ! get { return _buildArgs; } ! set { _buildArgs = value; } } ! [ReflectorArray("targetList", Required=false)] public string[] Targets { ! get { return _targets; } ! set { _targets = value; } } --- 32,97 ---- public string Executable { ! get ! { ! return _executable; ! } ! set ! { ! _executable = value; ! } ! } [ReflectorProperty("baseDirectory")] public string BaseDirectory { ! get ! { ! return _baseDirectory; ! } ! set ! { ! _baseDirectory = value; ! } } //TODO: can this be optional? + [ReflectorProperty("buildFile")] public string BuildFile { ! get ! { ! return _buildfile; ! } ! set ! { ! _buildfile = value; ! } } ! [ReflectorProperty("buildArgs", Required = false)] public string BuildArgs { ! get ! { ! return _buildArgs; ! } ! set ! { ! _buildArgs = value; ! } } ! [ReflectorArray("targetList", Required = false)] public string[] Targets { ! get ! { ! return _targets; ! } ! set ! { ! _targets = value; ! } } *************** *** 72,80 **** /// to disable process timeouts. /// </summary> ! [ReflectorProperty("buildTimeoutSeconds", Required=false)] public int BuildTimeoutSeconds { ! get { return _buildTimeoutSeconds; } ! set { _buildTimeoutSeconds = value; } } --- 101,117 ---- /// to disable process timeouts. /// </summary> ! ! ! [ReflectorProperty("buildTimeoutSeconds", Required = false)] public int BuildTimeoutSeconds { ! get ! { ! return _buildTimeoutSeconds; ! } ! set ! { ! _buildTimeoutSeconds = value; ! } } *************** *** 82,86 **** public string LabelToApply = "NO-LABEL"; ! public bool ShouldRun(IntegrationResult result) { --- 119,123 ---- public string LabelToApply = "NO-LABEL"; ! public bool ShouldRun(IntegrationResult result) { *************** *** 90,96 **** private string BuildCommand { ! get { return string.Format("{0} {1}", Executable, BuildArgs); } } ! /// <summary> /// Creates the command line arguments to the nant.exe executable. These arguments --- 127,136 ---- private string BuildCommand { ! get ! { ! return string.Format("{0} {1}", Executable, BuildArgs); ! } } ! /// <summary> /// Creates the command line arguments to the nant.exe executable. These arguments *************** *** 98,105 **** /// </summary> /// <returns></returns> internal string CreateArgs() { ! return string.Format("-buildfile:{0} {1} -D:label-to-apply={2} {3}", ! BuildFile, BuildArgs, LabelToApply, string.Join(" ", Targets)); } --- 138,146 ---- /// </summary> /// <returns></returns> + + internal string CreateArgs() { ! return string.Format("-buildfile:{0} {1} -D:label-to-apply={2} {3}", BuildFile, BuildArgs, LabelToApply, string.Join(" ", Targets)); } *************** *** 110,113 **** --- 151,156 ---- /// </summary> /// <param name="result">For storing build output.</param> + + public void Run(IntegrationResult result) { *************** *** 118,124 **** try ! { ! int exitCode = AttemptExecute(result); ! if (exitCode == 0) { result.Status = IntegrationStatus.Success; --- 161,168 ---- try ! { ! ProcessResult processResult = AttemptExecute(); ! result.Output = processResult.StandardOutput; ! if (processResult.ExitCode == 0) { result.Status = IntegrationStatus.Success; *************** *** 127,138 **** { result.Status = IntegrationStatus.Failure; ! Log.Info("NAnt build failed - exit code: " + exitCode); } } ! catch (CruiseControlException) { throw; } ! catch (Exception e) { throw new BuilderException(this, string.Format("Unable to execute: {0}\n{1}", BuildCommand, e), e); --- 171,182 ---- { result.Status = IntegrationStatus.Failure; ! Log.Info("NAnt build failed: " + processResult.StandardError); } } ! catch(CruiseControlException) { throw; } ! catch(Exception e) { throw new BuilderException(this, string.Format("Unable to execute: {0}\n{1}", BuildCommand, e), e); *************** *** 140,231 **** } ! /// <summary> ! /// ! /// </summary> ! /// <param name="result"></param> ! /// <returns>The process exit code: 0 for successful completion, -1 for an error.</returns> ! /// <exception cref="CruiseControlException">If a BuildTimeout is specified, and the process exceeds it.</exception> ! protected virtual int AttemptExecute(IntegrationResult result) { ! using (Process process = ProcessUtil.CreateProcess(Executable, CreateArgs(), BaseDirectory)) { ! // start the process, and redirect output ! TextReader stdOut = ProcessUtil.ExecuteRedirected(process); ! ! // read the std output in another thread (otherwise it'll block and we won't be able to do timeout) ! StdOutReader stdOutReader = new StdOutReader(result, stdOut); ! ! // wait for the process ! if (BuildTimeoutSeconds > 0) ! { ! // wait prescribed number of milliseconds ! process.WaitForExit(BuildTimeoutSeconds * 1000); ! ! if (! process.HasExited) ! { ! // the process timed out ! process.Kill(); ! ! // this causes the build to end up in 'exception' state. the exception message is logged, ! // though currently doesn't appear on the build web page ! throw new BuilderException(this, "NAnt process timed out (after " + BuildTimeoutSeconds + " seconds)"); ! } ! } ! else ! { ! // NOTE: in this scenario, if NAnt crashes and displays a modal dialog, CCNet will hang ! // until the user clicks OK... if this is a remote computer it may go unchecked for some time ! process.WaitForExit(); ! } ! ! // collect output from the process before returning (join thread) ! stdOutReader.BlockUntilFinishedReading(); ! ! // if the process timed out, we'll be unable to read this value -- InvalidOperationException ! return process.ExitCode; } } ! public override string ToString() { ! return string.Format(@" BaseDirectory: {0}, Targets: {1}, Executable: {2}, BuildFile: {3}", ! BaseDirectory, string.Join(", ", Targets), Executable, BuildFile); } ! #region Inner-type: StdOutReader ! ! /// <summary> ! /// Sets IntegrationResult output text by reading from a TextReader in another thread. ! /// This avoids blocking the main program thread, which prohibits other activities with ! /// the process (specifically, enforcing a build timeout). ! /// </summary> ! public class StdOutReader { ! IntegrationResult _result; ! TextReader _reader; ! Thread _thread; ! ! public StdOutReader(IntegrationResult result, TextReader stdOut) ! { ! _result = result; ! _reader = stdOut; ! ! _thread = new Thread(new ThreadStart(ReadToEnd)); ! _thread.Name = "NAntStdOutReader"; ! _thread.Start(); ! } ! ! private void ReadToEnd() ! { ! _result.Output = _reader.ReadToEnd(); ! } ! ! public void BlockUntilFinishedReading() ! { ! _thread.Join(); ! } } - - #endregion } } \ No newline at end of file --- 184,210 ---- } ! protected virtual ProcessResult AttemptExecute() { ! ProcessExecutor executor = new ProcessExecutor(); ! executor.Timeout = BuildTimeoutSeconds*1000; ! ProcessResult processResult = executor.Execute(Executable, CreateArgs(), BaseDirectory); ! if (processResult.TimedOut) { ! // this causes the build to end up in 'exception' state. the exception message is logged, ! // though currently doesn't appear on the build web page ! throw new BuilderException(this, "NAnt process timed out(after " + BuildTimeoutSeconds + " seconds)"); } + return processResult; } ! protected virtual ProcessInfo CreateProcess(string filename, string arguments, string workingDirectory) { ! return new ProcessInfo(filename, arguments, workingDirectory); } ! public override string ToString() { ! return string.Format(@" BaseDirectory: {0}, Targets: {1}, Executable: {2}, BuildFile: {3}", BaseDirectory, string.Join(", ", Targets), Executable, BuildFile); } } } \ No newline at end of file |
|
From: <exo...@us...> - 2004-02-23 05:31:51
|
Update of /cvsroot/ccnet/ccnet/project/core/builder/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22176/project/core/builder/test Modified Files: NAntBuilderTest.cs Log Message: - created new ProcessExecutor, ProcessInfo, ProcessResult and ProcessReader classes for executing external processes and reading the results in via standard output and standard error - updated source control classes and nantbuilder classes to use new process classes Index: NAntBuilderTest.cs =================================================================== RCS file: /cvsroot/ccnet/ccnet/project/core/builder/test/NAntBuilderTest.cs,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** NAntBuilderTest.cs 14 Nov 2003 14:57:33 -0000 1.12 --- NAntBuilderTest.cs 23 Feb 2004 05:18:10 -0000 1.13 *************** *** 1,9 **** using System; using System.IO; - using Exortech.NetReflector; - using NUnit.Framework; - using ThoughtWorks.CruiseControl.Core.Util; using ThoughtWorks.CruiseControl.Remote; --- 1,6 ---- *************** *** 62,66 **** [Test] ! public void ExecuteCommand() { string tempFile = TempFileUtil.CreateTempFile(TEMP_DIR, "testexecute.bat", "echo hello martin"); --- 59,63 ---- [Test] ! public void ExecuteCommand() { string tempFile = TempFileUtil.CreateTempFile(TEMP_DIR, "testexecute.bat", "echo hello martin"); *************** *** 72,79 **** IntegrationResult result = new IntegrationResult(); _builder.Run(result); ! string errorMessage = string.Format("{0} not contained in {1}",expected, result.Output); Assert(errorMessage, StringUtil.StringContains(result.Output.ToString(), expected)); } ! [Test, ExpectedException(typeof(BuilderException))] public void ExecuteCommandWithInvalidFile() --- 69,76 ---- IntegrationResult result = new IntegrationResult(); _builder.Run(result); ! string errorMessage = string.Format("{0} not contained in {1}", expected, result.Output); Assert(errorMessage, StringUtil.StringContains(result.Output.ToString(), expected)); } ! [Test, ExpectedException(typeof(BuilderException))] public void ExecuteCommandWithInvalidFile() *************** *** 83,90 **** _builder.BuildArgs = ""; _builder.BaseDirectory = TempFileUtil.GetTempPath(TEMP_DIR); ! Assert("invalidfile.bat should not exist!",! File.Exists(_builder.Executable)); _builder.Run(new IntegrationResult()); } ! [Test] public void BuildSucceed() --- 80,87 ---- _builder.BuildArgs = ""; _builder.BaseDirectory = TempFileUtil.GetTempPath(TEMP_DIR); ! Assert("invalidfile.bat should not exist!", ! File.Exists(_builder.Executable)); _builder.Run(new IntegrationResult()); } ! [Test] public void BuildSucceed() *************** *** 100,108 **** _builder.Run(result); ! Assert("test build should succeed", result.Succeeded); Assert(StringUtil.StringContains(result.Output.ToString(), "I am success itself")); } ! [Test] public void BuildFailed() --- 97,105 ---- _builder.Run(result); ! Assert("test build should succeed", result.Succeeded); Assert(StringUtil.StringContains(result.Output.ToString(), "I am success itself")); } ! [Test] public void BuildFailed() *************** *** 153,157 **** [Test] ! public void LabelGetsPassedThrough() { CreateTestBuildFile(); --- 150,154 ---- [Test] ! public void LabelGetsPassedThrough() { CreateTestBuildFile(); *************** *** 163,167 **** result.Label = "ATestLabel"; _builder.Run(result); ! Assert("test build should succeed", result.Succeeded); Assert(StringUtil.StringContains(result.Output.ToString(), "ATestLabel")); --- 160,164 ---- result.Label = "ATestLabel"; _builder.Run(result); ! Assert("test build should succeed", result.Succeeded); Assert(StringUtil.StringContains(result.Output.ToString(), "ATestLabel")); *************** *** 195,209 **** IntegrationResult result = new IntegrationResult(); ! try { _builder.Run(result); Fail("Should have timed out and thrown CruiseControlException."); } ! catch (CruiseControlException cce) { ! AssertEquals("NAnt process timed out (after 1 seconds)", cce.Message); } ! // for teardown (when directory deleted), this sleep gives // the chance for spawned process to release file lock System.Threading.Thread.Sleep(500); --- 192,206 ---- IntegrationResult result = new IntegrationResult(); ! try { _builder.Run(result); Fail("Should have timed out and thrown CruiseControlException."); } ! catch(CruiseControlException cce) { ! AssertEquals("NAnt process timed out(after 1 seconds)", cce.Message); } ! // for teardown(when directory deleted), this sleep gives // the chance for spawned process to release file lock System.Threading.Thread.Sleep(500); *************** *** 212,227 **** #region Test support ! private IntegrationResult CreateIntegrationResultWithModifications(IntegrationStatus status) { ! IntegrationResult result = new IntegrationResult(); result.Status = status; ! result.Modifications = new Modification[] { new Modification() }; return result; } ! ! private string CreateTestBuildFile() { ! string contents = ! @"<project name=""ccnetlaunch"" default=""all""> <target name=""all""> --- 209,223 ---- #region Test support ! private IntegrationResult CreateIntegrationResultWithModifications (IntegrationStatus status) { ! IntegrationResult result = new IntegrationResult (); result.Status = status; ! result.Modifications = new Modification[] { new Modification () }; return result; } ! ! private string CreateTestBuildFile () { ! string contents = @"<project name=""ccnetlaunch"" default=""all""> <target name=""all""> *************** *** 247,254 **** </project>"; ! return TempFileUtil.CreateTempFile(TEMP_DIR, TEST_BUILD_FILENAME, contents); } #endregion } } \ No newline at end of file --- 243,251 ---- </project>"; ! return TempFileUtil.CreateTempFile (TEMP_DIR, TEST_BUILD_FILENAME, contents); } #endregion + } } \ No newline at end of file |
Update of /cvsroot/ccnet/ccnet/project/core/sourcecontrol/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22176/project/core/sourcecontrol/test Modified Files: CvsTest.cs P4Test.cs PvcsTest.cs StarTeamTest.cs SvnTest.cs VssTest.cs Log Message: - created new ProcessExecutor, ProcessInfo, ProcessResult and ProcessReader classes for executing external processes and reading the results in via standard output and standard error - updated source control classes and nantbuilder classes to use new process classes Index: CvsTest.cs =================================================================== RCS file: /cvsroot/ccnet/ccnet/project/core/sourcecontrol/test/CvsTest.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** CvsTest.cs 20 Jan 2004 13:47:17 -0000 1.8 --- CvsTest.cs 23 Feb 2004 05:18:12 -0000 1.9 *************** *** 1,11 **** using System; using System.Globalization; using System.IO; - using System.Collections; - using System.Diagnostics; - using NUnit.Framework; using ThoughtWorks.CruiseControl.Core.Util; using ThoughtWorks.CruiseControl.Core.Test; - using Exortech.NetReflector; namespace ThoughtWorks.CruiseControl.Core.Sourcecontrol.Test --- 1,10 ---- + using Exortech.NetReflector; + using NUnit.Framework; using System; + using System.Collections; using System.Globalization; using System.IO; using ThoughtWorks.CruiseControl.Core.Util; using ThoughtWorks.CruiseControl.Core.Test; namespace ThoughtWorks.CruiseControl.Core.Sourcecontrol.Test *************** *** 45,52 **** Cvs cvs = CreateCvs(); DateTime from = new DateTime(2001, 1, 21, 20, 0, 0); ! Process actualProcess = cvs.CreateHistoryProcess(from, new DateTime()); string expected = string.Format(@"-q log -N ""-d>{0}""", cvs.FormatCommandDate(from)); ! string actual = actualProcess.StartInfo.Arguments; AssertEquals(expected, actual); } --- 44,51 ---- Cvs cvs = CreateCvs(); DateTime from = new DateTime(2001, 1, 21, 20, 0, 0); ! ProcessInfo actualProcess = cvs.CreateHistoryProcessInfo(from, new DateTime()); string expected = string.Format(@"-q log -N ""-d>{0}""", cvs.FormatCommandDate(from)); ! string actual = actualProcess.Arguments; AssertEquals(expected, actual); } *************** *** 60,64 **** cvs.CvsRoot = "myCvsRoot"; cvs.Branch = "branch"; ! string args = cvs.BuildHistoryProcessArgs(from); string expected = string.Format(@"-d myCvsRoot -q log -N ""-d>{0}"" -rbranch", cvs.FormatCommandDate(from)); AssertEquals(expected, args); --- 59,63 ---- cvs.CvsRoot = "myCvsRoot"; cvs.Branch = "branch"; ! string args = cvs.BuildHistoryProcessInfoArgs(from); string expected = string.Format(@"-d myCvsRoot -q log -N ""-d>{0}"" -rbranch", cvs.FormatCommandDate(from)); AssertEquals(expected, args); *************** *** 70,77 **** Cvs cvs = CreateCvs(); DateTime from = new DateTime(2001, 1, 21, 20, 0, 0); ! Process actualProcess = cvs.CreateHistoryProcess(from, new DateTime()); string expected = string.Format(@"-q log -N ""-d>{0}""", cvs.FormatCommandDate(from)); ! string actual = actualProcess.StartInfo.Arguments; AssertEquals(expected, actual); } --- 69,76 ---- Cvs cvs = CreateCvs(); DateTime from = new DateTime(2001, 1, 21, 20, 0, 0); ! ProcessInfo actualProcess = cvs.CreateHistoryProcessInfo(from, new DateTime()); string expected = string.Format(@"-q log -N ""-d>{0}""", cvs.FormatCommandDate(from)); ! string actual = actualProcess.Arguments; AssertEquals(expected, actual); } *************** *** 82,89 **** Cvs cvs = CreateCvs(); ! AssertNull(cvs.CreateLabelProcess("", new DateTime())); cvs.LabelOnSuccess = true; ! AssertNotNull(cvs.CreateLabelProcess("", new DateTime())); } --- 81,88 ---- Cvs cvs = CreateCvs(); ! AssertNull(cvs.CreateLabelProcessInfo("", new DateTime())); cvs.LabelOnSuccess = true; ! AssertNotNull(cvs.CreateLabelProcessInfo("", new DateTime())); } Index: P4Test.cs =================================================================== RCS file: /cvsroot/ccnet/ccnet/project/core/sourcecontrol/test/P4Test.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** P4Test.cs 14 Nov 2003 14:57:34 -0000 1.5 --- P4Test.cs 23 Feb 2004 05:18:12 -0000 1.6 *************** *** 1,4 **** using System; - using System.Diagnostics; using NUnit.Framework; using NMock; --- 1,3 ---- *************** *** 74,83 **** DateTime to = new DateTime(2002, 10, 31, 5, 5, 0); ! Process process = p4.CreateChangeListProcess(from, to); string expectedArgs = "-s changes -s submitted //depot/myproj/...@2002/10/20:02:00:00,@2002/10/31:05:05:00"; ! AssertEquals("p4", process.StartInfo.FileName); ! AssertEquals(expectedArgs, process.StartInfo.Arguments); } --- 73,82 ---- DateTime to = new DateTime(2002, 10, 31, 5, 5, 0); ! ProcessInfo process = p4.CreateChangeListProcess(from, to); string expectedArgs = "-s changes -s submitted //depot/myproj/...@2002/10/20:02:00:00,@2002/10/31:05:05:00"; ! AssertEquals("p4", process.FileName); ! AssertEquals(expectedArgs, process.Arguments); } *************** *** 103,110 **** P4 p4 = CreateP4(xml); ! Process process = p4.CreateChangeListProcess(from, to); ! AssertEquals("c:\\bin\\p4.exe", process.StartInfo.FileName); ! AssertEquals(expectedArgs, process.StartInfo.Arguments); } --- 102,109 ---- P4 p4 = CreateP4(xml); ! ProcessInfo process = p4.CreateChangeListProcess(from, to); ! AssertEquals("c:\\bin\\p4.exe", process.FileName); ! AssertEquals(expectedArgs, process.Arguments); } *************** *** 113,121 **** { string changes = "3327 3328 332"; ! Process process = new P4().CreateDescribeProcess(changes); string expectedArgs = "-s describe -s " + changes; ! AssertEquals("p4", process.StartInfo.FileName); ! AssertEquals(expectedArgs, process.StartInfo.Arguments); } --- 112,120 ---- { string changes = "3327 3328 332"; ! ProcessInfo process = new P4().CreateDescribeProcess(changes); string expectedArgs = "-s describe -s " + changes; ! AssertEquals("p4", process.FileName); ! AssertEquals(expectedArgs, process.Arguments); } *************** *** 137,144 **** P4 p4 = CreateP4(xml); ! Process process = p4.CreateDescribeProcess(changes); ! AssertEquals("c:\\bin\\p4.exe", process.StartInfo.FileName); ! AssertEquals(expectedArgs, process.StartInfo.Arguments); } --- 136,143 ---- P4 p4 = CreateP4(xml); ! ProcessInfo process = p4.CreateDescribeProcess(changes); ! AssertEquals("c:\\bin\\p4.exe", process.FileName); ! AssertEquals(expectedArgs, process.Arguments); } *************** *** 148,152 **** { string changes = "3327 3328 332; echo 'rm -rf /'"; ! Process process = new P4().CreateDescribeProcess(changes); } --- 147,151 ---- { string changes = "3327 3328 332; echo 'rm -rf /'"; ! ProcessInfo process = new P4().CreateDescribeProcess(changes); } *************** *** 156,160 **** { string changes = ""; ! Process process = new P4().CreateDescribeProcess(changes); // this should never happen, but here's a test just in case. } --- 155,159 ---- { string changes = ""; ! ProcessInfo process = new P4().CreateDescribeProcess(changes); // this should never happen, but here's a test just in case. } *************** *** 176,182 **** exit: 0 "; ! mock.ExpectAndReturn("execute", changes); ! mock.ExpectAndReturn("execute", P4Mother.P4_LOGFILE_CONTENT); P4 p4 = (P4)mock.MockInstance; --- 175,181 ---- exit: 0 "; ! mock.ExpectAndReturn("Execute", changes); ! mock.ExpectAndReturn("Execute", P4Mother.P4_LOGFILE_CONTENT); P4 p4 = (P4)mock.MockInstance; Index: PvcsTest.cs =================================================================== RCS file: /cvsroot/ccnet/ccnet/project/core/sourcecontrol/test/PvcsTest.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PvcsTest.cs 5 Nov 2003 13:47:21 -0000 1.7 --- PvcsTest.cs 23 Feb 2004 05:18:12 -0000 1.8 *************** *** 1,10 **** using System; using System.Globalization; using System.IO; - using System.Collections; - using System.Diagnostics; - using NUnit.Framework; using ThoughtWorks.CruiseControl.Core.Util; - using Exortech.NetReflector; namespace ThoughtWorks.CruiseControl.Core.Sourcecontrol.Test --- 1,9 ---- + using Exortech.NetReflector; + using NUnit.Framework; using System; + using System.Collections; using System.Globalization; using System.IO; using ThoughtWorks.CruiseControl.Core.Util; namespace ThoughtWorks.CruiseControl.Core.Sourcecontrol.Test *************** *** 55,62 **** Pvcs pvcs = CreatePvcs(); DateTime from = new DateTime(2001, 1, 21, 20, 0, 0); ! Process actualProcess = pvcs.CreateHistoryProcess(from, DateTime.Now); string expected = Pvcs.COMMAND; ! string actual = actualProcess.StartInfo.Arguments; AssertEquals(expected, actual); } --- 54,61 ---- Pvcs pvcs = CreatePvcs(); DateTime from = new DateTime(2001, 1, 21, 20, 0, 0); ! ProcessInfo actualProcess = pvcs.CreateHistoryProcessInfo(from, DateTime.Now); string expected = Pvcs.COMMAND; ! string actual = actualProcess.Arguments; AssertEquals(expected, actual); } Index: StarTeamTest.cs =================================================================== RCS file: /cvsroot/ccnet/ccnet/project/core/sourcecontrol/test/StarTeamTest.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** StarTeamTest.cs 20 Jan 2004 13:47:17 -0000 1.5 --- StarTeamTest.cs 23 Feb 2004 05:18:12 -0000 1.6 *************** *** 1,4 **** using System; - using System.Diagnostics; using System.Globalization; using NUnit.Framework; --- 1,3 ---- *************** *** 37,41 **** DateTime to = new DateTime(2002, 2, 22, 20, 0, 0); ! Process actual = _starteam.CreateHistoryProcess(from, to); string expectedExecutable = @"..\tools\starteam\stcmd.exe"; --- 36,40 ---- DateTime to = new DateTime(2002, 2, 22, 20, 0, 0); ! ProcessInfo actual = _starteam.CreateHistoryProcessInfo(from, to); string expectedExecutable = @"..\tools\starteam\stcmd.exe"; *************** *** 43,48 **** AssertNotNull("process was null", actual); ! AssertEquals(expectedExecutable, actual.StartInfo.FileName); ! AssertEquals(expectedArgs, actual.StartInfo.Arguments); } --- 42,47 ---- AssertNotNull("process was null", actual); ! AssertEquals(expectedExecutable, actual.FileName); ! AssertEquals(expectedArgs, actual.Arguments); } Index: SvnTest.cs =================================================================== RCS file: /cvsroot/ccnet/ccnet/project/core/sourcecontrol/test/SvnTest.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SvnTest.cs 22 Feb 2004 18:33:10 -0000 1.2 --- SvnTest.cs 23 Feb 2004 05:18:12 -0000 1.3 *************** *** 38,44 **** DateTime from = DateTime.Parse("2001-01-21 20:00:00 'GMT'"); DateTime to = DateTime.Parse("2001-01-21 20:30:50 'GMT'"); ! Process actualProcess = svn.CreateHistoryProcess(from, to); ! AssertEquals("log -v -r \"{2001-01-21T20:00:00Z}:{2001-01-21T20:30:50Z}\" --xml svn://someserver/", actualProcess.StartInfo.Arguments); } --- 38,44 ---- DateTime from = DateTime.Parse("2001-01-21 20:00:00 'GMT'"); DateTime to = DateTime.Parse("2001-01-21 20:30:50 'GMT'"); ! ProcessInfo actualProcess = svn.CreateHistoryProcessInfo(from, to); ! AssertEquals("log -v -r \"{2001-01-21T20:00:00Z}:{2001-01-21T20:30:50Z}\" --xml svn://someserver/", actualProcess.Arguments); } Index: VssTest.cs =================================================================== RCS file: /cvsroot/ccnet/ccnet/project/core/sourcecontrol/test/VssTest.cs,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** VssTest.cs 18 Feb 2004 12:44:58 -0000 1.13 --- VssTest.cs 23 Feb 2004 05:18:12 -0000 1.14 *************** *** 1,4 **** using System; - using System.Diagnostics; using System.Globalization; using System.IO; --- 1,3 ---- *************** *** 37,41 **** DateTime to = new DateTime(2002, 2, 22, 20, 0, 0); ! Process actual = _vss.CreateHistoryProcess(from, to); string expectedExecutable = @"..\tools\vss\ss.exe"; --- 36,40 ---- DateTime to = new DateTime(2002, 2, 22, 20, 0, 0); ! ProcessInfo actual = _vss.CreateHistoryProcessInfo(from, to); string expectedExecutable = @"..\tools\vss\ss.exe"; *************** *** 43,48 **** AssertNotNull("process was null", actual); ! AssertEquals(expectedExecutable, actual.StartInfo.FileName); ! AssertEquals(expectedArgs, actual.StartInfo.Arguments); } --- 42,47 ---- AssertNotNull("process was null", actual); ! AssertEquals(expectedExecutable, actual.FileName); ! AssertEquals(expectedArgs, actual.Arguments); } *************** *** 88,108 **** [Test] - public void EnvironmentVariables() - { - Process p = ProcessUtil.CreateProcess("cmd.exe", "/C set foo"); - p.StartInfo.EnvironmentVariables["foo"] = "bar"; - TextReader reader = ProcessUtil.ExecuteRedirected(p); - string result = reader.ReadToEnd(); - p.WaitForExit(); - - AssertEquals("foo=bar\r\n", result); - } - - [Test] public void CreateLabelProcess() { string label = "testLabel"; DateTime dateTime = new DateTime(2003, 4, 15, 11, 12, 13, 0); ! Process actual = _vss.CreateLabelProcess(label, dateTime); string expectedExecutable = @"..\tools\vss\ss.exe"; --- 87,95 ---- [Test] public void CreateLabelProcess() { string label = "testLabel"; DateTime dateTime = new DateTime(2003, 4, 15, 11, 12, 13, 0); ! ProcessInfo actual = _vss.CreateLabelProcessInfo(label, dateTime); string expectedExecutable = @"..\tools\vss\ss.exe"; *************** *** 110,115 **** AssertNotNull("process was null", actual); ! AssertEquals(expectedExecutable, actual.StartInfo.FileName); ! AssertEquals(expectedArgs, actual.StartInfo.Arguments); } --- 97,102 ---- AssertNotNull("process was null", actual); ! AssertEquals(expectedExecutable, actual.FileName); ! AssertEquals(expectedArgs, actual.Arguments); } *************** *** 118,122 **** { string label = "testLabel"; ! Process actual = _vss.CreateLabelProcess(label); string expectedExecutable = @"..\tools\vss\ss.exe"; --- 105,109 ---- { string label = "testLabel"; ! ProcessInfo actual = _vss.CreateLabelProcessInfo(label); string expectedExecutable = @"..\tools\vss\ss.exe"; *************** *** 124,129 **** Assertion.AssertNotNull("process was null", actual); ! Assertion.AssertEquals(expectedExecutable, actual.StartInfo.FileName); ! Assertion.AssertEquals(expectedArgs, actual.StartInfo.Arguments); } --- 111,116 ---- Assertion.AssertNotNull("process was null", actual); ! Assertion.AssertEquals(expectedExecutable, actual.FileName); ! Assertion.AssertEquals(expectedArgs, actual.Arguments); } *************** *** 139,148 **** public void SSDirEnvironmentVariableValueShouldNotChangeIfSSDirIsNotSpecified() { ! Process orginal = new Process(); Vss vss = new Vss(); vss.Executable = "ss.exe"; // necessary to stop registry setting from being read ! Process actual = vss.CreateHistoryProcess(DateTime.Now, DateTime.Now); ! AssertEquals(orginal.StartInfo.EnvironmentVariables[Vss.SS_DIR_KEY], actual.StartInfo.EnvironmentVariables[Vss.SS_DIR_KEY]); } --- 126,135 ---- public void SSDirEnvironmentVariableValueShouldNotChangeIfSSDirIsNotSpecified() { ! ProcessInfo orginal = new ProcessInfo("foo", "bar"); Vss vss = new Vss(); vss.Executable = "ss.exe"; // necessary to stop registry setting from being read ! ProcessInfo actual = vss.CreateHistoryProcessInfo(DateTime.Now, DateTime.Now); ! AssertEquals(orginal.EnvironmentVariables[Vss.SS_DIR_KEY], actual.EnvironmentVariables[Vss.SS_DIR_KEY]); } |
|
From: <exo...@us...> - 2004-02-23 05:31:29
|
Update of /cvsroot/ccnet/ccnet/project/core/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22176/project/core/util Added Files: ProcessExecutor.cs ProcessInfo.cs ProcessReader.cs ProcessResult.cs Removed Files: ProcessUtil.cs Log Message: - created new ProcessExecutor, ProcessInfo, ProcessResult and ProcessReader classes for executing external processes and reading the results in via standard output and standard error - updated source control classes and nantbuilder classes to use new process classes --- NEW FILE: ProcessExecutor.cs --- using System; using System.Diagnostics; namespace ThoughtWorks.CruiseControl.Core.Util { public class ProcessExecutor { private const int KILLED_PROCESS_EXIT_CODE = -1; private const int DEFAULT_TIMEOUT = 120000; public int Timeout = DEFAULT_TIMEOUT; public ProcessResult Execute(string filename, string arguments) { return Execute(new ProcessInfo(filename, arguments)); } public ProcessResult Execute(string filename, string arguments, string workingDirectory) { return Execute(new ProcessInfo(filename, arguments, workingDirectory)); } public ProcessResult Execute(ProcessInfo processInfo) { System.Diagnostics.Process process = null; try { process = System.Diagnostics.Process.Start(processInfo.startInfo); ProcessReader standardOutput = new ProcessReader(process.StandardOutput); ProcessReader standardError = new ProcessReader(process.StandardError); standardOutput.Start(); standardError.Start(); if (process.WaitForExit(Timeout)) { standardOutput.WaitForExit(); standardError.WaitForExit(); return new ProcessResult(standardOutput.Output, standardError.Output, process.ExitCode, ! process.HasExited); } else { standardOutput.Abort(); standardError.Abort(); process.Kill(); return new ProcessResult(standardOutput.Output, standardError.Output, KILLED_PROCESS_EXIT_CODE, ! process.HasExited); } } finally { if (process != null) process.Close(); } } } } --- NEW FILE: ProcessInfo.cs --- using System; using System.Collections.Specialized; using System.Diagnostics; namespace ThoughtWorks.CruiseControl.Core.Util { public class ProcessInfo { internal ProcessStartInfo startInfo = new ProcessStartInfo(); public ProcessInfo(string filename, string arguments) : this(filename, arguments, null) { } public ProcessInfo(string filename, string arguments, string workingDirectory) { startInfo.FileName = filename; startInfo.Arguments = arguments; startInfo.WorkingDirectory = workingDirectory; startInfo.UseShellExecute = false; startInfo.CreateNoWindow = true; startInfo.RedirectStandardOutput = true; startInfo.RedirectStandardError = true; } public StringDictionary EnvironmentVariables { get { return startInfo.EnvironmentVariables; } } public string FileName { get { return startInfo.FileName; } } public string Arguments { get { return startInfo.Arguments; } } } } --- NEW FILE: ProcessReader.cs --- using System; using System.IO; using System.Threading; namespace ThoughtWorks.CruiseControl.Core.Util { public class ProcessReader { private Thread thread; private StreamReader stream; private string output; public ProcessReader(StreamReader stream) { this.thread = new Thread(new ThreadStart(ReadToEnd)); this.stream = stream; } public void Start() { thread.Start(); } public void WaitForExit() { thread.Join(); } public void Abort() { thread.Abort(); } public string Output { get { return output; } } private void ReadToEnd() { output = stream.ReadToEnd(); } } } --- NEW FILE: ProcessResult.cs --- using System; namespace ThoughtWorks.CruiseControl.Core.Util { public class ProcessResult { private string standardOutput; private string standardError; private int errorCode; private bool timedOut; public ProcessResult (string standardOutput, string standardError, int errorCode, bool timedOut) { this.standardOutput = standardOutput; this.standardError = standardError; this.errorCode = errorCode; this.timedOut = timedOut; } public string StandardOutput { get { return standardOutput; } } public string StandardError { get { return standardError; } } public int ExitCode { get { return errorCode; } } public bool TimedOut { get { return timedOut; } } } } --- ProcessUtil.cs DELETED --- |
|
From: <exo...@us...> - 2004-02-23 05:31:29
|
Update of /cvsroot/ccnet/ccnet/project/core/util/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22176/project/core/util/test Added Files: ProcessExecutorTest.cs Removed Files: ProcessUtilTest.cs Log Message: - created new ProcessExecutor, ProcessInfo, ProcessResult and ProcessReader classes for executing external processes and reading the results in via standard output and standard error - updated source control classes and nantbuilder classes to use new process classes --- NEW FILE: ProcessExecutorTest.cs --- using NUnit.Framework; using System; using System.Diagnostics; using System.IO; namespace ThoughtWorks.CruiseControl.Core.Util.Test { [TestFixture] public class ProcessExecutorTest : Assertion { [Test] public void ExecuteProcessAndEchoResultsBackThroughStandardOut() { ProcessExecutor executor = new ProcessExecutor(); ProcessResult result = executor.Execute("cmd.exe", "/C @echo Hello World"); AssertEquals("Hello World", result.StandardOutput.Trim()); } [Test] public void ExecuteProcessAndEchoResultsBackThroughStandardOutWhereALargeAmountOfOutputIsProduced() { ProcessExecutor executor = new ProcessExecutor(); ProcessResult result = executor.Execute("cmd.exe", "/C @dir " + Environment.SystemDirectory); Assert("process should not have timed out", ! result.TimedOut); } [Test] public void StartProcessRunningBatchFileCallingNonExistentFile() { ProcessExecutor executor = new ProcessExecutor(); ProcessResult result = executor.Execute("cmd.exe", "/C @zerk.exe foo"); AssertEquals(@"'zerk.exe' is not recognized as an internal or external command, operable program or batch file.", result.StandardError.Trim()); AssertEquals(string.Empty, result.StandardOutput); Assert("process should not have timed out", ! result.TimedOut); } [Test] public void SetEnvironmentVariables() { ProcessExecutor executor = new ProcessExecutor(); ProcessInfo processInfo = new ProcessInfo("cmd.exe", "/C set foo", null); processInfo.EnvironmentVariables["foo"] = "bar"; ProcessResult result = executor.Execute(processInfo); AssertEquals("foo=bar\r\n", result.StandardOutput); } [Test] public void ForceProcessTimeoutBecauseOfBlockingInput() { string filename = TempFileUtil.CreateTempFile("ProcessTest", "run.bat", "@:foo\r\ngoto foo"); try { ProcessExecutor executor = new ProcessExecutor(); executor.Timeout = 10; ProcessResult result = executor.Execute(filename, null); Assert("process should have timed out", result.TimedOut); } finally { TempFileUtil.DeleteTempFile(filename); } } [Test, ExpectedException(typeof(System.ComponentModel.Win32Exception))] public void SupplyInvalidFilenameAndVerifyException() { ProcessExecutor executor = new ProcessExecutor(); executor.Execute("foodaddy.bat", null); } } } --- ProcessUtilTest.cs DELETED --- |