Example #1
0
        public PostgreSqlEventStoreFactory()
        {
            //Brett
            var configuration = Configuration.Get();

            //var helper = new PostgreSqlTestHelper(configuration); //PostgreSqlTestHelper
            //helper.EnsureTestDatabaseExists();
            ////var connectionString = helper.ConnectionString;
            //helper.DropTable("events");
            //_eventStore = new PostgreSqlEventStore(configuration, MsSqlTestHelper.TestDbName, "events");
            //_eventStore.DropEvents();

            //var helper = new PostgreSqlTestHelper(configuration);
            PostgreSqlTestHelper.DropTable("Events");

            //PostgreSqlTestHelper.DropTable("Events");
            //var connectionString = configuration[ PostgreSqlTestHelper.PostgreSqlConnectionString];
            _eventStore = new PostgreSqlEventStore(configuration, PostgreSqlTestHelper.TestDbName, "events");
            _eventStore.DropEvents();



            //orig
            //PostgreSqlTestHelper.DropTable("Events");
            //var connectionString = PostgreSqlTestHelper.PostgreSqlConnectionString;
            //_eventStore = new PostgreSqlEventStore(connectionString, "Events");
            //_eventStore.DropEvents();
        }
Example #2
0
        protected override IViewManager <TViewInstance> CreateViewManager <TViewInstance>()
        {
            var tableName = typeof(TViewInstance).Name;

            PostgreSqlTestHelper.DropTable(tableName);

            return(new PostgreSqlViewManager <TViewInstance>(_connectionString, tableName));
        }
        public PostgreSqlEventStoreFactory()
        {
            PostgreSqlTestHelper.DropTable("Events");

            var connectionString = PostgreSqlTestHelper.PostgreSqlConnectionString;

            _eventStore = new PostgreSqlEventStore(connectionString, "Events");

            _eventStore.DropEvents();
        }
        protected override IViewManager <TViewInstance> CreateViewManager <TViewInstance>(bool enableBatchDispatch = false)
        {
            var tableName = typeof(TViewInstance).Name;

            PostgreSqlTestHelper.DropTable(tableName);

            return(new PostgreSqlViewManager <TViewInstance>(_connectionString, tableName)
            {
                BatchDispatchEnabled = enableBatchDispatch
            });
        }
        public void CleanUp()
        {
            _disposables.ForEach(d => d.Dispose());
            _disposables.Clear();

            foreach (var tableName in _tablesToDrop)
            {
                PostgreSqlTestHelper.DropTable(tableName);
            }

            _tablesToDrop.Clear();
        }
        protected override void SetUp()
        {
            PostgreSqlTestHelper.DropTable(_tableName);
            var consoleLoggerFactory = new ConsoleLoggerFactory(false);
            var asyncTaskFactory     = new TplAsyncTaskFactory(consoleLoggerFactory);
            var connectionHelper     = new PostgresConnectionHelper(PostgreSqlTestHelper.ConnectionString);

            _transport = new PostgreSqlTransport(connectionHelper, _tableName, QueueName, consoleLoggerFactory, asyncTaskFactory, new DefaultRebusTime());
            _transport.EnsureTableIsCreated();

            Using(_transport);

            _transport.Initialize();
            _cancellationToken = new CancellationTokenSource().Token;
        }
        protected override void SetUp()
        {
            PostgreSqlTestHelper.DropTable(TableName);

            _adapter = Using(new BuiltinHandlerActivator());

            Configure.With(_adapter)
            .Logging(l => l.ColoredConsole(LogLevel.Warn))
            .Transport(t => t.UsePostgreSql(PostgreSqlTestHelper.ConnectionString, TableName, QueueName))
            .Options(o =>
            {
                o.SetNumberOfWorkers(0);
                o.SetMaxParallelism(20);
            })
            .Start();
        }
Example #8
0
        IEventStore GetEventStore(EventStoreOption eventStoreOption)
        {
            switch (eventStoreOption)
            {
            case EventStoreOption.InMemory:
                return(new InMemoryEventStore());

            case EventStoreOption.MongoDb:
                return(new MongoDbEventStore(GetMongoDb(), "Events"));

            case EventStoreOption.SqlServer:
                MsSqlTestHelper.EnsureTestDatabaseExists();
                MsSqlTestHelper.DropTable("Events");
                return(new MsSqlEventStore(Configuration.Get(), MsSqlTestHelper.ConnectionString, "Events"));

            case EventStoreOption.Postgres:
                PostgreSqlTestHelper.DropTable("Events");
                return(new PostgreSqlEventStore(Configuration.Get(), PostgreSqlTestHelper.PostgreSqlConnectionString, "Events"));

            default:
                throw new ArgumentOutOfRangeException("eventStoreOption", "Unknown event store option");
            }
        }
 public void Cleanup()
 {
     PostgreSqlTestHelper.DropTable("timeouts");
 }
 public PostgreSqlTimeoutManagerFactory()
 {
     PostgreSqlTestHelper.DropTable("timeouts");
 }
 public PostgreSqlSnapshotStorageFactory()
 {
     PostgreSqlTestHelper.DropTable(TableName);
 }
 protected override void SetUp() => PostgreSqlTestHelper.DropTable(TableName);
Example #13
0
 public PostgreSqlSagaStorageFactory()
 {
     PostgreSqlTestHelper.DropTable("saga_index");
     PostgreSqlTestHelper.DropTable("saga_data");
 }
Example #14
0
 public void Cleanup()
 {
     PostgreSqlTestHelper.DropTable("subscriptions");
 }