本文整理汇总了C#中ClientConfig.GetNearCacheConfig方法的典型用法代码示例。如果您正苦于以下问题:C# ClientConfig.GetNearCacheConfig方法的具体用法?C# ClientConfig.GetNearCacheConfig怎么用?C# ClientConfig.GetNearCacheConfig使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ClientConfig
的用法示例。
在下文中一共展示了ClientConfig.GetNearCacheConfig方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestSpecificNearCacheConfig_whenAsteriskAtTheBeginning
public virtual void TestSpecificNearCacheConfig_whenAsteriskAtTheBeginning()
{
var clientConfig = new ClientConfig();
var genericNearCacheConfig = new NearCacheConfig();
genericNearCacheConfig.SetName("*Map");
clientConfig.AddNearCacheConfig(genericNearCacheConfig);
var specificNearCacheConfig = new NearCacheConfig();
specificNearCacheConfig.SetName("*MapStudent");
clientConfig.AddNearCacheConfig(specificNearCacheConfig);
var mapFoo = clientConfig.GetNearCacheConfig("fooMap");
var mapStudentFoo = clientConfig.GetNearCacheConfig("fooMapStudent");
Assert.AreEqual(genericNearCacheConfig, mapFoo);
Assert.AreEqual(specificNearCacheConfig, mapStudentFoo);
}
示例2: TestNearCacheConfigWildcard3
public virtual void TestNearCacheConfigWildcard3()
{
NearCacheConfig nearCacheConfig = new NearCacheConfig().SetName("com.hazelcast.test.*");
ClientConfig config = new ClientConfig();
config.SetConfigPatternMatcher(new MatchingPointConfigPatternMatcher());
config.AddNearCacheConfig(nearCacheConfig);
Assert.AreEqual(nearCacheConfig, config.GetNearCacheConfig("com.hazelcast.test.myNearCache"));
}
示例3: TestMapConfigWildcardMultipleAmbiguousConfigs
public virtual void TestMapConfigWildcardMultipleAmbiguousConfigs()
{
NearCacheConfig nearCacheConfig1 = new NearCacheConfig().SetName("com.hazelcast*");
NearCacheConfig nearCacheConfig2 = new NearCacheConfig().SetName("*com.hazelcast");
ClientConfig config = new ClientConfig();
config.SetConfigPatternMatcher(new MatchingPointConfigPatternMatcher());
config.AddNearCacheConfig(nearCacheConfig1);
config.AddNearCacheConfig(nearCacheConfig2);
config.GetNearCacheConfig("com.hazelcast");
}
示例4: TestDuplicateConfig
public virtual void TestDuplicateConfig()
{
NearCacheConfig nearCacheConfig1 = new NearCacheConfig().SetName("com.hazelcast.*ap");
NearCacheConfig nearCacheConfig2 = new NearCacheConfig().SetName("com.hazelcast*map");
ClientConfig config = new ClientConfig();
config.SetConfigPatternMatcher(new MatchingPointConfigPatternMatcher());
config.AddNearCacheConfig(nearCacheConfig1);
config.AddNearCacheConfig(nearCacheConfig2);
config.GetNearCacheConfig("com.hazelcast.map");
}
示例5: TestSpecificNearCacheConfig_whenAsteriskInTheMiddle
public virtual void TestSpecificNearCacheConfig_whenAsteriskInTheMiddle()
{
var clientConfig = new ClientConfig();
var genericNearCacheConfig = new NearCacheConfig();
genericNearCacheConfig.SetName("map*Bar");
clientConfig.AddNearCacheConfig(genericNearCacheConfig);
var specificNearCacheConfig = new NearCacheConfig();
specificNearCacheConfig.SetName("mapStudent*Bar");
clientConfig.AddNearCacheConfig(specificNearCacheConfig);
var mapFoo = clientConfig.GetNearCacheConfig("mapFooBar");
var mapStudentFoo = clientConfig.GetNearCacheConfig("mapStudentFooBar");
Assert.AreEqual(genericNearCacheConfig, mapFoo);
Assert.AreEqual(specificNearCacheConfig, mapStudentFoo);
}
示例6: TestNearCacheConfigWildcardMatchingPointEndsWith
public virtual void TestNearCacheConfigWildcardMatchingPointEndsWith()
{
NearCacheConfig nearCacheConfig1 = new NearCacheConfig().SetName("*.sub");
NearCacheConfig nearCacheConfig2 = new NearCacheConfig().SetName("*.test.sub");
NearCacheConfig nearCacheConfig3 = new NearCacheConfig().SetName("*.hazelcast.test.sub");
ClientConfig config = new ClientConfig();
config.SetConfigPatternMatcher(new MatchingPointConfigPatternMatcher());
config.AddNearCacheConfig(nearCacheConfig1);
config.AddNearCacheConfig(nearCacheConfig2);
config.AddNearCacheConfig(nearCacheConfig3);
// we should not match any of the configs (endsWith)
Assert.AreEqual(null, config.GetNearCacheConfig("com.hazelFast.Fast.sub.myNearCache"));
Assert.AreEqual(null, config.GetNearCacheConfig("hazelFast.test.sub.myNearCache"));
Assert.AreEqual(null, config.GetNearCacheConfig("test.sub.myNearCache"));
}
示例7: TestNearCacheConfigWithoutWildcard
public virtual void TestNearCacheConfigWithoutWildcard()
{
NearCacheConfig nearCacheConfig = new NearCacheConfig().SetName("someNearCache");
ClientConfig config = new ClientConfig();
config.SetConfigPatternMatcher(new MatchingPointConfigPatternMatcher());
config.AddNearCacheConfig(nearCacheConfig);
Assert.AreEqual(nearCacheConfig, config.GetNearCacheConfig("someNearCache"));
// non-matching name
Assert.AreNotEqual(nearCacheConfig, config.GetNearCacheConfig("doesNotExist"));
// non-matching case
Assert.AreNotEqual(nearCacheConfig, config.GetNearCacheConfig("SomeNearCache"));
}
示例8: TestNearCacheConfigWildcardOnlyMultipleConfigs
public virtual void TestNearCacheConfigWildcardOnlyMultipleConfigs()
{
NearCacheConfig nearCacheConfig1 = new NearCacheConfig().SetName("*");
NearCacheConfig nearCacheConfig2 = new NearCacheConfig().SetName("com.hazelcast.*");
ClientConfig config = new ClientConfig();
config.SetConfigPatternMatcher(new MatchingPointConfigPatternMatcher());
config.AddNearCacheConfig(nearCacheConfig1);
config.AddNearCacheConfig(nearCacheConfig2);
// we should get the best matching result
Assert.AreEqual(nearCacheConfig2, config.GetNearCacheConfig("com.hazelcast.myNearCache"));
}
示例9: TestNearCacheConfigWildcardMatchingPointStartsWith
public virtual void TestNearCacheConfigWildcardMatchingPointStartsWith()
{
var nearCacheConfig1 = new NearCacheConfig().SetName("hazelcast.*");
var nearCacheConfig2 = new NearCacheConfig().SetName("hazelcast.test.*");
var nearCacheConfig3 = new NearCacheConfig().SetName("hazelcast.test.sub.*");
var config = new ClientConfig();
config.SetConfigPatternMatcher(new MatchingPointConfigPatternMatcher());
config.AddNearCacheConfig(nearCacheConfig1);
config.AddNearCacheConfig(nearCacheConfig2);
config.AddNearCacheConfig(nearCacheConfig3);
// we should not match any of the configs (startsWith)
Assert.AreEqual(null, config.GetNearCacheConfig("com.hazelcast.myNearCache"));
Assert.AreEqual(null, config.GetNearCacheConfig("com.hazelcast.test.myNearCache"));
Assert.AreEqual(null, config.GetNearCacheConfig("com.hazelcast.test.sub.myNearCache"));
}