Mar 9
If you are into Unit Testing and haven't yet heard of MXUnit, I definitely recommend giving it a whirl. Some things that stand out for me, thus far in my evaluation, are the simple, but extensible, assertions, the ecplise plugin, and the debug output. One gotcha that has come up for people when using the eclipse plugin, is that is was designed assuming that the package path to your components resolves directly from your web root. For people who run separate server instances, virtual machines, or develop locally with Apache virtual hosts, this is a show stopper. Luckily, for folks, like myself, who prefer to develop locally with Apache, getting the MXUnit eclipse plugin to work is simply a matter of adding a couple of Alias directives to your vhost.I've taken to using top level domain names to differentiate between local, staging and production web sites. This makes is easy to keep the same sub-domain names if the project calls for it. When developing for a client, I will often provide a demo site at fancybread using the project name as a sub-domain. For this type of development, I would then have two urls, myproject.fancybread.local and myproject.fancybread.com
My virtual host for local dev would run like this.
Now that I've gone through the effort to get the eclpise plugin working and since I'm pretty fresh to Unit Testing altogether, it looks like I'll be working with MXUnit from here on out.
<VirtualHost 127.0.0.1:80>
DocumentRoot "/Users/paul/htdocs/myproject/root"
Alias /mxunit "/Users/paul/htdocs/mxunit"
Alias /myproject/root "/Users/paul/htdocs/myproject/root"
ServerName project.fancybread.local
DirectoryIndex index.cfm
<Directory "/Users/paul/htdocs/myproject/root">
Options All
AllowOverride All
</Directory>
</VirtualHost>
On my Mac, /Users/paul/htdocs is my localhost web root, and the document root for myproject.fancybread.local is /Users/paul/htdocs/myproject/root.
In eclipse, I would then have a project called "myproject".
To use the MXUnit eclipse plugin with a local development setup like mine, you need to use Apache Alias directives to get the plugin to recognize the path to your test cases. In the virtual host above, the first alias above is to the MXUnit framework files, the second is my eclipse project name and the folder therein where my project web root is located.
And within eclipse I set the project properties to direct the test runner url to use my virtual host instead of localhost.
Now that I've gone through the effort to get the eclpise plugin working and since I'm pretty fresh to Unit Testing altogether, it looks like I'll be working with MXUnit from here on out.
Mar 9, 2008 at 7:08 AM Hey Paul, can you explain why the "component root" setting didn't work for you here?
thanks!
Mar 9, 2008 at 1:26 PM Hi Marc,
I tried using the component root as a path to my tests folder, but I could not get it to resolve correctly. This is probably because the proper path to my tests should be "tests", not "myproject.root.tests".
Cheers,
Paul
Mar 9, 2008 at 2:18 PM for your "myproject/root"... is this project just a project for holding tests? i.e. is the contents of that project just test cases (and other stuff). i'm having trouble visualizing this whole thing.
because if it is just a project for tests (that's what I do at work, by the way), then i'm wondering why you couldn't set up the project in eclipse like this:
project home = /users.../myproject/root/
component root = "tests".
so if there's a file /users.../myproject/root/MyTest.cfc
then it would resolve to tests.MyTest
Or is that not how the file system is set up?
Thanks a lot for going through all this Paul. It's either going to result in A) better documentation on our end on how to do this stuff or B) better support in the plugin for your kind of set up.
marc
Mar 9, 2008 at 7:28 PM Hi Marc,
Nope. /Users/../myproject/root is the path to a web root. In that web root, I have a folder for model cfcs, and a folder for tests. For the web site in question, I don't use a class path myproject.root.model.ClassName, I use model.ClassName. And in the tests folder, I use the suffix "Test" for each test case for a given cfc, so it mirrors the model as in tests.ClassNameTest.
Since the plugin expects that the class path should start with "myproject" and follow to the root folder using the Alias "/myproject/root" allows the plugin to resolve to the correct root path which should actually just be "/".
I hope that makes a little more sense. It's probably a bit confusing that I keep my vhost sites under my web root, I should get into the habit of keeping them in a different location.
Mar 9, 2008 at 8:05 PM I think I got it now.
so really, to make this as flexible as it needs to be, it sounds like it'd be nice to be able to select any directory, say a directory named "tests", and specify the component path on that directory. so if you had a directory named "tests", and all components under it would have their path start with "tests", like "tests.business.MyBusinessTest", then conceivably you'd right click on that "tests" directory, get a little popup, and enter "tests". and from then on, components in that directory and subdirectories would use that as their starting point and not the "properties -- component root" or "preferences -- webroot" settings.
Does that sound about right?
Mar 10, 2008 at 12:08 AM That sounds right to me, so long as object instantiation within the tests would resolve similarly as in "model.business.MyBusiness".
Cheers!
Aug 24, 2010 at 3:18 AM <p><a href="http://www.uggbootsretails.com" target="_blank">UGG Argyle Knit</a> features genuine twin-face sheepskin for refreshing comfort. It's one of our tallest boots and looks great all the way up or cuffed down. <a href="http://www.uggbootsretails.com" target="_blank">UGG boots</a> in our Classic Collection feature a soft foam insole covered with genuine sheepskin and have a molded EVA light such as <a href="http://www.uggbootsretails.com" target="_blank">UGG Sundance</a> and <a href="http://www.uggbootsretails.com" target="_blank">UGG Bailey Button</a>, the flexible outsole designed for amazing comfort with every step. Beat the chill in superior style with the <a href="http://www.uggbootsretails.com" target="_blank">UGG Ultra Tall</a>. The <a href="http://www.uggbootsretails.com" target="_blank">Bailey Button 1873</a> of light and flexible outsole along with a suede heel guard provides durable wear all season long. Detailed with three oversized wood buttons, this style can be styled up and buttoned, slouched and slightly unbuttoned, or completely cuffed. <a href="http://www.uggbootsretails.com" target="_blank">UGG Ultra Short</a> is also a good choice for people to refuge from the cold.Just buy one of the ugg boots for your family and yourself, it’s really a good gift both for you famlily and you.Action is better than thinking in heart.</p>