use of com.hazelcast.config.matcher.MatchingPointConfigPatternMatcher in project hazelcast by hazelcast.
the class MatchingPointConfigPatternMatcherTest method testMapConfigWildcardEndsWith.
@Test
public void testMapConfigWildcardEndsWith() {
MapConfig mapConfig = new MapConfig().setName("*ab");
Config config = new Config();
config.setConfigPatternMatcher(new MatchingPointConfigPatternMatcher());
config.addMapConfig(mapConfig);
// we should match this
assertEquals(mapConfig, config.getMapConfig("xyz.ab"));
assertEquals(mapConfig, config.getMapConfig("xyz.ab@foo"));
// we should not match this anymore (endsWith)
assertNotEquals(mapConfig, config.getMapConfig("xyz.abc"));
assertNotEquals(mapConfig, config.getMapConfig("xyz.abc@foo"));
}
use of com.hazelcast.config.matcher.MatchingPointConfigPatternMatcher in project hazelcast by hazelcast.
the class MatchingPointConfigPatternMatcherTest method testMapConfigWildcardDocumentationExample1.
@Test
public void testMapConfigWildcardDocumentationExample1() {
MapConfig mapConfig = new MapConfig().setName("com.hazelcast.test.*");
Config config = new Config();
config.setConfigPatternMatcher(new MatchingPointConfigPatternMatcher());
config.addMapConfig(mapConfig);
assertEquals(mapConfig, config.getMapConfig("com.hazelcast.test.myMap"));
}
use of com.hazelcast.config.matcher.MatchingPointConfigPatternMatcher in project hazelcast by hazelcast.
the class MatchingPointConfigPatternMatcherTest method testMapConfigWildcardMultipleConfigs.
@Test
public void testMapConfigWildcardMultipleConfigs() {
MapConfig mapConfig1 = new MapConfig().setName("com.hazelcast.*");
MapConfig mapConfig2 = new MapConfig().setName("com.hazelcast.test.*");
MapConfig mapConfig3 = new MapConfig().setName("com.hazelcast.test.sub.*");
Config config = new Config();
config.setConfigPatternMatcher(new MatchingPointConfigPatternMatcher());
config.addMapConfig(mapConfig1);
config.addMapConfig(mapConfig2);
config.addMapConfig(mapConfig3);
// we get the best match
assertEquals(mapConfig1, config.getMapConfig("com.hazelcast.myMap"));
assertEquals(mapConfig2, config.getMapConfig("com.hazelcast.test.myMap"));
assertEquals(mapConfig3, config.getMapConfig("com.hazelcast.test.sub.myMap"));
}
use of com.hazelcast.config.matcher.MatchingPointConfigPatternMatcher in project hazelcast by hazelcast.
the class MatchingPointConfigPatternMatcherTest method testMapConfigWildcardStartsWith.
@Test
public void testMapConfigWildcardStartsWith() {
MapConfig mapConfig = new MapConfig().setName("bc*");
Config config = new Config();
config.setConfigPatternMatcher(new MatchingPointConfigPatternMatcher());
config.addMapConfig(mapConfig);
// we should match this
assertEquals(mapConfig, config.getMapConfig("bc.xyz"));
assertEquals(mapConfig, config.getMapConfig("bc.xyz@foo"));
// we should not match this anymore (startsWith)
assertNotEquals(mapConfig, config.getMapConfig("abc.xyz"));
assertNotEquals(mapConfig, config.getMapConfig("abc.xyz@foo"));
}
use of com.hazelcast.config.matcher.MatchingPointConfigPatternMatcher in project hazelcast by hazelcast.
the class MatchingPointConfigPatternMatcherTest method testMapConfigWildcardDocumentationExample3.
@Test
public void testMapConfigWildcardDocumentationExample3() {
MapConfig mapConfig = new MapConfig().setName("*.test.myMap");
Config config = new Config();
config.setConfigPatternMatcher(new MatchingPointConfigPatternMatcher());
config.addMapConfig(mapConfig);
assertEquals(mapConfig, config.getMapConfig("com.hazelcast.test.myMap"));
}
Aggregations