public MessageProducer(IOptions <ConfigRabbitMQ> config, IConnectionHelper connectionFactory, ISerializationManager serialization) { _config = config.Value; _connection = connectionFactory.CreateConnection(_config); _model = _connection.CreateModel(); _serialization = serialization; }
public void Connect(IConnectionHelper connectionHelper, string userAgent, int connectionTimeout, int readTimeout, PURLConnection purlConnection) { if (purlConnection.PURL.IsFile) { FileAttributes attributes = ((FileInfo)purlConnection.File).Attributes; if (attributes.HasFlag(FileAttributes.Directory)) { connectionHelper.HandleFileDirectory(purlConnection.File); } else { string suffix = purlConnection.PURL.Suffix; if (suffix != null) { if (connectionHelper.ParseFilesWithSuffix(suffix)) { try { purlConnection.FileConnect(); } catch (FileNotFoundException e) { Debug.WriteLine("ERROR: Can't open because FileNotFoundException"); } } } } } else { purlConnection.NetworkConnectAndCatch(connectionHelper, userAgent, connectionTimeout, readTimeout); } }
public void Connect(IConnectionHelper connectionHelper, string userAgent, int connectionTimeout, int readTimeout, PURLConnection purlConnection) { if (purlConnection.PURL.IsFile) { FileAttributes attributes = ((FileInfo) purlConnection.File).Attributes; if (attributes.HasFlag(FileAttributes.Directory)) { connectionHelper.HandleFileDirectory(purlConnection.File); } else { string suffix = purlConnection.PURL.Suffix; if (suffix != null) { if (connectionHelper.ParseFilesWithSuffix(suffix)) { try { purlConnection.FileConnect(); } catch (FileNotFoundException e) { Debug.WriteLine("ERROR: Can't open because FileNotFoundException"); } } } } } else { purlConnection.NetworkConnectAndCatch(connectionHelper, userAgent, connectionTimeout, readTimeout); } }
public Newhouse591Repository(HttpClient httpClient, IWebsiteUrlHelper websiteUrlHelper, IConnectionHelper connectionHelper) : base(httpClient, websiteUrlHelper) { this._connectionHelper = connectionHelper; }
public SchemaUpdate(Configuration cfg, Settings settings) { configuration = cfg; dialect = settings.Dialect; connectionHelper = new SuppliedConnectionProviderConnectionHelper(settings.ConnectionProvider); exceptions = new List <Exception>(); formatter = (settings.SqlStatementLogger.FormatSql ? FormatStyle.Ddl : FormatStyle.None).Formatter; }
public SchemaUpdate(Configuration cfg, Settings settings) { configuration = cfg; dialect = settings.Dialect; connectionHelper = new SuppliedConnectionProviderConnectionHelper(settings.ConnectionProvider); exceptions = new List<Exception>(); formatter = (settings.SqlStatementLogger.FormatSql ? FormatStyle.Ddl : FormatStyle.None).Formatter; }
public void MyTestInitialize() { _projectName = "Test"; _credentials = new V1UserCredentials("Test", "Test"); _mockServiceConnection = MockRepository.Mock <IServices>(); _mockConnectionHelper = MockRepository.Mock <IConnectionHelper>(); _mockAssetType = MockRepository.Mock <IAssetType>(); }
public SchemaChangeValidator(Configuration cfg, IDictionary<string, string> connectionProperties) { this._configuration = cfg; this._dialect = Dialect.GetDialect(connectionProperties); var cfgProperties = new Dictionary<string, string>(this._dialect.DefaultProperties); foreach (var keyValuePair in connectionProperties) cfgProperties[keyValuePair.Key] = keyValuePair.Value; this._connectionHelper = new ManagedProviderConnectionHelper(cfgProperties); }
public void GetADOWorkItemTrackingHttpClientNullUriThrowsExceptionTest() { // Arrange ConfigHelper.ADOUrl = null; _connectionHelper = new ConnectionHelper(); // Act & Assert var response = _connectionHelper.GetADOWorkItemTrackingHttpClient(); }
public SchemaUpdate(Configuration cfg, Settings settings) { configuration = cfg; dialect = settings.Dialect; connectionHelper = new SuppliedConnectionProviderConnectionHelper( settings.ConnectionProvider ); exceptions = new ArrayList(); }
public void GetADOProjectClientEmptyUriThrowsExceptionTest() { // Arrange ConfigHelper.ADOUrl = string.Empty; _connectionHelper = new ConnectionHelper(); // Act & Assert var response = _connectionHelper.GetADOProjectClient(); }
public Mp3ViewModel(IConnectionHelper connectionHelper, ICursorControl cursor, IConverter converter, IFileHelper fileHelper) { this._connectionHelper = connectionHelper; this._cursor = cursor; this._converter = converter; this._fileHelper = fileHelper; Initialize(); }
public NavigationViewModel(IConnectionHelper connectionHelper, ICursorControl cursor, IConverter converter, IFileHelper fileHelper) { this._connectionHelper = connectionHelper; this._cursor = cursor; this._converter = converter; this._fileHelper = fileHelper; SelectedViewModel = Mp3ViewModelInstance; Mp3BackgroundColor = (SolidColorBrush)Application.Current.Resources["DockPanel.Background.Selected"]; }
public SchemaValidator(Configuration cfg, IDictionary<string, string> connectionProperties) { configuration = cfg; dialect = Dialect.Dialect.GetDialect(connectionProperties); IDictionary<string, string> props = new Dictionary<string, string>(dialect.DefaultProperties); foreach (var prop in connectionProperties) { props[prop.Key] = prop.Value; } connectionHelper = new ManagedProviderConnectionHelper(props); }
public MyPlexConnection(IConnectionHelper connectionHelper) { _connectionHelper = connectionHelper; _devices = new ObservableCollectionEx <Device>(); _servers = new ObservableCollectionEx <Device>(); _players = new ObservableCollectionEx <Device>(); Devices = new ReadOnlyObservableCollection <Device>(_devices); Servers = new ReadOnlyObservableCollection <Device>(_servers); Players = new ReadOnlyObservableCollection <Device>(_players); }
public MessageConsumer( IOptions <ConfigRabbitMQ> config, IConnectionHelper connectionFactory, ISerializationManager serialization, ILogger <MessageConsumer> logger ) { _config = config.Value; _connection = connectionFactory.CreateConnection(_config); _serialization = serialization; _logger = logger; }
public SchemaValidator(Configuration cfg, IDictionary <string, string> connectionProperties) { configuration = cfg; dialect = Dialect.Dialect.GetDialect(connectionProperties); IDictionary <string, string> props = new Dictionary <string, string>(dialect.DefaultProperties); foreach (var prop in connectionProperties) { props[prop.Key] = prop.Value; } connectionHelper = new ManagedProviderConnectionHelper(props); }
public SchemaUpdate(Configuration cfg, IDictionary<string, string> connectionProperties) { configuration = cfg; dialect = NHibernate.Dialect.Dialect.GetDialect(connectionProperties); Dictionary<string, string> props = new Dictionary<string, string>(dialect.DefaultProperties); foreach (KeyValuePair<string, string> prop in connectionProperties) { props[prop.Key] = prop.Value; } connectionHelper = new ManagedProviderConnectionHelper(props); exceptions = new ArrayList(); }
public SchemaChangeValidator(Configuration cfg, IDictionary <string, string> connectionProperties) { this._configuration = cfg; this._dialect = Dialect.GetDialect(connectionProperties); var cfgProperties = new Dictionary <string, string>(this._dialect.DefaultProperties); foreach (var keyValuePair in connectionProperties) { cfgProperties[keyValuePair.Key] = keyValuePair.Value; } this._connectionHelper = new ManagedProviderConnectionHelper(cfgProperties); }
public void GetADOProjectClientReturnsResponseTests() { // Arrange ConfigHelper.ADOUrl = ConfigHelper.GetAppSetting("ADOUrl"); ConfigHelper.ADOToken = ConfigHelper.GetAppSetting("ADOToken"); _connectionHelper = new ConnectionHelper(); // Act var response = _connectionHelper.GetADOProjectClient(); // Assert Assert.IsNotNull(response); }
public SqlCharacterRepositoryTests() { // mock _testRelationDatabaseHelper = TestHook.GetTestRelationDatabaseHelper(); _database = "character"; _table = "character"; _connectionHelper = Substitute.For <IConnectionHelper>(); _connectionHelper.Character. Returns(new SqlConnection(_testRelationDatabaseHelper.GetConnectionString(_database))); _testRelationDatabaseHelper.CreateDatabase(this._database); _testRelationDatabaseHelper.CreateTable(_database, _table); }
public SchemaUpdate(Configuration cfg, IDictionary<string, string> configProperties) { configuration = cfg; dialect = Dialect.Dialect.GetDialect(configProperties); var props = new Dictionary<string, string>(dialect.DefaultProperties); foreach (var prop in configProperties) { props[prop.Key] = prop.Value; } connectionHelper = new ManagedProviderConnectionHelper(props); exceptions = new List<Exception>(); formatter = (PropertiesHelper.GetBoolean(Environment.FormatSql, configProperties, true) ? FormatStyle.Ddl : FormatStyle.None).Formatter; }
public void GetADOWorkItemTrackingHttpClientEmptyTokenReturnsResponseTest() { // Arrange ConfigHelper.ADOUrl = ConfigHelper.GetAppSetting("ADOUrl"); ConfigHelper.ADOToken = string.Empty; _connectionHelper = new ConnectionHelper(); // Act var response = _connectionHelper.GetADOWorkItemTrackingHttpClient(); // Assert Assert.IsNotNull(response); }
static IEnumerable <string> GetReservedWords(Dialect.Dialect dialect, IConnectionHelper connectionHelper) { connectionHelper.Prepare(); try { var metaData = dialect.GetDataBaseSchema(connectionHelper.Connection); return(metaData.GetReservedWords()); } finally { connectionHelper.Release(); } }
public SchemaUpdate(Configuration cfg, IDictionary <string, string> configProperties) { configuration = cfg; dialect = Dialect.Dialect.GetDialect(configProperties); var props = new Dictionary <string, string>(dialect.DefaultProperties); foreach (var prop in configProperties) { props[prop.Key] = prop.Value; } connectionHelper = new ManagedProviderConnectionHelper(props); exceptions = new List <Exception>(); formatter = (PropertiesHelper.GetBoolean(Environment.FormatSql, configProperties, true) ? FormatStyle.Ddl : FormatStyle.None).Formatter; }
public void GetV1ConnectionReturnNoConnectionWithInvalidCredentials() { // Arrange _connectionHelper = new ConnectionHelper(new V1UserCredentials("Test", "Test")); // Act var response = _connectionHelper.GetV1Connection(); // Assert Assert.IsNotNull(response); Assert.IsFalse(response.IsValid); Assert.AreEqual(response.ErrorMessage, "Unauthorized"); Assert.IsNull(response.Connection); }
public void GetV1ConnectionReturnNoConnectionWithEmptyCredentials() { // Arrange _connectionHelper = new ConnectionHelper(new V1UserCredentials(string.Empty, string.Empty)); // Act var response = _connectionHelper.GetV1Connection(); // Assert Assert.IsNotNull(response); Assert.IsFalse(response.IsValid); Assert.AreEqual(response.ErrorMessage, "Invalid Username/Password."); Assert.IsNull(response.Connection); }
private static Iesi.Collections.Generic.ISet<string> GetReservedWords(Dialect.Dialect dialect, IConnectionHelper connectionHelper) { Iesi.Collections.Generic.ISet<string> reservedDb = new HashedSet<string>(); connectionHelper.Prepare(); try { var metaData = dialect.GetDataBaseSchema(connectionHelper.Connection); foreach (var rw in metaData.GetReservedWords()) { reservedDb.Add(rw.ToLowerInvariant()); } } finally { connectionHelper.Release(); } return reservedDb; }
private static ISet <string> GetReservedWords(Dialect.Dialect dialect, IConnectionHelper connectionHelper) { ISet <string> reservedDb = new HashedSet <string>(); connectionHelper.Prepare(); try { var metaData = dialect.GetDataBaseSchema(connectionHelper.Connection); foreach (var rw in metaData.GetReservedWords()) { reservedDb.Add(rw.ToLowerInvariant()); } } finally { connectionHelper.Release(); } return(reservedDb); }
public void NetworkConnectAndCatch(IConnectionHelper connectionHelper, String userAgent, int connectionTimeout = ParsedUri.CONNECT_TIMEOUT, int readTimeout = ParsedUri.READ_TIMEOUT) { NetworkConnect(connectionHelper, userAgent, connectionTimeout, readTimeout); try { NetworkConnect(connectionHelper, userAgent, connectionTimeout, readTimeout); } catch (WebException e) { Timeout = true; CleanUp(e); } catch (Exception e) // catch all exceptions, including security { CleanUp(e); } }
public void GetV1ConnectionReturnConnectionSuccess() { // Arrange _connectionHelper = new ConnectionHelper(new V1UserCredentials("yourUsername", "yourPassowrd")); IServices _mockServiceConnection = MockRepository.Mock <IServices>(); IAssetType _mockAssetType = MockRepository.Mock <IAssetType>(); Oid oid = new Oid(_mockAssetType, 1, null); _mockServiceConnection.Expect(x => x.LoggedIn).Return(oid); _mockServiceConnection.Expect(x => x.Meta.GetAssetType(null)).IgnoreArguments().Return(_mockAssetType); // Act var response = _connectionHelper.GetV1Connection(); // Assert Assert.IsNotNull(response); Assert.IsTrue(response.IsValid); Assert.AreEqual(response.ErrorMessage, string.Empty); Assert.IsNotNull(response.Connection); _mockAssetType.VerifyAllExpectations(); _mockServiceConnection.VerifyAllExpectations(); }
private PlexServerConnection(IConnectionHelper connectionHelper) { _connectionHelper = connectionHelper; NowPlaying = new ReadOnlyObservableCollection <Video>(_nowPlaying); Clients = new ReadOnlyObservableCollection <Server>(_clients); }
public DataAccess(ILogWriter log, IConfigFields config, IConnectionHelper connectionHelper) { _log = log; _config = config; _connectionHelper = connectionHelper; }
public CustomerRepository(IConnectionHelper iConnectionHelper) { this._iConnectionHelper = iConnectionHelper; }
public void Connect(IConnectionHelper connectionHelper, String userAgent, int connectionTimeout, int readTimeout) { // get an InputStream, and set the mimeType, if not bad FundamentalPlatformSpecifics.Get().Connect(connectionHelper, userAgent, connectionTimeout, readTimeout, this); }
public void NetworkConnectAndCatch(IConnectionHelper connectionHelper, String userAgent, int connectionTimeout = ParsedUri.CONNECT_TIMEOUT, int readTimeout = ParsedUri.READ_TIMEOUT) { NetworkConnect(connectionHelper, userAgent, connectionTimeout, readTimeout); try { NetworkConnect(connectionHelper, userAgent, connectionTimeout, readTimeout); } catch (WebException e) { Timeout = true; CleanUp(e); } catch (Exception e) // catch all exceptions, including security { CleanUp(e); } }
public void Connect(IConnectionHelper connectionHelper, String userAgent, int connectionTimeout, int readTimeout) { // get an InputStream, and set the mimeType, if not bad FundamentalPlatformSpecifics.Get().Connect(connectionHelper, userAgent, connectionTimeout, readTimeout, this); }
static async Task <IEnumerable <string> > GetReservedWordsAsync(Dialect.Dialect dialect, IConnectionHelper connectionHelper, CancellationToken cancellationToken) { cancellationToken.ThrowIfCancellationRequested(); await(connectionHelper.PrepareAsync(cancellationToken)).ConfigureAwait(false); try { var metaData = dialect.GetDataBaseSchema(connectionHelper.Connection); return(metaData.GetReservedWords()); } finally { connectionHelper.Release(); } }
static async Task UpdateDialectKeywordsAsync(Dialect.Dialect dialect, IConnectionHelper connectionHelper, CancellationToken cancellationToken) { cancellationToken.ThrowIfCancellationRequested(); dialect.RegisterKeywords(await(GetReservedWordsAsync(dialect, connectionHelper, cancellationToken)).ConfigureAwait(false)); }
static void UpdateDialectKeywords(Dialect.Dialect dialect, IConnectionHelper connectionHelper) { dialect.RegisterKeywords(GetReservedWords(dialect, connectionHelper)); }
public SchemaValidator(Configuration cfg, Settings settings) { configuration = cfg; dialect = settings.Dialect; connectionHelper = new SuppliedConnectionProviderConnectionHelper(settings.ConnectionProvider); }