use of com.hazelcast.config.matcher.MatchingPointConfigPatternMatcher 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"));
}
use of com.hazelcast.config.matcher.MatchingPointConfigPatternMatcher in project hazelcast-jet by hazelcast.
the class Jet method configureJetService.
static void configureJetService(JetConfig jetConfig) {
if (!(jetConfig.getHazelcastConfig().getConfigPatternMatcher() instanceof MatchingPointConfigPatternMatcher)) {
throw new UnsupportedOperationException("Custom config pattern matcher is not supported in Jet");
}
jetConfig.getHazelcastConfig().getServicesConfig().addServiceConfig(new ServiceConfig().setEnabled(true).setName(JetService.SERVICE_NAME).setClassName(JetService.class.getName()).setConfigObject(jetConfig));
jetConfig.getHazelcastConfig().addMapConfig(new MapConfig(INTERNAL_JET_OBJECTS_PREFIX + "*").setBackupCount(jetConfig.getInstanceConfig().getBackupCount()).setStatisticsEnabled(false).setMergePolicy(IgnoreMergingEntryMapMergePolicy.class.getName()));
}
use of com.hazelcast.config.matcher.MatchingPointConfigPatternMatcher in project hazelcast by hazelcast.
the class MatchingPointConfigPatternMatcherTest method testQueueConfigWithoutWildcard.
@Test
public void testQueueConfigWithoutWildcard() {
QueueConfig queueConfig = new QueueConfig().setName("someQueue");
Config config = new Config();
config.setConfigPatternMatcher(new MatchingPointConfigPatternMatcher());
config.addQueueConfig(queueConfig);
assertEquals(queueConfig, config.getQueueConfig("someQueue"));
assertEquals(queueConfig, config.getQueueConfig("someQueue@foo"));
// non-matching name
assertNotEquals(queueConfig, config.getQueueConfig("doesNotExist"));
// non-matching case
assertNotEquals(queueConfig, config.getQueueConfig("SomeQueue"));
}
use of com.hazelcast.config.matcher.MatchingPointConfigPatternMatcher in project hazelcast by hazelcast.
the class MatchingPointConfigPatternMatcherTest method testQueueConfigWildcardDocumentationExample1.
@Test
public void testQueueConfigWildcardDocumentationExample1() {
QueueConfig queueConfig = new QueueConfig().setName("*hazelcast.test.myQueue");
Config config = new Config();
config.setConfigPatternMatcher(new MatchingPointConfigPatternMatcher());
config.addQueueConfig(queueConfig);
assertEquals(queueConfig, config.getQueueConfig("com.hazelcast.test.myQueue"));
}
use of com.hazelcast.config.matcher.MatchingPointConfigPatternMatcher in project hazelcast by hazelcast.
the class MatchingPointConfigPatternMatcherTest method testQueueConfigWildcardDocumentationExample2.
@Test
public void testQueueConfigWildcardDocumentationExample2() {
QueueConfig queueConfig = new QueueConfig().setName("com.hazelcast.*.myQueue");
Config config = new Config();
config.setConfigPatternMatcher(new MatchingPointConfigPatternMatcher());
config.addQueueConfig(queueConfig);
assertEquals(queueConfig, config.getQueueConfig("com.hazelcast.test.myQueue"));
}
Aggregations