Search in sources :

Example 11 with MapAttributeConfig

use of com.hazelcast.config.MapAttributeConfig in project hazelcast by hazelcast.

the class ExtractorHelperTest method instantiate_extractors.

@Test
public void instantiate_extractors() {
    // GIVEN
    MapAttributeConfig iqExtractor = new MapAttributeConfig("iq", "com.hazelcast.query.impl.getters.ExtractorHelperTest$IqExtractor");
    MapAttributeConfig nameExtractor = new MapAttributeConfig("name", "com.hazelcast.query.impl.getters.ExtractorHelperTest$NameExtractor");
    // WHEN
    Map<String, ValueExtractor> extractors = instantiateExtractors(asList(iqExtractor, nameExtractor));
    // THEN
    assertThat(extractors.get("iq"), instanceOf(IqExtractor.class));
    assertThat(extractors.get("name"), instanceOf(NameExtractor.class));
}
Also used : MapAttributeConfig(com.hazelcast.config.MapAttributeConfig) ValueExtractor(com.hazelcast.query.extractor.ValueExtractor) Test(org.junit.Test)

Example 12 with MapAttributeConfig

use of com.hazelcast.config.MapAttributeConfig in project hazelcast by hazelcast.

the class ExtractorHelperTest method instantiate_extractor.

@Test
public void instantiate_extractor() {
    // GIVEN
    MapAttributeConfig config = new MapAttributeConfig("iq", "com.hazelcast.query.impl.getters.ExtractorHelperTest$IqExtractor");
    // WHEN
    ValueExtractor extractor = instantiateExtractor(config);
    // THEN
    assertThat(extractor, instanceOf(IqExtractor.class));
}
Also used : MapAttributeConfig(com.hazelcast.config.MapAttributeConfig) ValueExtractor(com.hazelcast.query.extractor.ValueExtractor) Test(org.junit.Test)

Example 13 with MapAttributeConfig

use of com.hazelcast.config.MapAttributeConfig in project hazelcast by hazelcast.

the class ExtractorHelperTest method instantiate_extractors_duplicateExtractor.

@Test
public void instantiate_extractors_duplicateExtractor() {
    // GIVEN
    MapAttributeConfig iqExtractor = new MapAttributeConfig("iq", "com.hazelcast.query.impl.getters.ExtractorHelperTest$IqExtractor");
    MapAttributeConfig iqExtractorDuplicate = new MapAttributeConfig("iq", "com.hazelcast.query.impl.getters.ExtractorHelperTest$IqExtractor");
    // EXPECT
    expected.expect(IllegalArgumentException.class);
    // WHEN
    instantiateExtractors(asList(iqExtractor, iqExtractorDuplicate));
}
Also used : MapAttributeConfig(com.hazelcast.config.MapAttributeConfig) Test(org.junit.Test)

Example 14 with MapAttributeConfig

use of com.hazelcast.config.MapAttributeConfig in project hazelcast by hazelcast.

the class ExtractorHelperTest method instantiate_extractors_accessException.

@Test
public void instantiate_extractors_accessException() {
    // GIVEN
    MapAttributeConfig string = new MapAttributeConfig("iq", "com.hazelcast.query.impl.getters.ExtractorHelperTest$AccessExceptionExtractor");
    // EXPECT
    expected.expect(IllegalArgumentException.class);
    // WHEN
    instantiateExtractors(asList(string));
}
Also used : MapAttributeConfig(com.hazelcast.config.MapAttributeConfig) Test(org.junit.Test)

Example 15 with MapAttributeConfig

use of com.hazelcast.config.MapAttributeConfig in project hazelcast by hazelcast.

the class ExtractorHelperTest method instantiate_extractor_notExistingClass.

@Test
public void instantiate_extractor_notExistingClass() {
    // GIVEN
    MapAttributeConfig config = new MapAttributeConfig("iq", "not.existing.class");
    // EXPECT
    expected.expect(IllegalArgumentException.class);
    expected.expectCause(isA(ClassNotFoundException.class));
    // WHEN
    instantiateExtractor(config);
}
Also used : MapAttributeConfig(com.hazelcast.config.MapAttributeConfig) Test(org.junit.Test)

Aggregations

MapAttributeConfig (com.hazelcast.config.MapAttributeConfig)17 Test (org.junit.Test)12 Config (com.hazelcast.config.Config)5 MapConfig (com.hazelcast.config.MapConfig)5 ValueExtractor (com.hazelcast.query.extractor.ValueExtractor)3 EntryListenerConfig (com.hazelcast.config.EntryListenerConfig)1 MapIndexConfig (com.hazelcast.config.MapIndexConfig)1 MapPartitionLostListenerConfig (com.hazelcast.config.MapPartitionLostListenerConfig)1 MapStoreConfig (com.hazelcast.config.MapStoreConfig)1 MultiMapConfig (com.hazelcast.config.MultiMapConfig)1 NearCacheConfig (com.hazelcast.config.NearCacheConfig)1 ReplicatedMapConfig (com.hazelcast.config.ReplicatedMapConfig)1 WanReplicationRef (com.hazelcast.config.WanReplicationRef)1 DefaultPortableReaderQuickTest (com.hazelcast.nio.serialization.impl.DefaultPortableReaderQuickTest)1 ComplexDataStructure (com.hazelcast.query.impl.extractor.specification.ComplexDataStructure)1 QuickTest (com.hazelcast.test.annotation.QuickTest)1 Setup (org.openjdk.jmh.annotations.Setup)1