use of org.apache.drill.exec.expr.fn.DrillFuncHolder in project drill by apache.
the class FunctionRegistryHolderTest method testGetHoldersByFunctionNameWithVersion.
@Test
public void testGetHoldersByFunctionNameWithVersion() {
List<DrillFuncHolder> expectedResult = Lists.newArrayList();
for (List<FunctionHolder> functionHolders : newJars.values()) {
for (FunctionHolder functionHolder : functionHolders) {
if ("lower".equals(functionHolder.getName())) {
expectedResult.add(functionHolder.getHolder());
}
}
}
assertFalse(expectedResult.isEmpty());
AtomicLong version = new AtomicLong();
compareTwoLists(expectedResult, registryHolder.getHoldersByFunctionName("lower", version));
assertEquals("Version number should match", version.get(), registryHolder.getVersion());
}
use of org.apache.drill.exec.expr.fn.DrillFuncHolder in project drill by apache.
the class FunctionRegistryHolderTest method testGetAllFunctionsWithHoldersWithVersion.
@Test
public void testGetAllFunctionsWithHoldersWithVersion() {
ListMultimap<String, DrillFuncHolder> expectedResult = ArrayListMultimap.create();
for (List<FunctionHolder> functionHolders : newJars.values()) {
for (FunctionHolder functionHolder : functionHolders) {
expectedResult.put(functionHolder.getName(), functionHolder.getHolder());
}
}
AtomicLong version = new AtomicLong();
compareListMultimaps(expectedResult, registryHolder.getAllFunctionsWithHolders(version));
assertEquals("Version number should match", version.get(), registryHolder.getVersion());
}
Aggregations