use of com.hazelcast.config.matcher.MatchingPointConfigPatternMatcher in project hazelcast by hazelcast.
the class MatchingPointConfigPatternMatcherTest method testQueueConfigWildcard.
@Test
public void testQueueConfigWildcard() {
QueueConfig queueConfig = new QueueConfig().setName("abc*");
Config config = new Config();
config.setConfigPatternMatcher(new MatchingPointConfigPatternMatcher());
config.addQueueConfig(queueConfig);
assertEquals(queueConfig, config.getQueueConfig("abcD"));
assertNotEquals(queueConfig, config.getQueueConfig("abDD"));
}
use of com.hazelcast.config.matcher.MatchingPointConfigPatternMatcher in project hazelcast by hazelcast.
the class MatchingPointConfigPatternMatcherTest method testMapConfigWildcardDocumentationExample2.
@Test
public void testMapConfigWildcardDocumentationExample2() {
MapConfig mapConfig = new MapConfig().setName("com.hazel*");
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 testMapConfigWildcardDocumentationExample4.
@Test
public void testMapConfigWildcardDocumentationExample4() {
MapConfig mapConfig = new MapConfig().setName("com.*test.myMap");
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 testMapConfigWildcardMultipleAmbiguousConfigs.
@Test(expected = InvalidConfigurationException.class)
public void testMapConfigWildcardMultipleAmbiguousConfigs() {
MapConfig mapConfig1 = new MapConfig().setName("com.hazelcast*");
MapConfig mapConfig2 = new MapConfig().setName("*com.hazelcast");
Config config = new Config();
config.setConfigPatternMatcher(new MatchingPointConfigPatternMatcher());
config.addMapConfig(mapConfig1);
config.addMapConfig(mapConfig2);
config.getMapConfig("com.hazelcast");
}
use of com.hazelcast.config.matcher.MatchingPointConfigPatternMatcher in project hazelcast by hazelcast.
the class MatchingPointConfigPatternMatcherTest method testMapConfigWithoutWildcard.
@Test
public void testMapConfigWithoutWildcard() {
MapConfig mapConfig = new MapConfig().setName("someMap");
Config config = new Config();
config.setConfigPatternMatcher(new MatchingPointConfigPatternMatcher());
config.addMapConfig(mapConfig);
assertEquals(mapConfig, config.getMapConfig("someMap"));
assertEquals(mapConfig, config.getMapConfig("someMap@foo"));
// non-matching name
assertNotEquals(mapConfig, config.getMapConfig("doesNotExist"));
// non-matching case
assertNotEquals(mapConfig, config.getMapConfig("SomeMap"));
}
Aggregations