public void Test_Server_With_FQDN_Is_Properly_Resolved() { var clientConfig = new ClientConfiguration { Servers = new List<Uri> { new Uri("http://localhost:8091") }, UseSsl = false }; clientConfig.Initialize(); var bucketConfig = JsonConvert.DeserializeObject<BucketConfig>( File.ReadAllText("Data\\Configuration\\config-with-fqdn-servers.json")); var configInfo = new CouchbaseConfigContext(bucketConfig, clientConfig, pool => new DefaultIOStrategy(pool), (config, endpoint) => new ConnectionPool<Connection>(config, endpoint), SaslFactory.GetFactory3(), new DefaultTranscoder(new DefaultConverter())); Assert.DoesNotThrow(() => configInfo.LoadConfig()); Assert.IsNotNull(configInfo.GetKeyMapper()); Assert.AreEqual("127.0.0.1", configInfo.GetServers().First().EndPoint.Address.ToString()); Log.Debug(m => m("CLEANUP!")); configInfo.Dispose(); }
public void When_NodesExt_Does_Not_Exist_Defaults_are_used() { var clientConfig = new ClientConfiguration { Servers = new List<Uri> { new Uri("http://localhost:8091") }, UseSsl = false }; clientConfig.Initialize(); var bucketConfig = JsonConvert.DeserializeObject<BucketConfig>( File.ReadAllText("Data\\Configuration\\carrier-publication-config.json")); var configInfo = new CouchbaseConfigContext(bucketConfig, clientConfig, pool => new DefaultIOStrategy(pool), (config, endpoint) => new ConnectionPool<Connection>(config, endpoint), SaslFactory.GetFactory3(), new DefaultTranscoder(new DefaultConverter())); Assert.DoesNotThrow(() => configInfo.LoadConfig()); Assert.IsNotNull(configInfo.GetKeyMapper()); }