コード例 #1
0
        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));
                    }
                }
            }
        }
コード例 #2
0
        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();
        }
コード例 #3
0
ファイル: ConsoleRunner.cs プロジェクト: vardars/ci-factory
        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);
                    }
                }
            }
        }
コード例 #4
0
        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);
                    }
                }
            }
        }
コード例 #5
0
 public bool ForceBuild(string project, ForceFilterClientInfo[] clientInfo)
 {
     return(cruiseServer.ForceBuild(project, clientInfo));
 }
コード例 #6
0
 public bool ForceBuild(string projectName, ForceFilterClientInfo[] clientInfo)
 {
     return(_server.ForceBuild(projectName, clientInfo));
 }
コード例 #7
0
 public bool ForceBuild(string projectName, Dictionary <string, string> webParams, ForceFilterClientInfo[] clientInfo)
 {
     return(_server.ForceBuild(projectName, webParams, clientInfo));
 }
コード例 #8
0
 /// <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));
 }
コード例 #9
0
        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));
                    }
                }
            }
        }
コード例 #10
0
        /// <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);
        }