private static MainForm GetMainForm(string settingsFilename)
        {
            var remoteCruiseManagerFactory = new CruiseServerClientFactory();
            ICruiseServerManagerFactory cruiseServerManagerFactory = new CruiseServerManagerFactory(remoteCruiseManagerFactory);
            ICruiseProjectManagerFactory cruiseProjectManagerFactory = new CruiseProjectManagerFactory(remoteCruiseManagerFactory);
            CCTrayMultiConfiguration configuration = new CCTrayMultiConfiguration(cruiseServerManagerFactory, cruiseProjectManagerFactory, settingsFilename);

            return new MainForm(configuration);
        }
        public void WhenRequestingACruiseProjectManagerWithAnExtensionProtocolValidExtension()
        {
            var server = new BuildServer("http://somethingOrOther", BuildServerTransport.Extension, "ThoughtWorks.CruiseControl.UnitTests.CCTrayLib.Monitoring.ExtensionProtocolStub,ThoughtWorks.CruiseControl.UnitTests",string.Empty);
            var mockCruiseManagerFactory = mocks.StrictMock<ICruiseServerClientFactory>();
            var factory = new CruiseProjectManagerFactory(mockCruiseManagerFactory);
            var serverManagers = new Dictionary<BuildServer, ICruiseServerManager>();

            mocks.ReplayAll();
            var manager = factory.Create(new CCTrayProject(server, ProjectName), serverManagers);
            Assert.AreEqual(ProjectName, manager.ProjectName);

            mocks.VerifyAll();
        }
示例#3
0
		static void Main(string[] args) {
			string settingsFilename = GetSettingsFilename(args.ToList());

			var remoteCruiseManagerFactory = new CruiseServerClientFactory();
			ICruiseServerManagerFactory cruiseServerManagerFactory = new CruiseServerManagerFactory(remoteCruiseManagerFactory);
			ICruiseProjectManagerFactory cruiseProjectManagerFactory = new CruiseProjectManagerFactory(remoteCruiseManagerFactory);
			CCTrayMultiConfiguration configuration = new CCTrayMultiConfiguration(cruiseServerManagerFactory, cruiseProjectManagerFactory, settingsFilename);
			var sync = new NoOpSynchronizeInvoke();

			var controller = new MainFormController(configuration, sync, null);

			controller.StartServerMonitoring();

			Console.ReadKey();

			controller.StopServerMonitoring();
		}
示例#4
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.DoEvents();

            try
            {
                ICruiseManagerFactory remoteCruiseManagerFactory = new RemoteCruiseManagerFactory();
                ICruiseProjectManagerFactory cruiseProjectManagerFactory = new CruiseProjectManagerFactory( remoteCruiseManagerFactory );
                CCTrayMultiConfiguration configuration = new CCTrayMultiConfiguration( cruiseProjectManagerFactory, GetSettingsFilename() );

                MainForm mainForm = new MainForm(configuration);

                Application.Run(mainForm);
            }
            catch (Exception ex)
            {
                MessageBox.Show("Failed to start: " + ex, AppDomain.CurrentDomain.FriendlyName);
            }
        }
		public void WhenRequestingACruiseProjectManagerWithAnHttpUrlConstructsANewDashboardCruiseProjectManager()
		{
            var serverAddress = "http://somethingOrOther";
            var server = new BuildServer(serverAddress);
            var client = mocks.DynamicMock<CruiseServerClientBase>();

            var clientFactory = mocks.StrictMock<ICruiseServerClientFactory>();
            Expect.Call(clientFactory.GenerateHttpClient(serverAddress, new ClientStartUpSettings()))
                .Constraints(new Equal(serverAddress), new Anything())
                .Return(client);
            var factory = new CruiseProjectManagerFactory(clientFactory);

			var serverManagers = new Dictionary<BuildServer, ICruiseServerManager>();
			serverManagers[server] = new HttpCruiseServerManager(client, server);

            mocks.ReplayAll();
			var manager = factory.Create(new CCTrayProject(server, ProjectName), serverManagers);
			Assert.AreEqual(ProjectName, manager.ProjectName);
			Assert.AreEqual(typeof(HttpCruiseProjectManager), manager.GetType());

            mocks.VerifyAll();
		}
        public void GetProjectListWithAnExtensionProtocolValidExtension()
        {
            var server = new BuildServer("http://somethingOrOther", BuildServerTransport.Extension, "ThoughtWorks.CruiseControl.UnitTests.CCTrayLib.Monitoring.ExtensionProtocolStub,ThoughtWorks.CruiseControl.UnitTests",string.Empty);
            var mockCruiseManagerFactory = mocks.StrictMock<ICruiseServerClientFactory>();
            var factory = new CruiseProjectManagerFactory(mockCruiseManagerFactory);

            mocks.ReplayAll();
            CCTrayProject[] projectList = factory.GetProjectList(server, false);
            Assert.AreNotEqual(0, projectList.Length);

            mocks.VerifyAll();
        }