Using the Eclipse MXUnit Plugin with Apache Virtual Hosts Revisited
MXUnit , cfeclipse , Apache Add commentsIn a previous post on the topic of using the MXUnit eclipse plugin with virtual hosts, I described how I setup my eclipse project and Apache virtual host for testing. Although that setup worked, I would get periodic errors that necessitated disabling and re-enabling the MXUnit plugin. Until recently, I was still running eclipse 3.2, so when I got the opportunity to configure a new machine from the ground up, I decided to go with a fresh install of the latest Eclipse (3.4) and essential plugins, CFEclipse (1.3.1.6), Subclipse (1.4.5) and MXUnit (1.0.7).
One of the pleasant side benefits of moving to the latest MXUnit plugin release is that I now do not need to keep my projects in the same directory as MXUnit to get the eclipse plugin to play nice with vhosts. Instead, all I have to do is specify the component root in my project's MXUnit properties along with a matching Apache Alias so that the project name, component path and alias are alike. Here's how I would set things up for a project called "myproject".
UPDATE: With the release of the 1.1 version of the MXUnit eclipse plugin, matching the component path to the project name and apache alias is no longer required. The screen grab of the MXUnit properties below reflects this change.
Here's the vhost declaration.
<VirtualHost 127.0.0.1:80>
DocumentRoot "/Users/paul/Sites/myproject/webroot"
Alias /mxunit "/Library/WebServer/Documents/mxunit"
Alias /config "/Users/paul/Sites/myproject/config"
Alias /model "/Users/paul/Sites/myproject/model"
Alias /tests "/Users/paul/Sites/myproject/tests"
Alias /myproject "/Users/paul/Sites/myproject"
ServerName myproject.fancybread.local
DirectoryIndex index.cfm
<Directory "/Users/paul/Sites/myproject/webroot">
Options +Indexes FollowSymLinks +ExecCGI
AllowOverride AuthConfig FileInfo
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
Here is the MXUnit properties.
And finally, the eclipse project.
Using the alias ans component path to direct the MXUnit plugin to the tests is a big help, since I prefer to keep my projects in a different folder from the default web root.
Recent Comments