use of com.hazelcast.config.matcher.MatchingPointConfigPatternMatcher in project hazelcast by hazelcast.
the class MatchingPointConfigPatternMatcherTest method testMapConfigWildcardOnly.
@Test
public void testMapConfigWildcardOnly() {
MapConfig mapConfig = new MapConfig().setName("*");
Config config = new Config();
config.setConfigPatternMatcher(new MatchingPointConfigPatternMatcher());
config.addMapConfig(mapConfig);
assertEquals(mapConfig, config.getMapConfig("com.hazelcast.myMap"));
}
use of com.hazelcast.config.matcher.MatchingPointConfigPatternMatcher 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.matcher.MatchingPointConfigPatternMatcher 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.matcher.MatchingPointConfigPatternMatcher 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.matcher.MatchingPointConfigPatternMatcher 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"));
}
Aggregations