private void LaunchServer() { using (ConsoleEventHandler handler = new ConsoleEventHandler()) { handler.OnConsoleEvent += new EventHandler(HandleControlEvent); using (server = serverFactory.Create(args.UseRemoting, args.ConfigFile)) { if (args.Project == null) { server.Start(); server.WaitForExit(); } else { // Force the build ValidateResponse( server.ForceBuild( new ProjectRequest(SecurityOverride.SessionIdentifier, args.Project))); // Tell the server to stop as soon as the build has finished and then wait for it ValidateResponse( server.Stop( new ProjectRequest(SecurityOverride.SessionIdentifier, args.Project))); server.WaitForExit( new ProjectRequest(SecurityOverride.SessionIdentifier, args.Project)); } } } }
public void ProcessMessageCorrectlyHandlesAValidMessage() { // Setup the messages ProjectRequest request = new ProjectRequest("123-45", "A test project"); Response response = new Response(request); response.Result = ResponseResult.Success; // Initialises the mocks ICruiseServer server = mocks.DynamicMock<ICruiseServer>(); Expect.Call(server.ForceBuild(request)).Return(response); mocks.ReplayAll(); // Run the actual test var manager = new ThoughtWorks.CruiseControl.Core.CruiseServerClient(server); string responseText = manager.ProcessMessage("ForceBuild", request.ToString()); Assert.AreEqual(response.ToString(), responseText); mocks.VerifyAll(); }
private void LaunchServer() { using (ConsoleEventHandler handler = new ConsoleEventHandler()) { handler.OnConsoleEvent += new EventHandler(HandleControlEvent); using (server = _serverFactory.Create(_parser.UseRemoting, _parser.ConfigFile)) { if (_parser.Project == null) { server.Start(); server.WaitForExit(); } else { server.ForceBuild(_parser.Project, null); server.WaitForExit(_parser.Project); } } } }
public bool ForceBuild(string project, ForceFilterClientInfo[] clientInfo) { return(cruiseServer.ForceBuild(project, clientInfo)); }
public bool ForceBuild(string projectName, ForceFilterClientInfo[] clientInfo) { return(_server.ForceBuild(projectName, clientInfo)); }
public bool ForceBuild(string projectName, Dictionary <string, string> webParams, ForceFilterClientInfo[] clientInfo) { return(_server.ForceBuild(projectName, webParams, clientInfo)); }
/// <summary> /// Forces a build for the named project. /// </summary> /// <param name="request">A <see cref="ProjectRequest"/> containing the request details.</param> /// <returns>A <see cref="Response"/> containing the results of the request.</returns> public virtual Response ForceBuild(ProjectRequest request) { return(server.ForceBuild(request)); }
private void LaunchServer() { using (ConsoleEventHandler handler = new ConsoleEventHandler()) { handler.OnConsoleEvent += new EventHandler(HandleControlEvent); using (server = serverFactory.Create(args.UseRemoting, args.ConfigFile)) { if (args.Project == null) { server.Start(); server.WaitForExit(); } else { // Force the build ValidateResponse( server.ForceBuild( new ProjectRequest(null, args.Project))); // Tell the server to stop as soon as the build has finished and then wait for it ValidateResponse( server.Stop( new ProjectRequest(null, args.Project))); server.WaitForExit( new ProjectRequest(null, args.Project)); } } } }
/// <summary> /// Forces a build for the named project. /// </summary> /// <param name="projectName">project to force</param> /// <param name="enforcerName">ID of trigger/action forcing the build</param> public void ForceBuild(string projectName, string enforcerName) { Response resp = cruiseServer.ForceBuild(GenerateProjectRequest(projectName)); ValidateResponse(resp); }