Issue 7: framework attempts to test private and package functions
Status:  Fixed
Owner:
Closed:  Aug 2007
Cc:
Project Member Reported by marc.es...@gmail.com, Aug 6, 2007
What steps will reproduce the problem?
1. run this:
http://localhost:8501/mxunit/framework/tests/RemoteFacadeTest.cfc?method=runtestremote


What is the expected output? What do you see instead?

you get two failures. example: 

Application
The testThatIsPackage package method in the
C:\Inetpub\wwwroot\mxunit\framework\tests\RemoteFacadeTest.cfc component
cannot be accessed from C:\Inetpub\wwwroot\mxunit\framework\TestSuite.cfc

Instead, i'd expect that since the function is marked package or private,
mxunit wouldn't attempt to run it at all.


Please use labels and text to provide additional information.


Aug 6, 2007
Project Member #1 marc.es...@gmail.com
i've made a new cfc, utils.ComponentUtils. This cfc has a method for getting the
"runnable" methods in a given test component. I'm using it in the RemoteFacade. I'm
thinking that this should be used inside the test runner for getting the list of
methods to run for a component. This way, the remote facade and the framework itself
use the same logic for determining what functions to run
Cc: virtix
Aug 6, 2007
Project Member #2 marc.es...@gmail.com
scratch the first URL. try this one instead:

http://localhost:8501/mxunit/framework/tests/internal/DoubleMethodTest.cfc?method=runtestremote
Aug 6, 2007
Project Member #3 virtix
Glad to see the ball's rolling! I'll work on this today.
Status: Accepted
Aug 6, 2007
Project Member #4 marc.es...@gmail.com
i'm working on testsuite right now, specifically "addAll". I saw you had a note to
convert it to use getMetadata, so I've done that. in addition, i'm fetching the
methods from the ComponentUtils.getRunnableMethods() function.

what this did was turn the structure's array into just an array of strings instead of
an array of xml nodes, so i monkeyed with some other code to deal with that. i don't
know if i found all affected places yet, though.

now, i'm running into a problem when i run the generated test suite, specifically in
the TestCaseTest cfc. it's spawning hundreds of requests or something, so something
about the addAll implementation is now causing problems. I'm going to try to track it
down. possibly it's just a problem with the TestCaseTest itself. i'll keep you posted.
Aug 6, 2007
Project Member #5 marc.es...@gmail.com
ah, fixed. TestCaseTest runs "runTestRemote" as a test, and it runs itself. so I
think what was happening is that it was getting into an endless loop of runTestRemote
running testCaseTest, which in turn ran runTestRemote, ad infinitum.
Aug 6, 2007
Project Member #6 virtix
Nice work! Don't you just love it when you recurse your machine to crawl?
Aug 6, 2007
Project Member #7 marc.es...@gmail.com
well, the main problem is that it really slows up the porn and mp3 downloads here at
work when that happens.
Aug 6, 2007
Project Member #8 marc.es...@gmail.com
fixed.
http://localhost:8501/mxunit/framework/tests/internal/DoubleMethodTest.cfc?method=runtestremote
now runs only two methods, not the package or private.

fixed by modifying TestSuite.addAll() to use ComponentUtils.getRunnableMethods()
Status: Fixed