use of org.infinispan.search.mapper.mapping.SearchMapping in project infinispan by infinispan.
the class RemoteQueryDslConditionsTunedTest method testIndexPresence.
@Override
public void testIndexPresence() {
SearchMapping searchMapping = TestingUtil.extractComponent(cache, SearchMapping.class);
// we have indexing for remote query!
assertNotNull(searchMapping.indexedEntity("sample_bank_account.User"));
assertNotNull(searchMapping.indexedEntity("sample_bank_account.Account"));
assertNotNull(searchMapping.indexedEntity("sample_bank_account.Transaction"));
// we have some indexes for this cache
assertEquals(3, searchMapping.allIndexedEntities().size());
}
use of org.infinispan.search.mapper.mapping.SearchMapping in project infinispan by infinispan.
the class RemoteQueryDisableIndexingTest method testEmptyIndexIsPresent.
public void testEmptyIndexIsPresent() {
SearchMapping searchMapping = TestingUtil.extractComponent(cache, SearchMapping.class);
// we have indexing for remote query!
assertNotNull(searchMapping.indexedEntity("sample_bank_account.User"));
assertNotNull(searchMapping.indexedEntity("sample_bank_account.Account"));
assertNotNull(searchMapping.indexedEntity("sample_bank_account.Transaction"));
// we have some indexes for this cache
assertEquals(3, searchMapping.allIndexedEntities().size());
}
use of org.infinispan.search.mapper.mapping.SearchMapping in project infinispan by infinispan.
the class DefaultCacheInheritancePreventedTest method assertIndexingEnabled.
/**
* Verifies that the SearchIntegrator is or is not registered as expected
* @param expected true if you expect indexing to be enabled
* @param cache the cache to extract indexing from
*/
private void assertIndexingEnabled(Cache<Object, Object> cache, boolean expected) {
SearchMapping searchMapping = null;
try {
searchMapping = ComponentRegistryUtils.getSearchMapping(cache);
} catch (IllegalStateException e) {
// ignored here, we deal with it later
}
if (expected && searchMapping == null) {
Assert.fail("SearchIntegrator not found but expected for cache " + cache.getName());
}
if (!expected && searchMapping != null) {
Assert.fail("SearchIntegrator not expected but found for cache " + cache.getName());
}
// verify as well that the indexing interceptor is (not) there:
QueryInterceptor queryInterceptor = null;
try {
queryInterceptor = ComponentRegistryUtils.getQueryInterceptor(cache);
} catch (IllegalStateException e) {
// ignored here, we deal with it later
}
if (expected && queryInterceptor == null) {
Assert.fail("QueryInterceptor not found but expected for cache " + cache.getName());
}
if (!expected && queryInterceptor != null) {
Assert.fail("QueryInterceptor not expected but found for cache " + cache.getName());
}
}
use of org.infinispan.search.mapper.mapping.SearchMapping in project infinispan by infinispan.
the class TestQueryHelperFactory method extractSearchMapping.
public static SearchMapping extractSearchMapping(Cache<?, ?> cache) {
ComponentRegistry componentRegistry = cache.getAdvancedCache().getComponentRegistry();
SearchMapping searchMapping = componentRegistry.getComponent(SearchMapping.class);
assertNotNull(searchMapping);
return searchMapping;
}
use of org.infinispan.search.mapper.mapping.SearchMapping in project infinispan by infinispan.
the class EntryActivatingTest method recreateCacheManager.
private void recreateCacheManager() {
ConfigurationBuilder cfg = new ConfigurationBuilder();
cfg.persistence().passivation(true).addStore(DummyInMemoryStoreConfigurationBuilder.class).preload(true).indexing().enable().storage(LOCAL_HEAP).addIndexedEntity(Country.class);
cm = TestCacheManagerFactory.createCacheManager(QueryTestSCI.INSTANCE, cfg);
cache = cm.getCache();
store = TestingUtil.getFirstStore(cache);
queryFactory = Search.getQueryFactory(cache);
searchMapping = TestingUtil.extractComponent(cache, SearchMapping.class);
}
Aggregations