Exemple #1
0
        private ServerAggregatingCruiseManagerWrapper InitialiseServerWrapper(MockRepository mocks,
                                                                              Action <CruiseServerClientBase> additionalSetup)
        {
            IRemoteServicesConfiguration configuration        = mocks.DynamicMock <IRemoteServicesConfiguration>();
            ICruiseServerClientFactory   cruiseManagerFactory = mocks.DynamicMock <ICruiseServerClientFactory>();
            CruiseServerClientBase       cruiseManager        = mocks.DynamicMock <CruiseServerClientBase>();

            ServerLocation[] servers = new ServerLocation[] { serverLocation, otherServerLocation };
            SetupResult.For(configuration.Servers)
            .Return(servers);
            SetupResult.For(cruiseManagerFactory.GenerateClient("http://myurl", new ClientStartUpSettings()))
            .IgnoreArguments()
            .Return(cruiseManager);

            ServerAggregatingCruiseManagerWrapper serverWrapper = new ServerAggregatingCruiseManagerWrapper(
                configuration,
                cruiseManagerFactory);

            if (additionalSetup != null)
            {
                additionalSetup(cruiseManager);
            }

            return(serverWrapper);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="ProjectTrigger"/> class.
 /// </summary>
 /// <param name="factory">The factory.</param>
 public ProjectTrigger(ICruiseServerClientFactory factory)
 {
     this.factory          = factory;
     this.ServerUri        = DefaultServerUri;
     this.TriggerStatus    = IntegrationStatus.Success;
     this.InnerTrigger     = ProjectTrigger.NewIntervalTrigger();
     this.TriggerFirstTime = false;
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="ProjectTrigger"/> class.
        /// </summary>
        /// <param name="factory">The factory.</param>
        public ProjectTrigger(ICruiseServerClientFactory factory)
		{
			this.factory = factory;
            this.ServerUri = DefaultServerUri;
            this.TriggerStatus = IntegrationStatus.Success;
            this.InnerTrigger = ProjectTrigger.NewIntervalTrigger();
            this.TriggerFirstTime = false;
		}
Exemple #4
0
 public void Setup()
 {
     this.mocks   = new MockRepository();
     this.logger  = this.mocks.StrictMock <ILogger>();
     this.factory = this.mocks.StrictMock <ICruiseServerClientFactory>();
     this.result  = this.mocks.StrictMock <IIntegrationResult>();
     SetupResult.For(this.result.Status).PropertyBehavior();
     this.result.Status = IntegrationStatus.Unknown;
     this.buildInfo     = this.mocks.StrictMock <BuildProgressInformation>("somewhere", "test");
     SetupResult.For(this.result.BuildProgressInformation).Return(this.buildInfo);
     this.client = this.mocks.StrictMock <CruiseServerClientBase>();
 }
Exemple #5
0
 public void Setup()
 {
     this.mocks   = new MockRepository(MockBehavior.Default);
     this.logger  = this.mocks.Create <ILogger>(MockBehavior.Strict).Object;
     this.factory = this.mocks.Create <ICruiseServerClientFactory>(MockBehavior.Strict).Object;
     this.result  = this.mocks.Create <IIntegrationResult>(MockBehavior.Strict).Object;
     Mock.Get(this.result).SetupProperty(_result => _result.Status);
     this.result.Status = IntegrationStatus.Unknown;
     this.buildInfo     = this.mocks.Create <BuildProgressInformation>(MockBehavior.Strict, "somewhere", "test").Object;
     Mock.Get(this.result).SetupGet(_result => _result.BuildProgressInformation).Returns(this.buildInfo);
     this.client = this.mocks.Create <CruiseServerClientBase>(MockBehavior.Strict).Object;
 }
 public void Setup()
 {
     this.mocks = new MockRepository();
     this.logger = this.mocks.StrictMock<ILogger>();
     this.factory = this.mocks.StrictMock<ICruiseServerClientFactory>();
     this.result = this.mocks.StrictMock<IIntegrationResult>();
     SetupResult.For(this.result.Status).PropertyBehavior();
     this.result.Status = IntegrationStatus.Unknown;
     this.buildInfo = this.mocks.StrictMock<BuildProgressInformation>("somewhere", "test");
     SetupResult.For(this.result.BuildProgressInformation).Return(this.buildInfo);
     this.client = this.mocks.StrictMock<CruiseServerClientBase>();
 }
        private ServerAggregatingCruiseManagerWrapper InitialiseServerWrapper(MockRepository mocks,
                                                                              Action <CruiseServerClientBase> additionalSetup)
        {
            IRemoteServicesConfiguration configuration        = mocks.Create <IRemoteServicesConfiguration>().Object;
            ICruiseServerClientFactory   cruiseManagerFactory = mocks.Create <ICruiseServerClientFactory>().Object;
            CruiseServerClientBase       cruiseManager        = mocks.Create <CruiseServerClientBase>().Object;

            ServerLocation[] servers = new ServerLocation[] { serverLocation, otherServerLocation };
            Mock.Get(configuration).SetupGet(_configuration => _configuration.Servers)
            .Returns(servers);
            Mock.Get(cruiseManagerFactory).Setup(_cruiseManagerFactory => _cruiseManagerFactory.GenerateClient(It.IsAny <string>(), It.IsAny <ClientStartUpSettings>()))
            .Returns(cruiseManager);

            ServerAggregatingCruiseManagerWrapper serverWrapper = new ServerAggregatingCruiseManagerWrapper(
                configuration,
                cruiseManagerFactory);

            if (additionalSetup != null)
            {
                additionalSetup(cruiseManager);
            }

            return(serverWrapper);
        }
 public ServerAggregatingCruiseManagerWrapper(IRemoteServicesConfiguration configuration, ICruiseServerClientFactory managerFactory)
 {
     this.configuration = configuration;
     this.clientFactory = managerFactory;
 }
        public ServerAggregatingCruiseManagerWrapper(IRemoteServicesConfiguration configuration, ICruiseServerClientFactory managerFactory)
		{
			this.configuration = configuration;
			this.clientFactory = managerFactory;
		}
 public CruiseProjectManagerFactory(ICruiseServerClientFactory clientFactory)
 {
     this.clientFactory = clientFactory;
 }
        public AltForceBuildPublisher(ICruiseServerClientFactory factory)
		{
			this.factory = factory;
		}
        /// <summary>
        /// Initializes a new instance of the <see cref="ForceBuildPublisher" /> class.	
        /// </summary>
        /// <param name="factory">The factory.</param>
        /// <remarks></remarks>
        public ForceBuildPublisher(ICruiseServerClientFactory factory)
		{
			this.factory = factory;
            this.ServerUri = string.Format(CultureInfo.CurrentCulture,"tcp://localhost:21234/{0}", RemoteCruiseServer.ManagerUri);
            this.IntegrationStatus = IntegrationStatus.Success;
		}
Exemple #13
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ForceBuildPublisher" /> class.
 /// </summary>
 /// <param name="factory">The factory.</param>
 /// <remarks></remarks>
 public ForceBuildPublisher(ICruiseServerClientFactory factory)
 {
     this.factory           = factory;
     this.ServerUri         = string.Format(CultureInfo.CurrentCulture, "tcp://localhost:21234/{0}", RemoteCruiseServer.ManagerUri);
     this.IntegrationStatus = IntegrationStatus.Success;
 }
 public CruiseProjectManagerFactory(ICruiseServerClientFactory clientFactory)
 {
     this.clientFactory = clientFactory;
 }