Search in sources :

Example 6 with MatchingPointConfigPatternMatcher

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"));
}
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 7 with MatchingPointConfigPatternMatcher

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

Example 8 with MatchingPointConfigPatternMatcher

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

Example 9 with MatchingPointConfigPatternMatcher

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

Example 10 with MatchingPointConfigPatternMatcher

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"));
}
Also used : NearCacheConfig(com.hazelcast.config.NearCacheConfig) 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