Beispiel #1
0
 public TestAppLauncher(ITestBroker broker, Dictionary <string, TestClientFactory> clientFactories)
 {
     _broker          = broker;
     _clientFactories = clientFactories;
     _client          = new TestAppLauncherClient(this, s => s.WithBrokerWorkingDir(broker.WorkingDir));
     OnStop(_client.Disconnect);
 }
Beispiel #2
0
 private void EnsureSharedBrokerRunning()
 {
     if (SharedInstance == null || SharedInstance.Completion.IsCompleted)
     {
         Log.Info("Starting shared test broker");
         SharedInstance = new TestBroker("shared");
         SharedInstance.StartAsync().ShouldCompleteIn(TimeoutConstants.Timeout10Sec);
     }
 }
 public TestAppLauncher(ITestBroker broker, Dictionary <string, TestClientFactory> clientFactories, bool connectClients = true)
 {
     _broker          = broker;
     _clientFactories = clientFactories;
     _connectClients  = connectClients;
     _client          = new TestAppLauncherClient(this, s => s
                                                  .WithBrokerWorkingDir(broker.WorkingDir)
                                                  .WithAppInstanceId(LauncherAppInstanceId));
     OnStop(_client.Disconnect);
 }
        private IClient ConnectClient(string appId, ITestBroker testBroker = null)
        {
            testBroker = testBroker ?? _testBrokerFixture.SharedInstance;
            var clientOptions = new ClientOptionsBuilder()
                                .WithBrokerWorkingDir(testBroker.WorkingDir)
                                .WithDefaultConfiguration()
                                .WithApplicationId(appId)
                                .Build();
            var client = RegisterDisposable(ClientFactory.Instance.Create(clientOptions));

            client.ConnectAsync().ShouldCompleteIn(Timeout10Sec);
            return(client);
        }
        private IClient ConnectEchoServer(Action <ClientOptionsBuilder> setup = null, ITestBroker testBroker = null)
        {
            testBroker = testBroker ?? _testBrokerFixture.SharedInstance;
            var clientOptionsBuilder = new ClientOptionsBuilder()
                                       .WithBrokerWorkingDir(testBroker.WorkingDir)
                                       .WithDefaultConfiguration()
                                       .WithApplicationId("plexus.interop.testing.EchoServer");

            setup?.Invoke(clientOptionsBuilder);
            var clientOptions = clientOptionsBuilder.Build();
            var client        = RegisterDisposable(ClientFactory.Instance.Create(clientOptions));

            client.ConnectAsync().ShouldCompleteIn(Timeout10Sec);
            return(client);
        }
Beispiel #6
0
 public Task <IClient> CreateClientAsync(ITestBroker targetBroker, UniqueId appInstanceId)
 {
     return(_createClientDelegate(targetBroker, appInstanceId));
 }