April 21, 2007
I've posted the facade CFC that lets you use
cfcUnit with the CFUnit plugin for CFEclipse to the 'SOFTWARE' pod on my blog.
First, if you haven't already done so, install cfcUnit.
Second, if you haven't already done so, you need to install the new CFUnit plugin. In Eclipse, Help > Software Updates > Find and Install... and search for new features on the CFEclipse update site. You should see a CFUnit 1.0.4 plugin. Install that and restart your workspace.
Third, download my facade CFC and put it somewhere that is web accessible (I put mine in my webroot).
Then configure the CFUnit plugin to use that location, under Window > Preferences > CFEclipse > CFUnit. Specify the URL to the directory containing the CFEclipseFacade.cfc you just downloaded.
Finally, open the CFUnit view (Window > Show View > Other and select it from the CFML section).
Now you can enter a CFC path - or search for CFCs - and run them directly in Eclipse.
Comments
I'm not sure if I prefer this or the automated testing with an Ant build. I like the output from this method, but I like the automation of the Ant task.
Posted By Andrew Powell / Posted At
4/23/07 8:29 AM
Hey Sean, I could very well have something wrong on my end, but I didn't get any feedback in the CFUnit tab in Eclipse. The test runs in CFCUnit with one intentional failure. Entering the same path to the same cfc doesn't seem to do anything.
I have never used CFUnit or the plugin before. What sort of feedback should I expect? Does the version of CFC unit matter? It has probably been a while since I updated it.
Thanks,
Posted By Matt Williams / Posted At
4/23/07 9:31 AM
@Andrew, I think both have their place. I like running full test suites via ant but I also like being able to quickly run a single test within Eclipse as I am working on a specific test or class. Right now the facade for the CFUnit plugin does not handle test suite classes, only test case classes. That's something I need to add. I also need to make it smarter about finding CFCs.
@Matt, hard to say what's wrong. If it was running correctly, you'd see green, orange or red output and the number of tests run, failed, error'd out. Did you set the CFUnit URL to the correct place? It should be the URL of the CFEclipseFacade.cfc but without the actual filename (so it's the URL of a directory). The CFC path you enter in the test panel should be the dot-separated name of the CFC you want to run and it must be a TestCase. Try org.cfcunit.samples.SimpleTest (a test provided with cfcUnit). I get 3 tests run, 2 failures, 1 error and in the tree view below I get "org.cfcunit.samples.SimpleTest (0/2/1)" in red and if I expand that node, I get "testEquals (Failure)" and "testAdd (Failure)" both in orange and then "testDivideByZero (Error)" in red.
Posted By Sean Corfield / Posted At
4/23/07 2:22 PM
Thanks Sean, I had fat fingered the url for the facade. I'm getting the same results on the SimpleTest.
Posted By Matt Williams / Posted At
4/23/07 2:56 PM
Doesnt work for me either.
Installed the facade, its browseable from a browser so thats not a problem. Have added a mapping for org to load CFCUnit. So what else could be wrong?
Also been getting a lot of view errors, when closing the view and readding the view.
Posted By Andrew Scott / Posted At
4/25/07 11:22 PM
@Andrew, hard to tell from that limited information. Have you ensured that you can run the cfcUnit test harness and get the correct results? Are you sure you have the right URL in the CFUnit preferences? Are you sure you entered the correct CFC path in the CFUnit plugin panel?
It works for me and it works for Matt, once he got the correct URL configured. Catch me on IM and I'll walk you through it with Acrobat Connect if you want...
Posted By Sean Corfield / Posted At
4/26/07 12:58 AM
@Sean - I eventually got it to work. It must have been working all the time. Just not with test suites, well at least not mine anyway.
Posted By Andrew Scott / Posted At
6/19/07 2:12 AM
@Andrew, cool, glad to hear it! Certainly the first version I posted did not support test suites. Download it again and see if the updated version helps. I remember adding suite support at some point... I just can't remember when, sorry :(
Posted By Sean Corfield / Posted At
6/19/07 2:27 AM
Post Your Comments
Hosting provided by