Пример #1
0
        private ContainerBuilder InitializeContainerBuilder(YamsConfig yamsConfig)
        {
            IUpdateSessionManager updateSessionManager = new StubIUpdateSessionManager()
                                                         .TryStartUpdateSession(applicationId => Task.FromResult(true))
                                                         .EndUpdateSession(applicationId => Task.FromResult(true));

            IDeploymentRepository deploymentRepository = new LocalDeploymentRepository(_deploymentDirPath,
                                                                                       new JsonDeploymentConfigSerializer(new JsonSerializer(new DiagnosticsTraceWriter())));

            return(YamsDiModule.RegisterTypes(yamsConfig, deploymentRepository, updateSessionManager));
        }
Пример #2
0
        private void InitializeYamsService(YamsConfig yamsConfig)
        {
            IUpdateSessionManager updateSessionManager = new StubIUpdateSessionManager()
                                                         .TryStartUpdateSession(applicationId => Task.FromResult(true))
                                                         .EndUpdateSession(applicationId => Task.FromResult(true));

            _yamsDiModule = new YamsDiModule(yamsConfig, new LocalDeploymentRepository(
                                                 _deploymentDirPath, new JsonDeploymentConfigSerializer(
                                                     new JsonSerializer(new DiagnosticsTraceWriter()))), updateSessionManager);
            _yamsService = _yamsDiModule.YamsService;
        }
Пример #3
0
        private void InitializeYamsService(YamsConfig yamsConfig)
        {
            IUpdateSessionManager updateSessionManager = new StubIUpdateSessionManager()
                .TryStartUpdateSession(applicationId => Task.FromResult(true))
                .EndUpdateSession(applicationId => Task.FromResult(true));

            _yamsDiModule = new YamsDiModule(yamsConfig, new LocalDeploymentRepository(
                _deploymentDirPath, new JsonDeploymentConfigSerializer(
                    new JsonSerializer(new DiagnosticsTraceWriter()))), updateSessionManager);
            _yamsService = _yamsDiModule.YamsService;
        }
Пример #4
0
        public EndToEndTest()
        {
            _dataRootPath            = Path.Combine(Directory.GetCurrentDirectory(), "Data", "EndToEndTest");
            _testDirPath             = Path.Combine(Directory.GetCurrentDirectory(), "EndToEndTest");
            _deploymentDirPath       = Path.Combine(_testDirPath, "Deployments");
            _applicationsInstallPath = Path.Combine(_testDirPath, "applications");

            FileUtils.CopyDir(_dataRootPath, _deploymentDirPath, overwrite: true).Wait();

            CopyTestProcessExeToTestApps();

            var yamsConfig = new YamsConfigBuilder("deploymentId1", "1", "instanceId",
                                                   _applicationsInstallPath).SetShowApplicationProcessWindow(false).Build();

            IUpdateSessionManager updateSessionManager = new StubIUpdateSessionManager()
                                                         .TryStartUpdateSession(applicationId => Task.FromResult(true))
                                                         .EndUpdateSession(applicationId => Task.FromResult(true));

            _yamsDiModule = new YamsDiModule(yamsConfig, new LocalDeploymentRepository(_deploymentDirPath), updateSessionManager);
            _yamsService  = _yamsDiModule.YamsService;
        }
Пример #5
0
 private void InitializeYamsService(IContainer container)
 {
     _yamsDiModule = new YamsDiModule(container);
     _yamsService  = _yamsDiModule.YamsService;
 }