use of com.hazelcast.config.NearCacheConfig in project hazelcast by hazelcast.
the class MatchingPointConfigPatternMatcherTest method testNearCacheConfigWildcardOnly.
@Test
public void testNearCacheConfigWildcardOnly() {
NearCacheConfig nearCacheConfig = new NearCacheConfig().setName("*");
ClientConfig config = new ClientConfig();
config.setConfigPatternMatcher(new MatchingPointConfigPatternMatcher());
config.addNearCacheConfig(nearCacheConfig);
assertEquals(nearCacheConfig, config.getNearCacheConfig("com.hazelcast.myNearCache"));
}
use of com.hazelcast.config.NearCacheConfig in project hazelcast by hazelcast.
the class MatchingPointConfigPatternMatcherTest method testNearCacheConfigWildcard1.
@Test
public void testNearCacheConfigWildcard1() {
NearCacheConfig nearCacheConfig = new NearCacheConfig().setName("*hazelcast.test.myNearCache");
ClientConfig config = new ClientConfig();
config.setConfigPatternMatcher(new MatchingPointConfigPatternMatcher());
config.addNearCacheConfig(nearCacheConfig);
assertEquals(nearCacheConfig, config.getNearCacheConfig("com.hazelcast.test.myNearCache"));
}
use of com.hazelcast.config.NearCacheConfig in project hazelcast by hazelcast.
the class MatchingPointConfigPatternMatcherTest method testNearCacheConfigWildcard3.
@Test
public void testNearCacheConfigWildcard3() {
NearCacheConfig nearCacheConfig = new NearCacheConfig().setName("com.hazelcast.test.*");
ClientConfig config = new ClientConfig();
config.setConfigPatternMatcher(new MatchingPointConfigPatternMatcher());
config.addNearCacheConfig(nearCacheConfig);
assertEquals(nearCacheConfig, config.getNearCacheConfig("com.hazelcast.test.myNearCache"));
}
use of com.hazelcast.config.NearCacheConfig in project hazelcast by hazelcast.
the class MatchingPointConfigPatternMatcherTest method testNearCacheConfigWildcardMultipleConfigs.
@Test
public void testNearCacheConfigWildcardMultipleConfigs() {
NearCacheConfig nearCacheConfig1 = new NearCacheConfig().setName("com.hazelcast.*");
NearCacheConfig nearCacheConfig2 = new NearCacheConfig().setName("com.hazelcast.test.*");
NearCacheConfig nearCacheConfig3 = new NearCacheConfig().setName("com.hazelcast.test.sub.*");
ClientConfig config = new ClientConfig();
config.setConfigPatternMatcher(new MatchingPointConfigPatternMatcher());
config.addNearCacheConfig(nearCacheConfig1);
config.addNearCacheConfig(nearCacheConfig2);
config.addNearCacheConfig(nearCacheConfig3);
// we should get the best matching result
assertEquals(nearCacheConfig1, config.getNearCacheConfig("com.hazelcast.myNearCache"));
assertEquals(nearCacheConfig2, config.getNearCacheConfig("com.hazelcast.test.myNearCache"));
assertEquals(nearCacheConfig3, config.getNearCacheConfig("com.hazelcast.test.sub.myNearCache"));
}
use of com.hazelcast.config.NearCacheConfig in project hazelcast by hazelcast.
the class MatchingPointConfigPatternMatcherTest method testNearCacheConfigWildcardMatchingPointEndsWith.
@Test
public 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)
assertNull(config.getNearCacheConfig("com.hazelFast.Fast.sub.myNearCache"));
assertNull(config.getNearCacheConfig("hazelFast.test.sub.myNearCache"));
assertNull(config.getNearCacheConfig("test.sub.myNearCache"));
}
Aggregations