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
(30) |
2
|
3
(8) |
4
(2) |
5
|
6
|
|
7
(2) |
8
|
9
|
10
|
11
|
12
|
13
|
|
14
|
15
(26) |
16
|
17
|
18
(4) |
19
(1) |
20
|
|
21
(21) |
22
(70) |
23
(2) |
24
(6) |
25
|
26
(10) |
27
|
|
28
|
29
|
30
|
|
|
|
|
|
From: Owen R. <exo...@us...> - 2004-11-26 04:53:33
|
Update of /cvsroot/ccnet/ccnet/project/core/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17546/project/core/util Modified Files: ProcessReader.cs Log Message: refactoring CruiseServerFactory and verifying that the server is shutting down properly Index: ProcessReader.cs =================================================================== RCS file: /cvsroot/ccnet/ccnet/project/core/util/ProcessReader.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ProcessReader.cs 28 Oct 2004 17:29:48 -0000 1.8 --- ProcessReader.cs 26 Nov 2004 04:53:09 -0000 1.9 *************** *** 45,52 **** private void ReadToEnd() { ! int nextChar; ! while ((nextChar = stream.Read()) >= 0) { ! output.Write((char)nextChar); } } --- 45,53 ---- private void ReadToEnd() { ! string nextLine; ! while ((nextLine = stream.ReadLine()) != null) { ! output.WriteLine(nextLine); ! // Log.Debug(nextLine); } } *************** *** 55,59 **** { thread.Abort(); ! stream.Close(); } } --- 56,60 ---- { thread.Abort(); ! WaitForExit(); } } |
Update of /cvsroot/ccnet/ccnet/project/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17546/project/core Modified Files: CruiseServer.cs CruiseServerFactory.cs ProjectIntegrator.cs RemoteCruiseServer.cs core.csproj Added Files: ICruiseServerFactory.cs Log Message: refactoring CruiseServerFactory and verifying that the server is shutting down properly --- NEW FILE: ICruiseServerFactory.cs --- using System; using ThoughtWorks.CruiseControl.Remote; namespace ThoughtWorks.CruiseControl.Core { public interface ICruiseServerFactory { ICruiseServer Create(bool remote, string configFile); } } Index: ProjectIntegrator.cs =================================================================== RCS file: /cvsroot/ccnet/ccnet/project/core/ProjectIntegrator.cs,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** ProjectIntegrator.cs 27 Oct 2004 04:37:08 -0000 1.16 --- ProjectIntegrator.cs 26 Nov 2004 04:53:08 -0000 1.17 *************** *** 2,7 **** using System.Threading; using ThoughtWorks.CruiseControl.Core.Triggers; - using ThoughtWorks.CruiseControl.Remote; using ThoughtWorks.CruiseControl.Core.Util; namespace ThoughtWorks.CruiseControl.Core --- 2,7 ---- using System.Threading; using ThoughtWorks.CruiseControl.Core.Triggers; using ThoughtWorks.CruiseControl.Core.Util; + using ThoughtWorks.CruiseControl.Remote; namespace ThoughtWorks.CruiseControl.Core *************** *** 26,30 **** private ProjectIntegratorState _state = ProjectIntegratorState.Stopped; ! public ProjectIntegrator(IProject project) : this(new MultipleTrigger(project.Triggers), project, project) { } public ProjectIntegrator(ITrigger Trigger, IIntegratable integratable, IProject project) --- 26,32 ---- private ProjectIntegratorState _state = ProjectIntegratorState.Stopped; ! public ProjectIntegrator(IProject project) : this(new MultipleTrigger(project.Triggers), project, project) ! { ! } public ProjectIntegrator(ITrigger Trigger, IIntegratable integratable, IProject project) *************** *** 40,45 **** } ! public IProject Project ! { get { return _project; } } --- 42,47 ---- } ! public IProject Project ! { get { return _project; } } *************** *** 87,117 **** private void Run() { - // loop, until the integrator is stopped Log.Info("Starting integration for project: " + _project.Name); ! while (IsRunning) ! { ! // should we integrate this pass? ! BuildCondition buildCondition = ShouldRunIntegration(); ! if (buildCondition != BuildCondition.NoBuild) { ! try ! { ! integratable.RunIntegration(buildCondition); ! } ! catch (Exception ex) ! { ! Log.Error(ex); ! } ! // notify the schedule whether the build was successful or not ! Trigger.IntegrationCompleted(); } - - // sleep for a short while, to avoid hammering CPU - Thread.Sleep(100); } ! // the state was set to 'Stopping', so set it to 'Stopped' ! _state = ProjectIntegratorState.Stopped; } --- 89,128 ---- private void Run() { Log.Info("Starting integration for project: " + _project.Name); ! try ! { ! // loop, until the integrator is stopped ! while (IsRunning) { ! Integrate(); ! // sleep for a short while, to avoid hammering CPU ! Thread.Sleep(100); } } + finally + { + Stopped(); + } + } ! private void Integrate() ! { ! // should we integrate this pass? ! BuildCondition buildCondition = ShouldRunIntegration(); ! if (buildCondition != BuildCondition.NoBuild) ! { ! try ! { ! integratable.RunIntegration(buildCondition); ! } ! catch (Exception ex) ! { ! Log.Error(ex); ! } ! ! // notify the schedule whether the build was successful or not ! Trigger.IntegrationCompleted(); ! } } *************** *** 126,129 **** --- 137,148 ---- } + private void Stopped() + { + // the state was set to 'Stopping', so set it to 'Stopped' + _state = ProjectIntegratorState.Stopped; + _thread = null; + Log.Info("Integrator for project: " + _project.Name + " is now stopped."); + } + /// <summary> /// Gets a value indicating whether this project integrator is running *************** *** 143,159 **** if (IsRunning) { - _state = ProjectIntegratorState.Stopping; Log.Info("Stopping integrator for project: " + _project.Name); } } public void Abort() { if (_thread != null) { _thread.Abort(); } - _state = ProjectIntegratorState.Stopped; - Log.Info("Integrator for project: " + _project.Name + " is now stopped."); } --- 162,181 ---- if (IsRunning) { Log.Info("Stopping integrator for project: " + _project.Name); + _state = ProjectIntegratorState.Stopping; } } + /// <summary> + /// Asynchronously abort project by aborting the project thread. This needs to be followed by a call to WaitForExit + /// to ensure that the abort has completed. + /// </summary> public void Abort() { if (_thread != null) { + Log.Info("Aborting integrator for project: " + _project.Name); _thread.Abort(); } } *************** *** 175,177 **** } } ! } --- 197,199 ---- } } ! } \ No newline at end of file Index: CruiseServer.cs =================================================================== RCS file: /cvsroot/ccnet/ccnet/project/core/CruiseServer.cs,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** CruiseServer.cs 15 Nov 2004 05:45:21 -0000 1.27 --- CruiseServer.cs 26 Nov 2004 04:53:08 -0000 1.28 *************** *** 20,23 **** --- 20,24 ---- private IProjectIntegratorList projectIntegrators; + private bool _disposed; public CruiseServer(IConfigurationService configurationService, IProjectIntegratorListFactory projectIntegratorListFactory, IProjectSerializer projectSerializer) *************** *** 31,35 **** // By default, no integrators are running - // projectIntegrators = new ProjectIntegratorList(); this.projectSerializer = projectSerializer; --- 32,35 ---- *************** *** 44,47 **** --- 44,50 ---- } + /// <summary> + /// Stop all integrators, waiting until each integrator has completely stopped, before releasing any threads blocked by WaitForExit. + /// </summary> public void Stop() { *************** *** 51,54 **** --- 54,60 ---- } + /// <summary> + /// Abort all integrators, waiting until each integrator has completely stopped, before releasing any threads blocked by WaitForExit. + /// </summary> public void Abort() { *************** *** 58,61 **** --- 64,70 ---- } + /// <summary> + /// Restart server by stopping all integrators, creating a new set of integrators from Configuration and then starting them. + /// </summary> public void Restart() { *************** *** 67,70 **** --- 76,82 ---- } + /// <summary> + /// Block thread until all integrators to have been stopped or aborted. + /// </summary> public void WaitForExit() { *************** *** 74,94 **** private void StartIntegrators() { - // IConfiguration configuration; - // try - // { - // configuration = configurationService.Load(); - // } - // catch (ConfigurationException ce) - // { - // Log.Error(ce); - // return; - // } - // - // if (configuration == null) - // { - // Log.Error("Cruise server was not able to load configuration."); - // return; - // } - // foreach (IProjectIntegrator integrator in projectIntegrators) { --- 86,89 ---- *************** *** 176,180 **** else { ! return ""; } } --- 171,175 ---- else { ! return string.Empty; } } *************** *** 336,341 **** void IDisposable.Dispose() { Abort(); - WaitForExit(); } } --- 331,340 ---- void IDisposable.Dispose() { + lock (this) + { + if (_disposed) return; + _disposed = true; + } Abort(); } } Index: RemoteCruiseServer.cs =================================================================== RCS file: /cvsroot/ccnet/ccnet/project/core/RemoteCruiseServer.cs,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** RemoteCruiseServer.cs 19 Aug 2004 16:13:30 -0000 1.13 --- RemoteCruiseServer.cs 26 Nov 2004 04:53:08 -0000 1.14 *************** *** 13,16 **** --- 13,17 ---- private ICruiseServer _server; private static readonly string ConfigurationFile = AppDomain.CurrentDomain.SetupInformation.ConfigurationFile; + private bool _disposed; public RemoteCruiseServer(ICruiseServer server) : this(server, ConfigurationFile) *************** *** 130,133 **** --- 131,139 ---- void IDisposable.Dispose() { + lock (this) + { + if (_disposed) return; + _disposed = true; + } Log.Info("Disconnecting remote server: "); RemotingServices.Disconnect((MarshalByRefObject)_server.CruiseManager); Index: CruiseServerFactory.cs =================================================================== RCS file: /cvsroot/ccnet/ccnet/project/core/CruiseServerFactory.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** CruiseServerFactory.cs 3 Aug 2004 10:45:59 -0000 1.6 --- CruiseServerFactory.cs 26 Nov 2004 04:53:08 -0000 1.7 *************** *** 6,12 **** namespace ThoughtWorks.CruiseControl.Core { ! public class CruiseServerFactory { ! public static ICruiseServer CreateLocal(string configFile) { return new CruiseServer( --- 6,12 ---- namespace ThoughtWorks.CruiseControl.Core { ! public class CruiseServerFactory : ICruiseServerFactory { ! private ICruiseServer CreateLocal(string configFile) { return new CruiseServer( *************** *** 21,30 **** } ! public static ICruiseServer CreateRemote(string configFile) { return new RemoteCruiseServer(CreateLocal(configFile)); } ! public static ICruiseServer Create(bool remote, string configFile) { return (remote) ? CreateRemote(configFile) : CreateLocal(configFile); --- 21,30 ---- } ! private ICruiseServer CreateRemote(string configFile) { return new RemoteCruiseServer(CreateLocal(configFile)); } ! public ICruiseServer Create(bool remote, string configFile) { return (remote) ? CreateRemote(configFile) : CreateLocal(configFile); Index: core.csproj =================================================================== RCS file: /cvsroot/ccnet/ccnet/project/core/core.csproj,v retrieving revision 1.100 retrieving revision 1.101 diff -C2 -d -r1.100 -r1.101 *** core.csproj 22 Nov 2004 14:43:50 -0000 1.100 --- core.csproj 26 Nov 2004 04:53:08 -0000 1.101 *************** *** 171,174 **** --- 171,179 ---- /> <File + RelPath = "ICruiseServerFactory.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "IIntegratable.cs" SubType = "Code" |
|
From: Owen R. <exo...@us...> - 2004-11-26 04:53:32
|
Update of /cvsroot/ccnet/ccnet/project/core/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17546/project/core/test Modified Files: CruiseServerTest.cs ProjectIntegratorTest.cs RemoteCruiseServerTest.cs Log Message: refactoring CruiseServerFactory and verifying that the server is shutting down properly Index: ProjectIntegratorTest.cs =================================================================== RCS file: /cvsroot/ccnet/ccnet/project/core/test/ProjectIntegratorTest.cs,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** ProjectIntegratorTest.cs 26 Oct 2004 21:50:07 -0000 1.19 --- ProjectIntegratorTest.cs 26 Nov 2004 04:53:09 -0000 1.20 *************** *** 135,139 **** integrationTriggerMock.ExpectAndReturn("ShouldRunIntegration", BuildCondition.ForceBuild); ! integratableMock.ExpectAndThrow("RunIntegration", new Exception(exceptionMessage), BuildCondition.ForceBuild); integrationTriggerMock.Expect("IntegrationCompleted"); --- 135,139 ---- integrationTriggerMock.ExpectAndReturn("ShouldRunIntegration", BuildCondition.ForceBuild); ! integratableMock.ExpectAndThrow("RunIntegration", new CruiseControlException(exceptionMessage), BuildCondition.ForceBuild); integrationTriggerMock.Expect("IntegrationCompleted"); *************** *** 163,166 **** --- 163,167 ---- Assert.AreEqual(ProjectIntegratorState.Running, _integrator.State); _integrator.Abort(); + _integrator.WaitForExit(); Assert.AreEqual(ProjectIntegratorState.Stopped, _integrator.State); } Index: CruiseServerTest.cs =================================================================== RCS file: /cvsroot/ccnet/ccnet/project/core/test/CruiseServerTest.cs,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** CruiseServerTest.cs 15 Nov 2004 05:45:22 -0000 1.10 --- CruiseServerTest.cs 26 Nov 2004 04:53:09 -0000 1.11 *************** *** 1,2 **** --- 1,3 ---- + using System; using System.Threading; using NMock; *************** *** 233,236 **** --- 234,252 ---- VerifyAll(); } + + [Test] + public void ShouldOnlyDisposeOnce() + { + integratorMock1.Expect("Abort"); + integratorMock2.Expect("Abort"); + ((IDisposable)server).Dispose(); + + integratorMock1.ExpectNoCall("Abort"); + integratorMock2.ExpectNoCall("Abort"); + ((IDisposable)server).Dispose(); + + integratorMock1.Verify(); + integratorMock2.Verify(); + } } } Index: RemoteCruiseServerTest.cs =================================================================== RCS file: /cvsroot/ccnet/ccnet/project/core/test/RemoteCruiseServerTest.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** RemoteCruiseServerTest.cs 16 Aug 2004 10:13:25 -0000 1.3 --- RemoteCruiseServerTest.cs 26 Nov 2004 04:53:09 -0000 1.4 *************** *** 1,2 **** --- 1,3 ---- + using System; using System.Runtime.Remoting; using System.Runtime.Remoting.Channels; *************** *** 18,22 **** { ChannelServices.UnregisterChannel(channel); ! } } --- 19,24 ---- { ChannelServices.UnregisterChannel(channel); ! } ! Assert.AreEqual(0, ChannelServices.RegisteredChannels.Length); } *************** *** 24,28 **** public void DeleteTempFiles() { ! TempFileUtil.DeleteTempDir("RemoteCruiseServerTest"); } --- 26,30 ---- public void DeleteTempFiles() { ! TempFileUtil.DeleteTempDir("RemoteCruiseServerTest"); } *************** *** 30,33 **** --- 32,80 ---- public void SetupAndTeardownRemotingInfrastructure() { + string configFile = CreateTemporaryConfigurationFile(); + + IMock mockCruiseManager = new RemotingMock(typeof (ICruiseManager)); + IMock mockCruiseServer = new DynamicMock(typeof (ICruiseServer)); + mockCruiseServer.ExpectAndReturn("CruiseManager", mockCruiseManager.MockInstance); + mockCruiseServer.ExpectAndReturn("CruiseManager", mockCruiseManager.MockInstance); + mockCruiseServer.Expect("Dispose"); + + using (new RemoteCruiseServer((ICruiseServer) mockCruiseServer.MockInstance, configFile)) + { + Assert.AreEqual(2, ChannelServices.RegisteredChannels.Length); + Assert.IsNotNull(ChannelServices.GetChannel("ccnet"), "ccnet channel is missing"); + Assert.IsNotNull(ChannelServices.GetChannel("ccnet2"), "ccnet2 channel is missing"); + + ICruiseManager remoteManager = (ICruiseManager) RemotingServices.Connect(typeof (ICruiseManager), "tcp://localhost:35354/" + RemoteCruiseServer.URI); + Assert.IsNotNull(remoteManager, "cruiseserver should be registered on tcp channel"); + + remoteManager = (ICruiseManager) RemotingServices.Connect(typeof (ICruiseManager), "http://localhost:35355/" + RemoteCruiseServer.URI); + Assert.IsNotNull(remoteManager, "cruiseserver should be registered on http channel"); + } + Assert.AreEqual(0, ChannelServices.RegisteredChannels.Length, "all registered channels should be closed."); + mockCruiseServer.Verify(); + mockCruiseManager.Verify(); + } + + [Test] + public void ShouldOnlyDisposeOnce() + { + string configFile = CreateTemporaryConfigurationFile(); + IMock mockCruiseManager = new RemotingMock(typeof (ICruiseManager)); + IMock mockCruiseServer = new DynamicMock(typeof (ICruiseServer)); + mockCruiseServer.ExpectAndReturn("CruiseManager", mockCruiseManager.MockInstance); + mockCruiseServer.ExpectAndReturn("CruiseManager", mockCruiseManager.MockInstance); + mockCruiseServer.Expect("Dispose"); + + RemoteCruiseServer server = new RemoteCruiseServer((ICruiseServer) mockCruiseServer.MockInstance, configFile); + ((IDisposable)server).Dispose(); + + mockCruiseServer.ExpectNoCall("Dispose"); + ((IDisposable)server).Dispose(); + mockCruiseServer.Verify(); + } + + private string CreateTemporaryConfigurationFile() + { string configXml = @"<configuration> <system.runtime.remoting> *************** *** 48,79 **** </system.runtime.remoting> </configuration>"; ! ! Assert.AreEqual(0, ChannelServices.RegisteredChannels.Length); ! TempFileUtil.CreateTempDir("RemoteCruiseServerTest"); ! string configFile = TempFileUtil.CreateTempXmlFile("RemoteCruiseServerTest", "remote.config", configXml); ! ! IMock mockCruiseManager = new RemotingMock(typeof(ICruiseManager)); ! IMock mockCruiseServer = new DynamicMock(typeof(ICruiseServer)); ! mockCruiseServer.ExpectAndReturn("CruiseManager", mockCruiseManager.MockInstance); ! mockCruiseServer.ExpectAndReturn("CruiseManager", mockCruiseManager.MockInstance); ! mockCruiseServer.Expect("Dispose"); ! ! using(RemoteCruiseServer server = new RemoteCruiseServer((ICruiseServer) mockCruiseServer.MockInstance, configFile)) ! { ! Assert.AreEqual(2, ChannelServices.RegisteredChannels.Length); ! Assert.IsNotNull(ChannelServices.GetChannel("ccnet"), "ccnet channel is missing"); ! Assert.IsNotNull(ChannelServices.GetChannel("ccnet2"), "ccnet2 channel is missing"); ! ! ICruiseManager remoteManager = (ICruiseManager) RemotingServices.Connect(typeof(ICruiseManager), "tcp://localhost:35354/" + RemoteCruiseServer.URI); ! Assert.IsNotNull(remoteManager, "cruiseserver should be registered on tcp channel"); ! ! remoteManager = (ICruiseManager) RemotingServices.Connect(typeof(ICruiseManager), "http://localhost:35355/" + RemoteCruiseServer.URI); ! Assert.IsNotNull(remoteManager, "cruiseserver should be registered on http channel"); ! } ! Assert.AreEqual(0, ChannelServices.RegisteredChannels.Length, "all registered channels should be closed."); ! mockCruiseServer.Verify(); ! mockCruiseManager.Verify(); } } ! } --- 95,103 ---- </system.runtime.remoting> </configuration>"; ! ! TempFileUtil.CreateTempDir("RemoteCruiseServerTest"); ! return TempFileUtil.CreateTempXmlFile("RemoteCruiseServerTest", "remote.config", configXml); } } ! } \ No newline at end of file |
|
From: Owen R. <exo...@us...> - 2004-11-26 04:53:31
|
Update of /cvsroot/ccnet/ccnet/project/core/util/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17546/project/core/util/test Modified Files: ProcessReaderTest.cs Log Message: refactoring CruiseServerFactory and verifying that the server is shutting down properly Index: ProcessReaderTest.cs =================================================================== RCS file: /cvsroot/ccnet/ccnet/project/core/util/test/ProcessReaderTest.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ProcessReaderTest.cs 18 Oct 2004 13:13:34 -0000 1.5 --- ProcessReaderTest.cs 26 Nov 2004 04:53:09 -0000 1.6 *************** *** 1,2 **** --- 1,3 ---- + using System; using System.IO; using NUnit.Framework; *************** *** 14,18 **** { reader.WaitForExit(); ! Assert.AreEqual("string to read", reader.Output); } Assert.IsTrue(stream.IsClosed); --- 15,19 ---- { reader.WaitForExit(); ! Assert.AreEqual("string to read" + Environment.NewLine, reader.Output); } Assert.IsTrue(stream.IsClosed); |
|
From: Owen R. <exo...@us...> - 2004-11-26 04:53:20
|
Update of /cvsroot/ccnet/ccnet/project/console/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17546/project/console/test Modified Files: ConsoleRunnerTest.cs Log Message: refactoring CruiseServerFactory and verifying that the server is shutting down properly Index: ConsoleRunnerTest.cs =================================================================== RCS file: /cvsroot/ccnet/ccnet/project/console/test/ConsoleRunnerTest.cs,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** ConsoleRunnerTest.cs 15 Nov 2004 05:45:20 -0000 1.14 --- ConsoleRunnerTest.cs 26 Nov 2004 04:53:08 -0000 1.15 *************** *** 2,5 **** --- 2,6 ---- using NMock; using NUnit.Framework; + using ThoughtWorks.CruiseControl.Core; using ThoughtWorks.CruiseControl.Core.Util; using ThoughtWorks.CruiseControl.Remote; *************** *** 31,41 **** public void ShowHelp() { - Mock mockCruiseServer = new DynamicMock(typeof(ICruiseServer)); ArgumentParser parser = new ArgumentParser(new string[] { "-remoting:on", "-help" }); ! ConsoleRunner runner = new ConsoleRunner(parser, (ICruiseServer)mockCruiseServer.MockInstance); runner.Run(); Assert.AreEqual(1, listener.Traces.Count); Assert.IsTrue(listener.Traces[0].ToString().IndexOf(ArgumentParser.Usage) > 0, "Wrong message was logged."); } --- 32,46 ---- public void ShowHelp() { ArgumentParser parser = new ArgumentParser(new string[] { "-remoting:on", "-help" }); ! Mock mockCruiseServerFactory = new DynamicMock(typeof(ICruiseServerFactory)); ! mockCruiseServerFactory.ExpectNoCall("Create", typeof(bool), typeof(string)); ! ! ConsoleRunner runner = new ConsoleRunner(parser, (ICruiseServerFactory)mockCruiseServerFactory.MockInstance); runner.Run(); Assert.AreEqual(1, listener.Traces.Count); Assert.IsTrue(listener.Traces[0].ToString().IndexOf(ArgumentParser.Usage) > 0, "Wrong message was logged."); + + mockCruiseServerFactory.Verify(); } *************** *** 43,52 **** public void ForceBuildCruiseServerProject() { Mock mockCruiseServer = new DynamicMock(typeof(ICruiseServer)); mockCruiseServer.Expect("ForceBuild", "test"); mockCruiseServer.Expect("WaitForExit","test"); ! ArgumentParser parser = new ArgumentParser(new string[] { "-project:test" }); ! new ConsoleRunner(parser, (ICruiseServer)mockCruiseServer.MockInstance).Run(); mockCruiseServer.Verify(); --- 48,59 ---- public void ForceBuildCruiseServerProject() { + ArgumentParser parser = new ArgumentParser(new string[] { "-project:test" }); Mock mockCruiseServer = new DynamicMock(typeof(ICruiseServer)); mockCruiseServer.Expect("ForceBuild", "test"); mockCruiseServer.Expect("WaitForExit","test"); + Mock mockCruiseServerFactory = new DynamicMock(typeof(ICruiseServerFactory)); + mockCruiseServerFactory.ExpectAndReturn("Create", mockCruiseServer.MockInstance, parser.IsRemote, parser.ConfigFile); ! new ConsoleRunner(parser, (ICruiseServerFactory)mockCruiseServerFactory.MockInstance).Run(); mockCruiseServer.Verify(); *************** *** 56,65 **** public void StartCruiseServerProject() { Mock mockCruiseServer = new DynamicMock(typeof(ICruiseServer)); mockCruiseServer.Expect("Start"); mockCruiseServer.Expect("WaitForExit"); ! ArgumentParser parser = new ArgumentParser(new string[0]); ! new ConsoleRunner(parser, (ICruiseServer)mockCruiseServer.MockInstance).Run(); mockCruiseServer.Verify(); --- 63,74 ---- public void StartCruiseServerProject() { + ArgumentParser parser = new ArgumentParser(new string[0]); Mock mockCruiseServer = new DynamicMock(typeof(ICruiseServer)); mockCruiseServer.Expect("Start"); mockCruiseServer.Expect("WaitForExit"); + Mock mockCruiseServerFactory = new DynamicMock(typeof(ICruiseServerFactory)); + mockCruiseServerFactory.ExpectAndReturn("Create", mockCruiseServer.MockInstance, parser.IsRemote, parser.ConfigFile); ! new ConsoleRunner(parser, (ICruiseServerFactory)mockCruiseServerFactory.MockInstance).Run(); mockCruiseServer.Verify(); |
|
From: Owen R. <exo...@us...> - 2004-11-26 04:53:19
|
Update of /cvsroot/ccnet/ccnet/project/service In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17546/project/service Modified Files: CCService.cs Log Message: refactoring CruiseServerFactory and verifying that the server is shutting down properly Index: CCService.cs =================================================================== RCS file: /cvsroot/ccnet/ccnet/project/service/CCService.cs,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** CCService.cs 28 Oct 2004 17:27:19 -0000 1.13 --- CCService.cs 26 Nov 2004 04:53:09 -0000 1.14 *************** *** 49,53 **** } ! server = CruiseServerFactory.Create(UseRemoting(), configFile); server.Start(); } --- 49,53 ---- } ! server = new CruiseServerFactory().Create(UseRemoting(), configFile); server.Start(); } |
|
From: Owen R. <exo...@us...> - 2004-11-26 04:53:18
|
Update of /cvsroot/ccnet/ccnet/project/console In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17546/project/console Modified Files: ConsoleEventHandler.cs ConsoleRunner.cs Log Message: refactoring CruiseServerFactory and verifying that the server is shutting down properly Index: ConsoleRunner.cs =================================================================== RCS file: /cvsroot/ccnet/ccnet/project/console/ConsoleRunner.cs,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** ConsoleRunner.cs 15 Nov 2004 05:45:20 -0000 1.17 --- ConsoleRunner.cs 26 Nov 2004 04:53:07 -0000 1.18 *************** *** 9,13 **** /// Runs CruiseControl.NET from the console. /// </summary> ! class ConsoleRunner { [STAThread] --- 9,13 ---- /// Runs CruiseControl.NET from the console. /// </summary> ! internal class ConsoleRunner { [STAThread] *************** *** 16,20 **** try { ! new ConsoleRunner(new ArgumentParser(args)).Run(); } catch (Exception ex) --- 16,20 ---- try { ! new ConsoleRunner(new ArgumentParser(args), new CruiseServerFactory()).Run(); } catch (Exception ex) *************** *** 22,37 **** Log.Error(ex); } ! } ! ! private ArgumentParser _parser; ! private ICruiseServer _server; ! public ConsoleRunner(ArgumentParser parser) : ! this(parser, CruiseServerFactory.Create(parser.IsRemote, parser.ConfigFile)) { } ! public ConsoleRunner(ArgumentParser parser, ICruiseServer server) { _parser = parser; ! _server = server; } --- 22,35 ---- Log.Error(ex); } ! } ! private readonly ArgumentParser _parser; ! private readonly ICruiseServerFactory _serverFactory; ! private ICruiseServer server; ! public ConsoleRunner(ArgumentParser parser, ICruiseServerFactory serverFactory) { _parser = parser; ! _serverFactory = serverFactory; } *************** *** 51,64 **** { handler.OnConsoleEvent += new EventHandler(HandleControlEvent); ! ! if (_parser.Project == null) ! { ! _server.Start(); ! _server.WaitForExit(); ! } ! else { ! _server.ForceBuild(_parser.Project); ! _server.WaitForExit(_parser.Project); } } --- 49,65 ---- { handler.OnConsoleEvent += new EventHandler(HandleControlEvent); ! ! using (server = _serverFactory.Create(_parser.IsRemote, _parser.ConfigFile)) { ! if (_parser.Project == null) ! { ! server.Start(); ! server.WaitForExit(); ! } ! else ! { ! server.ForceBuild(_parser.Project); ! server.WaitForExit(_parser.Project); ! } } } *************** *** 67,73 **** private void HandleControlEvent(object sender, EventArgs args) { ! ConsoleEventHandler handler = (ConsoleEventHandler)sender; ! handler.OnConsoleEvent -= new EventHandler(HandleControlEvent); // remove handler to prevent event from being called again ! _server.Dispose(); } } --- 68,72 ---- private void HandleControlEvent(object sender, EventArgs args) { ! server.Dispose(); } } Index: ConsoleEventHandler.cs =================================================================== RCS file: /cvsroot/ccnet/ccnet/project/console/ConsoleEventHandler.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ConsoleEventHandler.cs 27 Jul 2004 17:12:46 -0000 1.1 --- ConsoleEventHandler.cs 26 Nov 2004 04:53:07 -0000 1.2 *************** *** 10,25 **** { private ControlEventHandler handler; ! ! public delegate void ControlEventHandler(ConsoleEvent consoleEvent); ! public EventHandler OnConsoleEvent; ! ! public enum ConsoleEvent ! { ! CTRL_C = 0, // From wincom.h ! CTRL_BREAK = 1, ! CTRL_CLOSE = 2, ! CTRL_LOGOFF = 5, ! CTRL_SHUTDOWN = 6 ! } public ConsoleEventHandler() --- 10,14 ---- { private ControlEventHandler handler; ! public event EventHandler OnConsoleEvent; public ConsoleEventHandler() *************** *** 57,60 **** --- 46,61 ---- } + private delegate void ControlEventHandler(ConsoleEvent consoleEvent); + + // From wincom.h + private enum ConsoleEvent + { + CTRL_C = 0, + CTRL_BREAK = 1, + CTRL_CLOSE = 2, + CTRL_LOGOFF = 5, + CTRL_SHUTDOWN = 6 + } + [DllImport("kernel32.dll")] static extern bool SetConsoleCtrlHandler(ControlEventHandler e, bool add); |
|
From: Owen R. <exo...@us...> - 2004-11-26 04:34:38
|
Update of /cvsroot/ccnet/ccnet/project/core/publishers/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14780/project/core/publishers/test Modified Files: EmailPublisherTest.cs Log Message: eliminating debug output from EmailPublisherTest Index: EmailPublisherTest.cs =================================================================== RCS file: /cvsroot/ccnet/ccnet/project/core/publishers/test/EmailPublisherTest.cs,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** EmailPublisherTest.cs 22 Nov 2004 14:44:39 -0000 1.18 --- EmailPublisherTest.cs 26 Nov 2004 04:34:29 -0000 1.19 *************** *** 95,99 **** _publisher.IncludeDetails = true; string message = _publisher.CreateMessage(CreateIntegrationResult(IntegrationStatus.Success, IntegrationStatus.Success)); - Console.Out.WriteLine("message = {0}", message); Assert.IsTrue(message.StartsWith("<html>")); Assert.IsTrue(message.IndexOf("CruiseControl.NET Build Results for project Project#9") > 0); --- 95,98 ---- |
|
From: Owen R. <exo...@us...> - 2004-11-26 04:32:25
|
Update of /cvsroot/ccnet/ccnet/project/core/publishers In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14385/project/core/publishers Modified Files: ForceBuildPublisher.cs Log Message: defaulting ServerUri in ForceBuildPublisher to default uri for local server Index: ForceBuildPublisher.cs =================================================================== RCS file: /cvsroot/ccnet/ccnet/project/core/publishers/ForceBuildPublisher.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ForceBuildPublisher.cs 22 Nov 2004 14:43:51 -0000 1.1 --- ForceBuildPublisher.cs 26 Nov 2004 04:32:05 -0000 1.2 *************** *** 19,24 **** public string Project; ! [ReflectorProperty("serverUri")] ! public string ServerUri; [ReflectorProperty("integrationStatus", Required=false)] --- 19,24 ---- public string Project; ! [ReflectorProperty("serverUri", Required=false)] ! public string ServerUri = string.Format("tcp://localhost:21234/{0}", RemoteCruiseServer.URI); [ReflectorProperty("integrationStatus", Required=false)] |
|
From: Owen R. <exo...@us...> - 2004-11-26 04:32:25
|
Update of /cvsroot/ccnet/ccnet/project/core/publishers/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14385/project/core/publishers/test Modified Files: ForceBuildPublisherTest.cs Log Message: defaulting ServerUri in ForceBuildPublisher to default uri for local server Index: ForceBuildPublisherTest.cs =================================================================== RCS file: /cvsroot/ccnet/ccnet/project/core/publishers/test/ForceBuildPublisherTest.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ForceBuildPublisherTest.cs 22 Nov 2004 14:43:52 -0000 1.1 --- ForceBuildPublisherTest.cs 26 Nov 2004 04:32:07 -0000 1.2 *************** *** 25,32 **** public void PopulateFromMinimalXml() { ! string xml = @"<forcebuild project=""proj"" serverUri=""http://localhost"" />"; ForceBuildPublisher publisher = NetReflector.Read(xml) as ForceBuildPublisher; Assert.AreEqual("proj", publisher.Project); ! Assert.AreEqual("http://localhost", publisher.ServerUri); Assert.AreEqual(IntegrationStatus.Success, publisher.IntegrationStatus); } --- 25,32 ---- public void PopulateFromMinimalXml() { ! string xml = @"<forcebuild project=""proj"" />"; ForceBuildPublisher publisher = NetReflector.Read(xml) as ForceBuildPublisher; Assert.AreEqual("proj", publisher.Project); ! Assert.AreEqual("tcp://localhost:21234/CruiseManager.rem", publisher.ServerUri); Assert.AreEqual(IntegrationStatus.Success, publisher.IntegrationStatus); } |
|
From: Owen R. <exo...@us...> - 2004-11-24 14:30:12
|
Update of /cvsroot/ccnet/ccnet/project/core/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23127/project/core/util Modified Files: XmlFragmentWriter.cs Log Message: fixing XmlFragmentWriter to preserve formatting (indenting) if specified Index: XmlFragmentWriter.cs =================================================================== RCS file: /cvsroot/ccnet/ccnet/project/core/util/XmlFragmentWriter.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** XmlFragmentWriter.cs 15 Nov 2004 05:18:47 -0000 1.1 --- XmlFragmentWriter.cs 24 Nov 2004 14:29:47 -0000 1.2 *************** *** 41,48 **** { StringWriter buffer = new StringWriter(); ! new XmlFragmentWriter(buffer).WriteNodeBase(reader, defattr); WriteRaw(buffer.ToString()); } private void WriteNodeBase(XmlReader reader, bool defattr) { --- 41,56 ---- { StringWriter buffer = new StringWriter(); ! XmlFragmentWriter writer = CreateXmlWriter(buffer); ! writer.WriteNodeBase(reader, defattr); WriteRaw(buffer.ToString()); } + private XmlFragmentWriter CreateXmlWriter(StringWriter buffer) + { + XmlFragmentWriter writer = new XmlFragmentWriter(buffer); + writer.Formatting = Formatting; + return writer; + } + private void WriteNodeBase(XmlReader reader, bool defattr) { |
|
From: Owen R. <exo...@us...> - 2004-11-24 14:29:57
|
Update of /cvsroot/ccnet/ccnet/project/UnitTests/Core/Util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23127/project/UnitTests/Core/Util Modified Files: XmlFragmentWriterTest.cs Log Message: fixing XmlFragmentWriter to preserve formatting (indenting) if specified Index: XmlFragmentWriterTest.cs =================================================================== RCS file: /cvsroot/ccnet/ccnet/project/UnitTests/Core/Util/XmlFragmentWriterTest.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** XmlFragmentWriterTest.cs 15 Nov 2004 05:18:46 -0000 1.1 --- XmlFragmentWriterTest.cs 24 Nov 2004 14:29:47 -0000 1.2 *************** *** 1,3 **** --- 1,4 ---- using System.IO; + using System.Xml; using NUnit.Framework; using ThoughtWorks.CruiseControl.Core.Util; *************** *** 67,70 **** --- 68,81 ---- Assert.AreEqual("<![CDATA[<tag><c>] ]></tag>]]>", baseWriter.ToString()); } + + [Test] + public void IndentOutputWhenFormattingIsSpecified() + { + writer.Formatting = Formatting.Indented; + writer.WriteNode("<foo><bar/></foo>"); + Assert.AreEqual(@"<foo> + <bar /> + </foo>", baseWriter.ToString()); + } } } |
|
From: Owen R. <exo...@us...> - 2004-11-24 14:29:17
|
Update of /cvsroot/ccnet/ccnet/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22944/doc Modified Files: index.html Log Message: changed index.html to use case-sensitive links -- required for hosting pages on sourceforge Index: index.html =================================================================== RCS file: /cvsroot/ccnet/ccnet/doc/index.html,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** index.html 1 Nov 2004 22:55:39 -0000 1.16 --- index.html 24 Nov 2004 14:29:04 -0000 1.17 *************** *** 2,6 **** <head> <title>CruiseControl.NET : ReadMe</title> ! <link rel="stylesheet" href="ccnet/styles/site.css" type="text/css" /> </head> --- 2,6 ---- <head> <title>CruiseControl.NET : ReadMe</title> ! <link rel="stylesheet" href="CCNET/styles/site.css" type="text/css" /> </head> *************** *** 26,34 **** <ul class="star"> ! <li> <a href="ccnet/Documentation.html">Documentation</a></li> ! <li> <a href="ccnet/License.html">License</a></li> ! <li> <a href="ccnet/Project Details.html">Project Details</a></li> ! <li> <a href="ccnet/Support.html">Support</a></li> ! <li> <a href="ccnet/Project Team.html">Project Team</a></li> </ul> </td> --- 26,34 ---- <ul class="star"> ! <li> <a href="CCNET/Documentation.html">Documentation</a></li> ! <li> <a href="CCNET/License.html">License</a></li> ! <li> <a href="CCNET/Project Details.html">Project Details</a></li> ! <li> <a href="CCNET/Support.html">Support</a></li> ! <li> <a href="CCNET/Project Team.html">Project Team</a></li> </ul> </td> |
|
From: Mike R. <mik...@us...> - 2004-11-24 05:57:25
|
Update of /cvsroot/ccnet/ccnet In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19359 Modified Files: b.bat Log Message: Testing new CVS update Index: b.bat =================================================================== RCS file: /cvsroot/ccnet/ccnet/b.bat,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** b.bat 18 Oct 2004 13:09:06 -0000 1.12 --- b.bat 24 Nov 2004 05:57:13 -0000 1.13 *************** *** 1,3 **** @echo off cls ! tools\nant\NAnt.exe -buildfile:ccnet.build -nologo %* \ No newline at end of file --- 1,3 ---- @echo off cls ! tools\nant\NAnt.exe -buildfile:ccnet.build -nologo %* |
|
From: irfan <os...@us...> - 2004-11-24 05:18:12
|
Update of /cvsroot/ccnet/ccnet/project/core/sourcecontrol In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11117/project/core/sourcecontrol Modified Files: CvsHistoryParser.cs Log Message: fixing jira issue CCNET-243 changed parseexact to parse Index: CvsHistoryParser.cs =================================================================== RCS file: /cvsroot/ccnet/ccnet/project/core/sourcecontrol/CvsHistoryParser.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** CvsHistoryParser.cs 23 Nov 2004 00:49:56 -0000 1.7 --- CvsHistoryParser.cs 24 Nov 2004 05:18:01 -0000 1.8 *************** *** 8,13 **** public class CvsHistoryParser : IHistoryParser { - #region cvs constants - /// <summary> /// This line delimits seperate files in the CVS log information. --- 8,11 ---- *************** *** 58,69 **** internal static readonly string CVSDATE_FORMAT = "yyyy-MM-dd HH:mm:ss 'GMT'"; - - /// <summary> - /// This is the date format returned in the log information from CVS. - /// </summary> - internal static readonly string LOGDATE_FORMAT = "yyyy/MM/dd HH:mm:ss z"; - - #endregion - private string _currentLine; private string _workingFileName; --- 56,59 ---- *************** *** 229,237 **** internal DateTime ParseModifiedTime(string dateStamp, string timeStamp) { ! string dateTimeString = string.Format("{0} {1} +0", dateStamp, timeStamp); ! return DateTime.ParseExact( ! dateTimeString, ! LOGDATE_FORMAT, ! DateTimeFormatInfo.GetInstance(CultureInfo.InvariantCulture)); } --- 219,224 ---- internal DateTime ParseModifiedTime(string dateStamp, string timeStamp) { ! string dateTimeString = string.Format("{0} {1} GMT", dateStamp, timeStamp); ! return DateTime.Parse(dateTimeString, DateTimeFormatInfo.GetInstance(CultureInfo.InvariantCulture)); } |
|
From: irfan <os...@us...> - 2004-11-24 05:18:12
|
Update of /cvsroot/ccnet/ccnet/project/core/sourcecontrol/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11117/project/core/sourcecontrol/test Modified Files: CvsMother.cs Log Message: fixing jira issue CCNET-243 changed parseexact to parse Index: CvsMother.cs =================================================================== RCS file: /cvsroot/ccnet/ccnet/project/core/sourcecontrol/test/CvsMother.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** CvsMother.cs 28 Dec 2003 20:54:21 -0000 1.3 --- CvsMother.cs 24 Nov 2004 05:18:01 -0000 1.4 *************** *** 1,28 **** using System; - using ThoughtWorks.CruiseControl.Core.Util; namespace ThoughtWorks.CruiseControl.Core.Sourcecontrol.Test { - /// <summary> - /// Summary description for CvsMother. - /// </summary> public class CvsMother { - public static readonly string CVS_TEMP_DIR = "cvsLogDir"; - - public static string CVS_TEST_LOGFILE - { - get { return TempFileUtil.CreateTempFile(CVS_TEMP_DIR, "cvslog.txt", CVS_LOGFILE_CONTENT); } - } - public static DateTime OLDEST_ENTRY = DateTime.Parse("2002/03/13 19:38:42"); public static DateTime NEWEST_ENTRY = DateTime.Parse("2002/03/15 19:20:28"); ! #region CVS_LOGFILE_CONTENT ! public static string CVS_LOGFILE_CONTENT { ! get ! { ! return @"RCS file: /cvsroot/cruisecontrol/cruisecontrol/main/README.txt,v Working file: main/README.txt head: 1.1 --- 1,14 ---- using System; namespace ThoughtWorks.CruiseControl.Core.Sourcecontrol.Test { public class CvsMother { public static DateTime OLDEST_ENTRY = DateTime.Parse("2002/03/13 19:38:42"); public static DateTime NEWEST_ENTRY = DateTime.Parse("2002/03/15 19:20:28"); ! public static string CVS_LOGFILE_CONTENT { ! get { return @"RCS file: /cvsroot/cruisecontrol/cruisecontrol/main/README.txt,v Working file: main/README.txt head: 1.1 *************** *** 208,215 **** Hey, look, another deleted file. ============================================================================= ! "; ! } } - #endregion } ! } --- 194,199 ---- Hey, look, another deleted file. ============================================================================= ! "; } } } ! } \ No newline at end of file |
|
From: Mike R. <mik...@us...> - 2004-11-23 00:50:07
|
Update of /cvsroot/ccnet/ccnet/project/core/sourcecontrol In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10640/project/core/sourcecontrol Modified Files: CvsHistoryParser.cs Log Message: Backing out previous change (too much output) Index: CvsHistoryParser.cs =================================================================== RCS file: /cvsroot/ccnet/ccnet/project/core/sourcecontrol/CvsHistoryParser.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** CvsHistoryParser.cs 23 Nov 2004 00:09:08 -0000 1.6 --- CvsHistoryParser.cs 23 Nov 2004 00:49:56 -0000 1.7 *************** *** 3,7 **** using System.Globalization; using System.IO; - using ThoughtWorks.CruiseControl.Core.Util; namespace ThoughtWorks.CruiseControl.Core.Sourcecontrol --- 3,6 ---- *************** *** 78,90 **** public Modification[] Parse(TextReader cvsLog, DateTime from, DateTime to) { - string cvsOutput = cvsLog.ReadToEnd(); - Log.Debug(string.Format("Attempting to parse the following CVS Output:\n---Start of CVS output---\n{0}\n---End Of Cvs output---", cvsOutput)); - - StringReader cvsOutputReader = new StringReader(cvsOutput); - // Read to the first RCS file name. The first entry in the log // information will begin with this line. A CVS_FILE_DELIMITER is NOT // present. If no RCS file lines are found then there is nothing to do. ! _currentLine = ReadToNotPast(cvsOutputReader, CVS_RCSFILE_LINE, null); ArrayList mods = new ArrayList(); --- 77,84 ---- public Modification[] Parse(TextReader cvsLog, DateTime from, DateTime to) { // Read to the first RCS file name. The first entry in the log // information will begin with this line. A CVS_FILE_DELIMITER is NOT // present. If no RCS file lines are found then there is nothing to do. ! _currentLine = ReadToNotPast(cvsLog, CVS_RCSFILE_LINE, null); ArrayList mods = new ArrayList(); *************** *** 93,97 **** // Parse the single file entry, which may include several // modifications. ! IList entryList = ParseFileEntry(cvsOutputReader); //Add all the modifications to the local list. --- 87,91 ---- // Parse the single file entry, which may include several // modifications. ! IList entryList = ParseFileEntry(cvsLog); //Add all the modifications to the local list. *************** *** 100,104 **** // Read to the next RCS file line. The CVS_FILE_DELIMITER may have // been consumed by the parseEntry method, so we cannot read to it. ! _currentLine = ReadToNotPast(cvsOutputReader, CVS_RCSFILE_LINE, null); } --- 94,98 ---- // Read to the next RCS file line. The CVS_FILE_DELIMITER may have // been consumed by the parseEntry method, so we cannot read to it. ! _currentLine = ReadToNotPast(cvsLog, CVS_RCSFILE_LINE, null); } |
|
From: Mike R. <mik...@us...> - 2004-11-23 00:09:21
|
Update of /cvsroot/ccnet/ccnet/project/core/sourcecontrol In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1383/project/core/sourcecontrol Modified Files: CvsHistoryParser.cs Log Message: Adding more logging to CVS Plugin (CCNET-192) Index: CvsHistoryParser.cs =================================================================== RCS file: /cvsroot/ccnet/ccnet/project/core/sourcecontrol/CvsHistoryParser.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** CvsHistoryParser.cs 15 Nov 2004 05:43:19 -0000 1.5 --- CvsHistoryParser.cs 23 Nov 2004 00:09:08 -0000 1.6 *************** *** 3,6 **** --- 3,7 ---- using System.Globalization; using System.IO; + using ThoughtWorks.CruiseControl.Core.Util; namespace ThoughtWorks.CruiseControl.Core.Sourcecontrol *************** *** 77,84 **** public Modification[] Parse(TextReader cvsLog, DateTime from, DateTime to) { // Read to the first RCS file name. The first entry in the log // information will begin with this line. A CVS_FILE_DELIMITER is NOT // present. If no RCS file lines are found then there is nothing to do. ! _currentLine = ReadToNotPast(cvsLog, CVS_RCSFILE_LINE, null); ArrayList mods = new ArrayList(); --- 78,90 ---- public Modification[] Parse(TextReader cvsLog, DateTime from, DateTime to) { + string cvsOutput = cvsLog.ReadToEnd(); + Log.Debug(string.Format("Attempting to parse the following CVS Output:\n---Start of CVS output---\n{0}\n---End Of Cvs output---", cvsOutput)); + + StringReader cvsOutputReader = new StringReader(cvsOutput); + // Read to the first RCS file name. The first entry in the log // information will begin with this line. A CVS_FILE_DELIMITER is NOT // present. If no RCS file lines are found then there is nothing to do. ! _currentLine = ReadToNotPast(cvsOutputReader, CVS_RCSFILE_LINE, null); ArrayList mods = new ArrayList(); *************** *** 87,91 **** // Parse the single file entry, which may include several // modifications. ! IList entryList = ParseFileEntry(cvsLog); //Add all the modifications to the local list. --- 93,97 ---- // Parse the single file entry, which may include several // modifications. ! IList entryList = ParseFileEntry(cvsOutputReader); //Add all the modifications to the local list. *************** *** 94,98 **** // Read to the next RCS file line. The CVS_FILE_DELIMITER may have // been consumed by the parseEntry method, so we cannot read to it. ! _currentLine = ReadToNotPast(cvsLog, CVS_RCSFILE_LINE, null); } --- 100,104 ---- // Read to the next RCS file line. The CVS_FILE_DELIMITER may have // been consumed by the parseEntry method, so we cannot read to it. ! _currentLine = ReadToNotPast(cvsOutputReader, CVS_RCSFILE_LINE, null); } |
|
From: Mike R. <mik...@us...> - 2004-11-22 23:50:35
|
Update of /cvsroot/ccnet/ccnet/project/WebDashboard In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29704/project/WebDashboard Modified Files: Web.config Log Message: backing out change that made web app edittable by default Index: Web.config =================================================================== RCS file: /cvsroot/ccnet/ccnet/project/WebDashboard/Web.config,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** Web.config 21 Nov 2004 21:57:01 -0000 1.30 --- Web.config 22 Nov 2004 23:50:25 -0000 1.31 *************** *** 28,32 **** --- 28,36 ---- <appSettings> <add key="cachedirectory" value="projectcache" /> + <!-- + Only Turn this on (i.e. uncomment it) if you want *anyone* that can access the dashboard able to add / edit / delete projects <add key="AllowSecureActions" value="true" /> + NB - make sure you really want to do this!! + --> </appSettings> <system.web> |
|
From: Mike R. <mik...@us...> - 2004-11-22 23:46:13
|
Update of /cvsroot/ccnet/ccnet/project/xsl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28672/project/xsl Added Files: emma.xsl Log Message: CCNET-217 - support for Emma code coverage (patch by Donal McCarthy) --- NEW FILE: emma.xsl --- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/TR/xhtml1/strict"> <xsl:output method="html"/> <xsl:template match="/"> <xsl:apply-templates select="//report/data/all[./coverage/@value != '']" /> </xsl:template> <xsl:template match="all"> <table class="section-table" cellpadding="2" cellspacing="0" border="0" width="98%"> <tr> <td class="unittests-sectionheader" colspan="2"> <!-- Test Coverage Summary --> EMMA - Test Coverage: <xsl:value-of select="substring-before(./coverage/@value, '%')"/>% </td> </tr> <tr> <td> <div style="color: maroon; font-size: 10pt; font-weight: bold;"> Package breakdown: </div> </td> </tr> <tr> <td> <br /> <table border="1" cellpadding="3" cellspacing="0" bordercolor="black" width="100%"> <tr> <td>Line Coverage %</td> <td>Package</td> </tr> <xsl:apply-templates select="package/coverage[@type = 'line, %']"> <xsl:sort data-type="number" select="number(substring-before(@value, '%'))"/> </xsl:apply-templates> </table> </td> </tr> </table> </xsl:template> <xsl:template match="coverage"> <tr> <xsl:choose> <xsl:when test="substring-before(@value, '%') < 80"> <td bgcolor="#FFCCCC" width="20%"> <xsl:value-of select="substring-before(@value, '%')"/> </td> </xsl:when> <xsl:otherwise> <td bgcolor="#ccffcc" width="20%"> <xsl:value-of select="substring-before(@value, '%')"/> </td> </xsl:otherwise> </xsl:choose> <td bgcolor="#FFFFEE"> <xsl:value-of select="../@name"/> </td> </tr> </xsl:template> </xsl:stylesheet> |
|
From: Mike R. <mik...@us...> - 2004-11-22 23:22:29
|
Update of /cvsroot/ccnet/ccnet/project/xsl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23883/project/xsl Modified Files: NCover.xsl Log Message: CCNet-219 - Better NCover reporting (patch supplied by Donal McCarthy) Index: NCover.xsl =================================================================== RCS file: /cvsroot/ccnet/ccnet/project/xsl/NCover.xsl,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** NCover.xsl 19 Sep 2004 14:23:23 -0000 1.1 --- NCover.xsl 22 Nov 2004 23:21:52 -0000 1.2 *************** *** 2,69 **** <xsl:output method="html"/> <xsl:template match="/"> ! <xsl:apply-templates select="//coverage" /> </xsl:template> <xsl:template match="coverage"> ! <html> ! <head> ! <title>Code Coverage Report</title> ! </head> ! <body> ! <div style="font-size: 12pt; font-weight: bold;">Code Coverage Report</div> ! <p/> <xsl:apply-templates select="module"/> ! </body> ! </html> </xsl:template> <xsl:template match="module"> ! <div style="font-size: 10pt"> ! <xsl:value-of select="@assembly"/> ! </div> ! <p/> ! <xsl:apply-templates select="method"/> </xsl:template> <xsl:template match="method"> <div style="color: maroon; font-size: 10pt; font-weight: bold;"> <xsl:value-of select="@class"/>.<xsl:value-of select="@name"/> ! </div> ! <table border="1" cellpadding="3" cellspacing="0" bordercolor="black"> ! <tr> ! <td bgcolor="DDEEFF">Visit Count</td> ! <td bgcolor="DDEEFF">Line</td> ! <td bgcolor="DDEEFF">Column</td> ! <td bgcolor="DDEEFF">End Line</td> ! <td bgcolor="DDEEFF">End Column</td> ! <td bgcolor="DDEEFF">Document</td> ! </tr> ! <xsl:apply-templates select="seqpnt"/> </table> <p/> </xsl:template> <xsl:template match="seqpnt"> <tr> ! <td bgcolor="#FFFFEE"> ! <xsl:attribute name="bgcolor"> ! <xsl:choose> ! <xsl:when test="@visitcount = 0">#FFCCCC</xsl:when> ! <xsl:otherwise>#FFFFEE</xsl:otherwise> ! </xsl:choose> ! </xsl:attribute> ! <xsl:value-of select="@visitcount"/> ! </td> ! <td bgcolor="#FFFFEE"> ! <xsl:value-of select="@line"/> ! </td> ! <td bgcolor="#FFFFEE"> ! <xsl:value-of select="@column"/> ! </td> ! <td bgcolor="#FFFFEE"> ! <xsl:value-of select="@endline"/> ! </td> ! <td bgcolor="#FFFFEE"> ! <xsl:value-of select="@endcolumn"/> ! </td> ! <td bgcolor="#FFFFEE"> ! <xsl:value-of select="@document"/> ! </td> </tr> </xsl:template> --- 2,70 ---- <xsl:output method="html"/> <xsl:template match="/"> ! <xsl:apply-templates select="//coverage[count(module) != 0]" /> </xsl:template> <xsl:template match="coverage"> ! ! <table class="section-table" cellpadding="2" cellspacing="0" border="0" width="98%"> ! ! <tr> ! <td class="unittests-sectionheader" colspan="2"> ! <!-- Test Coverage Summary --> ! ! NCover - Test Coverage: ! <xsl:value-of select= ! "round((count(//coverage/module/method/seqpnt[@visitcount > 0]) div count(//coverage/module/method/seqpnt)) * 100)"/>% ! </td> ! </tr> ! <tr> ! <td> ! <div style="color: maroon; font-size: 10pt; font-weight: bold;"> ! Untested Code: ! </div> ! </td> ! </tr> ! <tr> ! <td> <xsl:apply-templates select="module"/> ! </td> ! </tr> ! ! </table> </xsl:template> + <xsl:template match="module"> ! <br /> ! <xsl:apply-templates select="method[./seqpnt[@visitcount = 0]]"/> </xsl:template> + <xsl:template match="method"> <div style="color: maroon; font-size: 10pt; font-weight: bold;"> <xsl:value-of select="@class"/>.<xsl:value-of select="@name"/> ! </div> ! <table border="1" cellpadding="3" cellspacing="0" bordercolor="black" width="100%"> ! <xsl:apply-templates select="seqpnt[@visitcount = 0]"/> </table> <p/> </xsl:template> + <xsl:template match="seqpnt"> <tr> ! <xsl:if test="@line != 16707566"> ! ! <td bgcolor="#FFCCCC" width="15%"> ! Line: <xsl:value-of select="@line"/> ! </td> ! <td bgcolor="#FFFFEE"> ! <xsl:choose> ! <!-- if this build is off the default CCNet working directory, shorten the path to show only the bits in version control. --> ! <xsl:when test="contains(@document, '\WorkingDirectory\')"> ! <xsl:value-of select="substring-after(@document, '\WorkingDirectory\')"/> ! </xsl:when> ! <xsl:otherwise> ! <xsl:value-of select="@document"/> ! </xsl:otherwise> ! </xsl:choose> ! </td> ! </xsl:if> </tr> </xsl:template> |
|
From: Mike R. <mik...@us...> - 2004-11-22 23:18:30
|
Update of /cvsroot/ccnet/ccnet/project/xsl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23159/project/xsl Modified Files: unittests.xsl Log Message: CCNET-218 - unit test summary now works for JUnit too (not just NUnit) patch by Donal McCarthy Index: unittests.xsl =================================================================== RCS file: /cvsroot/ccnet/ccnet/project/xsl/unittests.xsl,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** unittests.xsl 19 Sep 2004 14:23:23 -0000 1.1 --- unittests.xsl 22 Nov 2004 23:18:19 -0000 1.2 *************** *** 22,26 **** --- 22,32 ---- <xsl:variable name="totalErrorsAndFailures" select="count($testcase.error.list) + count($testcase.failure.list) + count($nunit2.failure.list)"/> + <xsl:variable name="nunit.tests.present" select="count(//test-results) > 0 or count(/cruisecontrol/build/buildresults//testsuite) > 0" /> + <xsl:variable name="junit.tests.present" select="count(//cruisecontrol//testsuite) > 0" /> + <xsl:template match="/"> + + <xsl:choose> + <xsl:when test="$nunit.tests.present"> <table class="section-table" cellpadding="2" cellspacing="0" border="0" width="98%"> *************** *** 85,88 **** --- 91,169 ---- </xsl:if> </table> + </xsl:when> + + <xsl:when test="$junit.tests.present"> + <xsl:variable name="testsuite.list" select="cruisecontrol//testsuite"/> + <xsl:variable name="testsuite.error.count" select="count($testsuite.list/error)"/> + <xsl:variable name="testcase.list" select="$testsuite.list/testcase"/> + <xsl:variable name="testcase.error.list" select="$testcase.list/error"/> + <xsl:variable name="testcase.failure.list" select="$testcase.list/failure"/> + <xsl:variable name="totalErrorsAndFailures" select="count($testcase.error.list) + count($testcase.failure.list)"/> + + + <table align="center" cellpadding="2" cellspacing="0" border="0" width="100%"> + + <!-- Unit Tests --> + <tr> + <td class="unittests-sectionheader" colspan="2"> + Tests run: <xsl:value-of select="count($testcase.list)"/>, +  Failures: <xsl:value-of select="$totalErrorsAndFailures"/>, +  Time: <xsl:value-of select="sum($testcase.list/@time)"/> seconds + </td> + </tr> + + <xsl:choose> + <xsl:when test="count($testsuite.list) = 0"> + <tr> + <td colspan="2" class="unittests-data"> + No Tests Run + </td> + </tr> + <tr> + <td colspan="2" class="unittests-error"> + This project doesn't have any tests + </td> + </tr> + </xsl:when> + + <xsl:when test="$totalErrorsAndFailures = 0"> + <tr> + <td colspan="2" class="unittests-data"> + All Tests Passed + </td> + </tr> + </xsl:when> + </xsl:choose> + + <xsl:apply-templates select="$testcase.error.list"/> + <xsl:apply-templates select="$testcase.failure.list"/> + <tr/> + <tr><td colspan="2"> </td></tr> + + <xsl:if test="$totalErrorsAndFailures > 0"> + + <tr> + <td class="unittests-sectionheader" colspan="2"> +  Unit Test Failure and Error Details: (<xsl:value-of select="$totalErrorsAndFailures"/>) + </td> + </tr> + + <!-- (PENDING) Why doesn't this work if set up as variables up top? --> + <xsl:call-template name="testdetail"> + <xsl:with-param name="detailnodes" select="//testsuite/testcase[.//error]"/> + </xsl:call-template> + + <xsl:call-template name="testdetail"> + <xsl:with-param name="detailnodes" select="//testsuite/testcase[.//failure]"/> + </xsl:call-template> + + + <tr><td colspan="2"> </td></tr> + </xsl:if> + </table> + + </xsl:when> + + </xsl:choose> </xsl:template> |
|
From: Mike R. <mik...@us...> - 2004-11-22 22:42:28
|
Update of /cvsroot/ccnet/ccnet/project/core/sourcecontrol In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14758/project/core/sourcecontrol Modified Files: Svn.cs Log Message: CCNET-211 - Proposed GetSource() Impl for subversion Index: Svn.cs =================================================================== RCS file: /cvsroot/ccnet/ccnet/project/core/sourcecontrol/Svn.cs,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Svn.cs 15 Nov 2004 05:41:06 -0000 1.14 --- Svn.cs 22 Nov 2004 22:42:18 -0000 1.15 *************** *** 12,15 **** --- 12,16 ---- internal static readonly string HISTORY_COMMAND_FORMAT = "log -v -r \"{{{0}}}:{{{1}}}\" --xml --non-interactive {2}"; internal static readonly string TAG_COMMAND_FORMAT = "copy -m \"CCNET build {0}\" {1} {2}/{0} --non-interactive"; + internal static readonly string GET_SOURCE_COMMAND_FORMAT = "update --non-interactive"; internal static readonly string COMMAND_DATE_FORMAT = "yyyy-MM-ddTHH:mm:ssZ"; *************** *** 78,81 **** --- 79,85 ---- public string Password; + [ReflectorProperty("autoGetSource", Required = false)] + public bool AutoGetSource = false; + public string FormatCommandDate(DateTime date) { *************** *** 133,136 **** --- 137,163 ---- return buffer.ToString(); } + + public override void GetSource(IIntegrationResult result) + { + if (AutoGetSource) + { + ProcessInfo info = new ProcessInfo(Executable, BuildGetSourceArguments(result.LastChangeNumber), WorkingDirectory); + Log.Info(string.Format("Getting source from Subversion: {0} {1}", info.FileName, info.Arguments)); + Execute(info); + } + } + + private string BuildGetSourceArguments(int revision) + { + StringBuilder buffer = new StringBuilder(); + buffer.Append(GET_SOURCE_COMMAND_FORMAT); + if (revision > 0) + { + buffer.Append(" -r"); + buffer.Append(revision); + } + AppendUsernameAndPassword(buffer); + return buffer.ToString(); + } } } \ No newline at end of file |
|
From: Mike R. <mik...@us...> - 2004-11-22 22:42:28
|
Update of /cvsroot/ccnet/ccnet/project/core/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14758/project/core/test Modified Files: IntegrationResultTest.cs Log Message: CCNET-211 - Proposed GetSource() Impl for subversion Index: IntegrationResultTest.cs =================================================================== RCS file: /cvsroot/ccnet/ccnet/project/core/test/IntegrationResultTest.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** IntegrationResultTest.cs 23 Aug 2004 12:38:20 -0000 1.4 --- IntegrationResultTest.cs 22 Nov 2004 22:42:18 -0000 1.5 *************** *** 46,49 **** --- 46,73 ---- Assert.IsTrue(initial.IsInitial()); } + + [Test] + public void ShouldReturnZeroAsLastChangeNumberIfNoModifications() + { + Assert.AreEqual(0, new IntegrationResult().LastChangeNumber); + } + + [Test] + public void ShouldReturnTheMaximumChangeNumberFromAllModificationsForLastChangeNumber() + { + Modification mod1 = new Modification(); + mod1.ChangeNumber = 10; + + Modification mod2 = new Modification(); + mod2.ChangeNumber = 20; + + IntegrationResult result = new IntegrationResult(); + result.Modifications = new Modification[] { mod1 }; + Assert.AreEqual(10, result.LastChangeNumber); + result.Modifications = new Modification[] { mod1, mod2 }; + Assert.AreEqual(20, result.LastChangeNumber); + result.Modifications = new Modification[] { mod2, mod1 }; + Assert.AreEqual(20, result.LastChangeNumber); + } } } |
|
From: Mike R. <mik...@us...> - 2004-11-22 22:42:28
|
Update of /cvsroot/ccnet/ccnet/project/core/sourcecontrol/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14758/project/core/sourcecontrol/test Modified Files: SvnTest.cs Log Message: CCNET-211 - Proposed GetSource() Impl for subversion Index: SvnTest.cs =================================================================== RCS file: /cvsroot/ccnet/ccnet/project/core/sourcecontrol/test/SvnTest.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** SvnTest.cs 15 Nov 2004 05:41:07 -0000 1.7 --- SvnTest.cs 22 Nov 2004 22:42:18 -0000 1.8 *************** *** 73,77 **** [Test] ! public void ApplyLabel() { DynamicMock executor = new DynamicMock(typeof(ProcessExecutor)); --- 73,77 ---- [Test] ! public void ShouldApplyLabelIfTagOnSuccessTrue() { DynamicMock executor = new DynamicMock(typeof(ProcessExecutor)); *************** *** 82,85 **** --- 82,92 ---- svn.LabelSourceControl("foo", DateTime.Now); executor.Verify(); + } + + [Test] + public void ShouldNotApplyLabelIfTagOnSuccessFalse() + { + DynamicMock executor = new DynamicMock(typeof(ProcessExecutor)); + Svn svn = new Svn((ProcessExecutor) executor.MockInstance); svn.TagOnSuccess = false; *************** *** 101,104 **** --- 108,175 ---- } + [Test] + public void ShouldGetSourceWithAppropriateRevisionNumberIfTagOnSuccessTrueAndModificationsFound() + { + DynamicMock executor = new DynamicMock(typeof(ProcessExecutor)); + Svn svn = new Svn((ProcessExecutor) executor.MockInstance); + svn.WorkingDirectory = "myWorkingDirectory"; + IntegrationResult result = new IntegrationResult(); + Modification mod = new Modification(); + mod.ChangeNumber = 10; + result.Modifications = new Modification[] { mod }; + ProcessInfo expectedProcessRequest = new ProcessInfo("svn.exe", "update --non-interactive -r10", "myWorkingDirectory"); + + svn.AutoGetSource = true; + executor.ExpectAndReturn("Execute", new ProcessResult("foo", null, 0, false), expectedProcessRequest); + svn.GetSource(result); + executor.Verify(); + } + + // This would happen, e.g., for force build + [Test] + public void ShouldGetSourceWithoutRevisionNumberIfTagOnSuccessTrueAndModificationsNotFound() + { + DynamicMock executor = new DynamicMock(typeof(ProcessExecutor)); + Svn svn = new Svn((ProcessExecutor) executor.MockInstance); + svn.WorkingDirectory = "myWorkingDirectory"; + IntegrationResult result = new IntegrationResult(); + ProcessInfo expectedProcessRequest = new ProcessInfo("svn.exe", "update --non-interactive", "myWorkingDirectory"); + + svn.AutoGetSource = true; + executor.ExpectAndReturn("Execute", new ProcessResult("foo", null, 0, false), expectedProcessRequest); + svn.GetSource(result); + executor.Verify(); + } + + [Test] + public void ShouldGetSourceWithCredentialsIfSpecifiedIfTagOnSuccessTrue() + { + DynamicMock executor = new DynamicMock(typeof(ProcessExecutor)); + Svn svn = new Svn((ProcessExecutor) executor.MockInstance); + svn.WorkingDirectory = "myWorkingDirectory"; + svn.Username = "user"; + svn.Password = "password"; + IntegrationResult result = new IntegrationResult(); + ProcessInfo expectedProcessRequest = new ProcessInfo("svn.exe", @"update --non-interactive --username ""user"" --password ""password""", "myWorkingDirectory"); + + svn.AutoGetSource = true; + executor.ExpectAndReturn("Execute", new ProcessResult("foo", null, 0, false), expectedProcessRequest); + svn.GetSource(result); + executor.Verify(); + } + + [Test] + public void ShouldNotGetSourceIfTagOnSuccessFalse() + { + DynamicMock executor = new DynamicMock(typeof(ProcessExecutor)); + Svn svn = new Svn((ProcessExecutor) executor.MockInstance); + IntegrationResult result = new IntegrationResult(); + + svn.AutoGetSource = false; + executor.ExpectNoCall("Execute", typeof(ProcessInfo)); + svn.GetSource(result); + executor.Verify(); + } + private Svn CreateSvn(string xml) { |