Search in sources :

Example 1 with StaticMapExtractionNamespace

use of io.druid.query.lookup.namespace.StaticMapExtractionNamespace in project druid by druid-io.

the class StaticMapExtractionNamespaceCacheFactoryTest method testSimplePopulator.

@Test
public void testSimplePopulator() throws Exception {
    final StaticMapExtractionNamespaceCacheFactory factory = new StaticMapExtractionNamespaceCacheFactory();
    final StaticMapExtractionNamespace namespace = new StaticMapExtractionNamespace(MAP);
    CacheScheduler.VersionedCache versionedCache = factory.populateCache(namespace, null, null, scheduler);
    Assert.assertNotNull(versionedCache);
    Assert.assertEquals(factory.getVersion(), versionedCache.getVersion());
    Assert.assertEquals(MAP, versionedCache.getCache());
}
Also used : StaticMapExtractionNamespace(io.druid.query.lookup.namespace.StaticMapExtractionNamespace) CacheScheduler(io.druid.server.lookup.namespace.cache.CacheScheduler) Test(org.junit.Test)

Example 2 with StaticMapExtractionNamespace

use of io.druid.query.lookup.namespace.StaticMapExtractionNamespace in project druid by druid-io.

the class StaticMapExtractionNamespaceCacheFactoryTest method testNonNullLastVersionCausesAssertionError.

@Test(expected = AssertionError.class)
public void testNonNullLastVersionCausesAssertionError() {
    final StaticMapExtractionNamespaceCacheFactory factory = new StaticMapExtractionNamespaceCacheFactory();
    final StaticMapExtractionNamespace namespace = new StaticMapExtractionNamespace(MAP);
    factory.populateCache(namespace, null, factory.getVersion(), scheduler);
}
Also used : StaticMapExtractionNamespace(io.druid.query.lookup.namespace.StaticMapExtractionNamespace) Test(org.junit.Test)

Aggregations

StaticMapExtractionNamespace (io.druid.query.lookup.namespace.StaticMapExtractionNamespace)2 Test (org.junit.Test)2 CacheScheduler (io.druid.server.lookup.namespace.cache.CacheScheduler)1