@Test public void testNullCategory() { FunctionMethod method = new FunctionMethod( "dummy", null, null, PushDown.MUST_PUSHDOWN, "nonexistentClass", "noMethod", new ArrayList<FunctionParameter>(0), new FunctionParameter("output", DataTypeManager.DefaultDataTypes.STRING), false, Determinism.DETERMINISTIC); Collection<org.teiid.metadata.FunctionMethod> list = Arrays.asList(method); FunctionMetadataSource fms = Mockito.mock(FunctionMetadataSource.class); Mockito.stub(fms.getFunctionMethods()).toReturn(list); FunctionTree ft = new FunctionTree("foo", fms); assertEquals(1, ft.getFunctionsInCategory(FunctionCategoryConstants.MISCELLANEOUS).size()); }
Set<FunctionMethod> getFunctionsInCategory(String name) { Set<FunctionMethod> names = categories.get(name); if (names == null) { return Collections.emptySet(); } return names; }
FunctionTree { Set<FunctionMethod> getFunctionsInCategory(String name) { Set<FunctionMethod> names = categories.get(name); if (names == null) { return Collections.emptySet(); } return names; } }
FunctionTree { Set<FunctionMethod> getFunctionsInCategory(String name) { Set<FunctionMethod> names = categories.get(name); if (names == null) { return Collections.emptySet(); } return names; } FunctionTree(String name, FunctionMetadataSource source);  FunctionTree(String name, FunctionMetadataSource source, boolean validateClass); }
FunctionTree { Set<FunctionMethod> getFunctionsInCategory(String name) { Set<FunctionMethod> names = categories.get(name); if (names == null) { return Collections.emptySet(); } return names; } FunctionTree(String name, FunctionMetadataSource source);  FunctionTree(String name, FunctionMetadataSource source, boolean validateClass); String getSchemaName(); Map<String, FunctionMethod> getFunctionsByUuid(); FunctionDescriptor addFunction(String schema, FunctionMetadataSource source, FunctionMethod method, boolean system); static FunctionTree getFunctionProcedures(Schema schema); boolean hasFunctionWithName(String name); }
FunctionTree { Set<FunctionMethod> getFunctionsInCategory(String name) { Set<FunctionMethod> names = categories.get(name); if (names == null) { return Collections.emptySet(); } return names; } FunctionTree(String name, FunctionMetadataSource source);  FunctionTree(String name, FunctionMetadataSource source, boolean validateClass); String getSchemaName(); Map<String, FunctionMethod> getFunctionsByUuid(); FunctionDescriptor addFunction(String schema, FunctionMetadataSource source, FunctionMethod method, boolean system); static FunctionTree getFunctionProcedures(Schema schema); boolean hasFunctionWithName(String name);  }