public EventStoreTestServerCluster( string hostCertificatePath, Uri address, IDictionary <string, string>?envOverrides) { envOverrides ??= new Dictionary <string, string>(); envOverrides["ES_CERTS_CLUSTER"] = hostCertificatePath; _eventStoreCluster = BuildCluster(envOverrides); _httpClient = new HttpClient( #if NETFRAMEWORK new HttpClientHandler { ServerCertificateCustomValidationCallback = delegate { return(true); } } #else new SocketsHttpHandler { SslOptions = { RemoteCertificateValidationCallback = delegate { return(true); } } } #endif ) { BaseAddress = address, }; }
public void KeepRunningsShallWorkForCompositeServices() { var file = Path.Combine(Directory.GetCurrentDirectory(), (TemplateString)"Resources/ComposeTests/WordPress/docker-compose.yml"); ICompositeService svc = null; IContainerService c1 = null; IContainerService c2 = null; try { svc = Fd .UseContainer() .UseCompose() .FromFile(file) .RemoveOrphans() .KeepRunning() .Build().Start(); c1 = svc.Containers.First(); c2 = svc.Containers.Skip(1).First(); svc.Dispose(); Assert.AreEqual(ServiceRunningState.Running, c1.State); Assert.AreEqual(ServiceRunningState.Running, c2.State); } finally { svc?.Dispose(); c1?.Remove(true); c2?.Remove(true); } }
public void Execute(params string[] arguments) { Repository.Clone(_source, Target); var file = Path.Combine(Target, "docker-compose.yml"); // TODO: later on when swarm is supported in Fd - "docker-stack.yml" can also be selected... var files = new List <string>() { file }; if (null != _curator) { files.Add(_curator); } if (null != _logspout) { files.Add(_logspout); } if (null != _apmServer) { files.Add(_apmServer); } _svc = new DockerComposeCompositeService(_host, new DockerComposeConfig { ComposeFilePath = files, ForceRecreate = false, RemoveOrphans = false, StopOnDispose = true }); _svc.Start(); Services = new IService[] { _host, _svc }; }
/// <summary> /// Initializes a new instance of the GenerateCompositeViewModel class. /// </summary> public GenerateCompositeViewModel(IDataService Service, ICompositeService CService) { _service = Service; _cservice = CService; InitializeModels(); RegisterCommands(); }
public static void StartTestRun() { if (!IsRunningInDocker) { return; } var dockerComposeFileName = Configuration.GetValue <string>("DockerComposeFileName"); var dockerComposeOverrideFileName = DetermineOverrideFileName(Configuration); var dockerComposePath = GetDockerComposeFileLocation(dockerComposeFileName); var dockerComposeOverridePath = GetDockerComposeFileLocation(dockerComposeOverrideFileName); var applicationUrl = Configuration.GetValue <string>("FakeSurveyGeneratorUI:BaseAddress"); _compositeService = new Builder() .UseContainer() .UseCompose() .FromFile(dockerComposePath) .FromFile(dockerComposeOverridePath) .RemoveOrphans() .WaitForHttp("fake-survey-generator-api", $"{applicationUrl}/health/ready", continuation: (response, _) => response.Code != HttpStatusCode.OK ? 2000 : 0) .WaitForHttp("fake-survey-generator-ui", $"{applicationUrl}", continuation: (response, _) => response.Code != HttpStatusCode.OK ? 2000 : 0) .Build() .Start(); }
public InjectCompositeComponents( IRulesBasedSnippetRepository rulesBasedSnippetRepository, ICompositeService compositeService, IPageMode pageMode) { this.rulesBasedSnippetRepository = rulesBasedSnippetRepository; this.compositeService = compositeService; this.pageMode = pageMode; }
public DockerHook() { _compositeService = new Builder() .UseContainer() .UseCompose() .FromFile("./docker-compose.yml") .RemoveOrphans() .Build() .Start(); }
public Setup() { Environment.CurrentDirectory = @"../../../"; _svc = new Builder() .UseContainer() .UseCompose() .FromFile(@"docker-compose.yml") .RemoveOrphans() .WaitForHttp("conductor1", @"http://*****:*****@"http://localhost:5102/api/info") .Build().Start(); }
public void Initialize() { Service = Build().Build(); try { Service.Start(); } catch { Service.Dispose(); throw; } OnServiceInitialized(); }
public void TeardownContainer() { OnServiceTearDown(); var c = Service; Service = null; try { c?.Dispose(); } catch { // Ignore } }
public void SingletonInjectInterfaceImplementation() { ServiceCollection svcCollection = new(); svcCollection.AddSingleton <IService, Service>(); svcCollection.AddSingleton <ICompositeService, CompositeService>(); ServiceProvider svcProvider = svcCollection.BuildServiceProvider(); ICompositeService compositeService = svcProvider.GetService <ICompositeService>(); Assert.NotNull(compositeService); Assert.Equal(typeof(CompositeService), compositeService.GetType()); Assert.Equal(compositeService, svcProvider.GetService <ICompositeService>()); IService service = svcProvider.GetService <IService>(); Assert.Equal(service, compositeService.Service); }
public CouchbaseFixture() { string resourcePath = $"{GetType().Assembly.GetName().Name}/{GetType().Assembly.GetName().Name}.couchbaseintegration/configure-node.txt"; _image = new Builder().DefineImage("osoykan/couchbase") .From("couchbase:latest") .Maintainer("*****@*****.**") .ExposePorts(8091, 8092, 8093, 8094, 11210) .Add($"emb:{resourcePath}", "/opt/couchbase/configure-node.sh") .Command("/opt/couchbase/configure-node.sh").Builder() .Build().Start(); _runningImage = new Builder().UseContainer() .UseImage("osoykan/couchbase") .ExposePort(8091, 8091) .ExposePort(8092, 8092) .ExposePort(8093, 8093) .ExposePort(8094, 8094) .ExposePort(11210, 11210) .Build().Start(); _runningImage.WaitForRunning(); }
public static void DockerComposeUp() { var config = LoadConfig(); var dockerComposeFileName = config["DockerComposeFileName"]; var dockerComposePath = GetDockerComposeLocation(dockerComposeFileName); var confirmationUrl = config["DentalSystem.Presentation.Web.Api:BaseAddress"]; _compositeService = new Builder() .UseContainer() .UseCompose() .FromFile(dockerComposePath) .RemoveOrphans() .WaitForHttp( "dentalsystemwebapi", "https://localhost:5555/index.html", //$"{confirmationUrl}", continuation: (response, _) => response.Code != System.Net.HttpStatusCode.OK ? 5000 : 0 ) .Build() .Start(); Thread.Sleep(5000); }
protected CompositePresenter() { composite = Builder.CreateCompositeServiceForPreseter(this); }
public OrderController(IOrderService orderService, IBookingService bookingService, ICompositeService compositeService) { _orderService = orderService; bookingService.MakeBooking(); string res = compositeService.GetCompositeData(); }
public EventStoreClientAPIClusterFixture() { _eventStoreCluster = BuildCluster(); Connection = CreateConnectionWithConnectionString(useSsl: true); }