Search in sources :

Example 16 with MatchingPointConfigPatternMatcher

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"));
}
Also used : MatchingPointConfigPatternMatcher(com.hazelcast.config.matcher.MatchingPointConfigPatternMatcher) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 17 with MatchingPointConfigPatternMatcher

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"));
}
Also used : MatchingPointConfigPatternMatcher(com.hazelcast.config.matcher.MatchingPointConfigPatternMatcher) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 18 with MatchingPointConfigPatternMatcher

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"));
}
Also used : MatchingPointConfigPatternMatcher(com.hazelcast.config.matcher.MatchingPointConfigPatternMatcher) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 19 with MatchingPointConfigPatternMatcher

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");
}
Also used : MatchingPointConfigPatternMatcher(com.hazelcast.config.matcher.MatchingPointConfigPatternMatcher) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 20 with MatchingPointConfigPatternMatcher

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"));
}
Also used : MatchingPointConfigPatternMatcher(com.hazelcast.config.matcher.MatchingPointConfigPatternMatcher) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Aggregations

MatchingPointConfigPatternMatcher (com.hazelcast.config.matcher.MatchingPointConfigPatternMatcher)25 ParallelJVMTest (com.hazelcast.test.annotation.ParallelJVMTest)24 QuickTest (com.hazelcast.test.annotation.QuickTest)24 Test (org.junit.Test)24 NearCacheConfig (com.hazelcast.config.NearCacheConfig)10 MapConfig (com.hazelcast.config.MapConfig)1 ServiceConfig (com.hazelcast.config.ServiceConfig)1 JetService (com.hazelcast.jet.impl.JetService)1