Ant task and directory

1 view
Skip to first unread message

Remy Becher

unread,
May 7, 2008, 8:05:05 AM5/7/08
to mxunit
Please forgive me if this has been discussed before, but I can't find
anything in either the archived messages or the bug tracker. I had to
make a change to the HttpAntRunner.cfc to get my Ant script to work,
so either I found a bug or I'm doing something wrong.

Whenever I use the <directory> element to specify where to fnd the
tests to run, MXUnit can't find my tests because it does not use the
value passed in via the componentPath attribute. As a result, I get an
exception in the getTests method in DirectoryTestSuite.cfc, because
the path used to instantiate the test is invalid, it actually starts
with a '.'.

If I however modify HttpAntRunner.cfc and add componentPath to the
method arguments specified while creating a new DirectoryTestSuite
(method run, line 27, "results = createObject() etc"), it all works as
expected.

One thing that might contribute to this is the way I organise my
projects. I have all my projects in a directory like 'c:/sites/xxx.
192.com/' and use a mapping '/xxx/192/com/' to point to that folder.My
tests all sit in 'c:/sites/xxx.192.com/tests/', which I pass into the
directoy element as the path, and I set the component path to 'xxx.
192.com.tests'

Any suggestions or should I file a bug?

Thanks,

Remy




billy

unread,
May 7, 2008, 11:40:02 AM5/7/08
to mxunit
Hi Remy,

Thanks for posting. What version of mxunit are you using? I was not
able to easily reproduce this and when I look at line 27 in
HttpAntRunner I see this:

results =
createObject("component","DirectoryTestSuite").run(directory=arguments.value,
componentPath=arguments.componentPath, recurse=arguments.recurse,
excludes=arguments.excludes);

Not sure if this is what you are seeing ... let me know. Also, can
you post your ant script?

thanks,
bill[y]

billy

unread,
May 7, 2008, 12:22:50 PM5/7/08
to mxunit
Remy,

One other quick question: Do your tests follow the naming convention:
[componentname]Test.cfc ?

best,
bill[y]

Remy Becher

unread,
May 8, 2008, 10:32:15 AM5/8/08
to mxu...@googlegroups.com

Hiya,

I was indeed using an older version...my apologies.
Its working as expected now.

Regards,

Remy Becher

This transmission is strictly confidential, possibly legally privileged, and intended solely for the addressee. Any views or opinions expressed within it are those of the author and do not necessarily represent those of 192.com, i-CD Publishing (UK) Ltd or any of it's subsidiary companies. If you are not the intended recipient then you must not disclose, copy or take any action in reliance of this transmission. If you have received this transmission in error, please notify the sender as soon as possible. No employee or agent is authorised to conclude any binding agreement on behalf of i-CD Publishing (UK) Ltd with another party by email without express written confirmation by an authorised employee of the Company. http://www.192.com (Tel: 08000 192 192).
i-CD Publishing (UK) Ltd is incorporated in England and Wales, company number 3148549, VAT No. GB 673128728.

Reply all
Reply to author
Forward
0 new messages