[teiid-commits] teiid SVN: r4490 - trunk/engine/src/test/java/org/teiid/query/function.

teiid-commits at lists.jboss.org teiid-commits at lists.jboss.org
Sat Sep 29 15:14:01 EDT 2012


Author: shawkins
Date: 2012-09-29 15:14:01 -0400 (Sat, 29 Sep 2012)
New Revision: 4490

Modified:
   trunk/engine/src/test/java/org/teiid/query/function/TestFunctionTree.java
Log:
TEIID-2233 adding a functiontree test

Modified: trunk/engine/src/test/java/org/teiid/query/function/TestFunctionTree.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/function/TestFunctionTree.java	2012-09-29 19:08:49 UTC (rev 4489)
+++ trunk/engine/src/test/java/org/teiid/query/function/TestFunctionTree.java	2012-09-29 19:14:01 UTC (rev 4490)
@@ -77,7 +77,7 @@
     
     @Test public void testLoadErrors() {
     	FunctionMethod method = new FunctionMethod(
-    			"dummy", null, null, PushDown.CAN_PUSHDOWN, "nonexistentClass", "noMethod",  //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ 
+    			"dummy", null, null, PushDown.CAN_PUSHDOWN, null, "noMethod",  //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ 
 	 	    	new ArrayList<FunctionParameter>(0), 
 	 	    	new FunctionParameter("output", DataTypeManager.DefaultDataTypes.STRING), false, Determinism.DETERMINISTIC); //$NON-NLS-1$
     	
@@ -89,6 +89,16 @@
     		new FunctionLibrary(RealMetadataFactory.SFM.getSystemFunctions(), new FunctionTree("foo", new UDFSource(Arrays.asList(method)), true));
     		fail();
     	} catch (TeiidRuntimeException e) {
+    		assertEquals("TEIID31123 Could not load non-FOREIGN UDF \"dummy\", since both invocation class and invocation method are required.", e.getMessage());
+    	}
+    	
+    	method.setInvocationClass("nonexistantClass");
+    	
+    	//should fail, no class
+    	try {
+    		new FunctionLibrary(RealMetadataFactory.SFM.getSystemFunctions(), new FunctionTree("foo", new UDFSource(Arrays.asList(method)), true));
+    		fail();
+    	} catch (TeiidRuntimeException e) {
     		
     	}
     	



More information about the teiid-commits mailing list