Issue with the Generator: Inherited CFC without any methods throw error

3 views
Skip to first unread message

Indy Nagpal

unread,
May 21, 2008, 6:27:56 PM5/21/08
to mxunit
Hi

When you try and use the Generator to create tests for a CFC that
inherits from another CFC, but does not have any method of its own,
you get an error like:

Element FUNCTIONS is undefined in MD.

The error occurred in /Users/indy/Development/ColdFusion/
jboss-4.2.2.GA/server/cf8/deploy/cfusion.ear/cfusion.war/mxunit/
generator/generate.cfm: line 52

50 : <root>
51 : <component
path="#listDeleteAt(md.name,listLen(md.name,"."),".")#"
name="#listLast(md.name,".")#" fullname="#md.name#">
52 : <cfloop index="method" from="1" to="#arrayLen(md.functions)#">
53 : <method name="#md.functions[method].name#"
54 : <cfif structKeyExists(md.functions[method],"access")>


This might be relevant:
http://groups.google.fr/group/coldspring-users/browse_thread/thread/c78bc61b0079eede

I quite like the approach taken by the CFC Stub Generator (http://
www.briankotek.com/blog/index.cfm/2006/7/26/CFC-and-CFUnit-Stub-Generator).
It is quite simple and rather than introspecting CFCs you can simply
specify the which CFCs (and functions) to generate the CFC and test
stubs for.

Indy

Mike Rankin

unread,
May 22, 2008, 1:44:39 AM5/22/08
to mxunit
Thanks for finding that. I'll make a change later today to clear that
up for the next release.

On May 21, 6:27 pm, Indy Nagpal <i...@shadocms.com> wrote:
> Hi
>
> When you try and use the Generator to create tests for a CFC that
> inherits from another CFC, but does not have any method of its own,
> you get an error like:
>
> Element FUNCTIONS is undefined in MD.
>
> The error occurred in /Users/indy/Development/ColdFusion/
> jboss-4.2.2.GA/server/cf8/deploy/cfusion.ear/cfusion.war/mxunit/
> generator/generate.cfm: line 52
>
> 50 : <root>
> 51 : <component
> path="#listDeleteAt(md.name,listLen(md.name,"."),".")#"
> name="#listLast(md.name,".")#" fullname="#md.name#">
> 52 : <cfloop index="method" from="1" to="#arrayLen(md.functions)#">
> 53 : <method name="#md.functions[method].name#"
> 54 : <cfif structKeyExists(md.functions[method],"access")>
>
> This might be relevant:http://groups.google.fr/group/coldspring-users/browse_thread/thread/c...
>
> I quite like the approach taken by the CFC Stub Generator (http://www.briankotek.com/blog/index.cfm/2006/7/26/CFC-and-CFUnit-Stub-Gener...).
Reply all
Reply to author
Forward
0 new messages