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));
}
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));
}
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));
}
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));
}
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);
}
Aggregations