public OracleJobQueueMonitoringApi(OracleStorage storage) { if (storage == null) { throw new ArgumentNullException("storage"); } _storage = storage; }
public void Ctor_CanCreateSqlServerStorage_WithExistingConnection() { using (var connection = ConnectionUtils.CreateConnection()) { var storage = new OracleStorage(connection); Assert.NotNull(storage); } }
public OracleJobQueueMonitoringApiTests() { _connection = new OracleConnection(ConnectionUtils.GetConnectionString()); _connection.Open(); _storage = new OracleStorage(_connection); _sut = new OracleJobQueueMonitoringApi(_storage); }
public OracleMonitoringApi([NotNull] OracleStorage storage, int?jobListLimit) { if (storage == null) { throw new ArgumentNullException("storage"); } _storage = storage; _jobListLimit = jobListLimit; }
private void UseConnections(Action <OracleConnection, OracleStorageConnection> action) { using (var sqlConnection = ConnectionUtils.CreateConnection()) { var storage = new OracleStorage(sqlConnection); using (var connection = new OracleStorageConnection(storage)) { action(sqlConnection, connection); } } }
public OracleFetchedJob(OracleStorage storage, IDbConnection connection, FetchedJob fetchedJob) { if (fetchedJob == null) { throw new ArgumentNullException(nameof(fetchedJob)); } _storage = storage ?? throw new ArgumentNullException(nameof(storage)); _connection = connection ?? throw new ArgumentNullException(nameof(connection)); _id = fetchedJob.Id; JobId = fetchedJob.JobId.ToString(CultureInfo.InvariantCulture); Queue = fetchedJob.Queue; }
public OracleJobQueueProvider(OracleStorage storage, OracleStorageOptions options) { if (storage == null) { throw new ArgumentNullException("storage"); } if (options == null) { throw new ArgumentNullException("options"); } _jobQueue = new OracleJobQueue(storage, options); _monitoringApi = new OracleJobQueueMonitoringApi(storage); }
public OracleJobQueue(OracleStorage storage, OracleStorageOptions options) { if (storage == null) { throw new ArgumentNullException("storage"); } if (options == null) { throw new ArgumentNullException("options"); } _storage = storage; _options = options; }
public override async Task Init() { var services = new ServiceCollection(); services.AddOptions(); services.AddLogging(); services.Configure <OracleStorageOptions>(o => { o.ConnectionString = "Password=Mm2717965346;User ID=sa;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=ORCL)));"; }); services.AddTransient <OracleStorage>(); services.AddSingleton <OracleConnectionFactory>(); _storage = services.BuildServiceProvider().GetRequiredService <OracleStorage>(); await _storage.InitAsync(); }
public OracleMonitoringApiTests() { _connection = new OracleConnection(ConnectionUtils.GetConnectionString()); _connection.Open(); var persistentJobQueueMonitoringApiMock = new Mock <IPersistentJobQueueMonitoringApi>(); persistentJobQueueMonitoringApiMock.Setup(m => m.GetQueues()).Returns(new[] { "default" }); var defaultProviderMock = new Mock <IPersistentJobQueueProvider>(); defaultProviderMock.Setup(m => m.GetJobQueueMonitoringApi()) .Returns(persistentJobQueueMonitoringApiMock.Object); var OracleStorageMock = new Mock <OracleStorage>(_connection); OracleStorageMock .Setup(m => m.QueueProviders) .Returns(new PersistentJobQueueProviderCollection(defaultProviderMock.Object)); _storage = OracleStorageMock.Object; _sut = new OracleMonitoringApi(_storage, _jobListLimit); }
public CountersAggregatorTests() { _connection = ConnectionUtils.CreateConnection(); _storage = new OracleStorage(_connection); _sut = new CountersAggregator(_storage, TimeSpan.Zero); }
public OracleJobQueueMonitoringApi(OracleStorage storage) { _storage = storage ?? throw new ArgumentNullException(nameof(storage)); }
private static OracleJobQueue CreateJobQueue(OracleConnection connection) { var storage = new OracleStorage(connection); return(new OracleJobQueue(storage, new OracleStorageOptions())); }
public OracleMonitoringApi([NotNull] OracleStorage storage, int?jobListLimit) { _storage = storage ?? throw new ArgumentNullException(nameof(storage)); _jobListLimit = jobListLimit; }
private ExpirationManager CreateManager(OracleConnection connection) { var storage = new OracleStorage(connection); return(new ExpirationManager(storage, TimeSpan.Zero)); }
public OracleJobQueue(OracleStorage storage, OracleStorageOptions options) { _storage = storage ?? throw new ArgumentNullException(nameof(storage)); _options = options ?? throw new ArgumentNullException(nameof(options)); }
public OracleJobQueueTests() { _connection = ConnectionUtils.CreateConnection(); _storage = new OracleStorage(_connection); }