public Task Configure(string endpointName, EndpointConfiguration configuration, RunSettings settings)
 {
     queueBindings = configuration.GetSettings().Get<QueueBindings>();
     var connectionString = settings.Get<string>("Transport.ConnectionString");
     configuration.UseTransport<MsmqTransport>().ConnectionString(connectionString);
     return Task.FromResult(0);
 }
    public override Task Configure(string endpointName, EndpointConfiguration configuration, RunSettings settings)
    {
        var persistence = configuration.UsePersistence<SqlPersistence>();
        persistence.ConnectionBuilder(() => new SqlConnection(ConnectionString));
        persistence.TablePrefix("AcceptanceTests");

        return Task.FromResult(0);
    }
Пример #3
0
        public async Task Initialize(RunDescriptor run, EndpointBehavior endpointBehavior,
            IDictionary<Type, string> routingTable, string endpointName)
        {
            try
            {
                behavior = endpointBehavior;
                scenarioContext = run.ScenarioContext;
                runSettings = run.Settings;
                var endpointConfigurationFactory = (IEndpointConfigurationFactory)Activator.CreateInstance(endpointBehavior.EndpointBuilderType);
                endpointConfigurationFactory.ScenarioContext = run.ScenarioContext;
                configuration = endpointConfigurationFactory.Get();
                configuration.EndpointName = endpointName;

                if (!string.IsNullOrEmpty(configuration.CustomMachineName))
                {
                    RuntimeEnvironment.MachineNameAction = () => configuration.CustomMachineName;
                }

                //apply custom config settings
                if (configuration.GetConfiguration == null)
                {
                    throw new Exception($"Missing EndpointSetup<T> in the constructor of {endpointName} endpoint.");
                }
                endpointConfiguration = await configuration.GetConfiguration(run, routingTable).ConfigureAwait(false);
                RegisterInheritanceHierarchyOfContextInSettings(scenarioContext);

                endpointBehavior.CustomConfig.ForEach(customAction => customAction(endpointConfiguration, scenarioContext));

                if (configuration.SendOnly)
                {
                    endpointConfiguration.SendOnly();
                }

                startable = await Endpoint.Create(endpointConfiguration).ConfigureAwait(false);

                if (!configuration.SendOnly)
                {
                    var transportInfrastructure = endpointConfiguration.GetSettings().Get<TransportInfrastructure>();
                    scenarioContext.HasNativePubSubSupport = transportInfrastructure.OutboundRoutingPolicy.Publishes == OutboundRoutingType.Multicast;
                }
            }
            catch (Exception ex)
            {
                Logger.Error("Failed to initialize endpoint " + endpointName, ex);
                throw;
            }
        }
Пример #4
0
    public Task Configure(string endpointName, EndpointConfiguration configuration, RunSettings settings)
    {
        var documentStore = GetDocumentStore();

        databaseName = documentStore.DefaultDatabase;

        configuration.GetSettings().Set(DefaultDocumentStoreKey, documentStore);

        var persistenceExtensions = configuration.UsePersistence<RavenDBPersistence>()
            .DoNotSetupDatabasePermissions()
            .SetDefaultDocumentStore(documentStore);

        configuration.GetSettings().Set(DefaultPersistenceExtensionsKey, persistenceExtensions);

        Console.WriteLine("Created '{0}' database", documentStore.DefaultDatabase);

        return Task.FromResult(0);
    }
    public Task Configure(string endpointName, EndpointConfiguration configuration, RunSettings settings, PublisherMetadata publisherMetadata)
    {
        queueBindings = configuration.GetSettings().Get<QueueBindings>();
        var connectionString = settings.Get<string>("Transport.ConnectionString");
        var transportConfig = configuration.UseTransport<MsmqTransport>();

        transportConfig.ConnectionString(connectionString);

        var routingConfig = transportConfig.Routing();

        foreach (var publisher in publisherMetadata.Publishers)
        {
            foreach (var eventType in publisher.Events)
            {
                routingConfig.RegisterPublisher(eventType, publisher.PublisherName);
            }
        }

        return Task.FromResult(0);
    }
 public abstract Task Configure(string endpointName, EndpointConfiguration configuration, RunSettings settings);
 public Task Configure(string endpointName, EndpointConfiguration configuration, RunSettings settings)
 {
     configuration.UsePersistence<InMemoryPersistence>();
     return Task.FromResult(0);
 }
Пример #8
0
 public RunDescriptor(ScenarioContext context)
 {
     Settings        = new RunSettings();
     ScenarioContext = context;
 }