Project update

It's been for ever and a day, since I have done any commits to this project, but prompted by Janet's comments I have made a handful of commits to the repository.

  1. cfUnit is now supported
  2. A fix for cfmx 6.1 and recursive directory lookups
  3. The code can now handle missing tearDown methods in existing test cfcs.

I have also tried to simplify the config.xml file a little and here's what the default looks like:

<stubbie>

   <config>
      <appName value="myMapping" /><!-- the name of your app, can be the mapping name as set up in cfadmin -->
      <appPath value="/my/full/path/to/the code/" /><!--full path to the app -->
      <packageRoot value="" /><!-- if you have a mapping for your app's cfcs, e.g. com.mydomain, specify it here (if you have specified an app name the result will be com.mydomain.myapp) -->
      <saveTestFilesTo value="" /><!-- Not implemented yet, optional storage location for the test stubs -->
      <unitTestFramework value="cfcUnit"/><!-- cfcUnit/cfUnit -->
      <coldSpring use="false" path="config/cs.xml"/><!-- (working on it) whether or not to use CS and if so where is the cs config file in relation to the app path -->
   </config>
   
</stubbie>

But a concrete example usually works best, so:

<stubbie>

   <config>
      <appName value="art" /><!-- the name of your app, can be the mapping name as set up in cfadmin -->
      <appPath value="/Users/gregstewart/Sites/Client X sites/Fusebox/ART2/" /><!--full path to the app -->
      <packageRoot value="" /><!-- if you have a mapping for your app's cfcs, e.g. com.mydomain, specify it here (if you have specified an app name the result will be com.mydomain.myapp) -->
      <saveTestFilesTo value="" /><!-- Not implemented yet, optional storage location for the test stubs -->
      <unitTestFramework value="cfcUnit"/><!-- cfcUnit/cfUnit -->
      <coldSpring use="false" path="config/cs.xml"/><!-- (working on it) whether or not to use CS and if so where is the cs config file in relation to the app path -->
   </config>
   
</stubbie>

appName : This now refers to a cf mapping in the administrator for my project, in this case art, however if you are using a package approach (with say a value of "com.domain"), then this value would simply be appended to the packageRoot (e.g. com.domain.art)

appPath : This is now the full path to the application, e.g. on my local machine /Users/gregstewart/Sites/Client X sites/Fusebox/ART2/

packageRoot : Hasn't changed

saveTestFilesTo : Hasn't changed

unitTestFramework : Now supports cfUnit.

coldSpring : Something working on, i.e. use ColdSpring to generate mock objects. Could be ages before it sees the light of day, if my past track record is anything to go by.

Thoughts and suggestions are still most welcome!

More unit testing generator projects

Finally managed to catch up on a few blog posts this week after another project deadline has passed and I came across two more projects that have started to generate unit tests for you:

Both projects do a hell of a lot more than just create test objects though. Definitely worth checking out.

Download Stubbie

Version 0.1 is available for download. I'd like to call this the "I am working release, but it's all a little messy" release. There are a ton of improvements to be made and still a few features I'd like to add, but it's working and figured this was a good time to put the code out there and get some feedback.

Feel free to report any issues, feedback and suggestions.

Welcome to Stubbie project blog

I hope that people will find this project useful in their day to day development.

So what is Stubbie? The short and sweet is: it creates a set of test stub objects to be used in your unit tests based on your projects CFCs.

Slightly more protracted: Stubbie was inspired by a feature in Rails that creates stub test objects based on objects found in your application.

You can run Stubbie standalone or as a plugin (there is a Mach-ii plugin available) and on execution it will recursively examine your projects code for CFCs and generate generic test objects for you, as well as a Test Suite. No more excuses to not use Unit Testing.

It currently supports both CFUnit and CFCUnit.

It's all a bit slap dash right now, but I hope to tidy things up in the near future (and actually upload some code for you to download). Of course feedback, critiques and suggestions are always welcome.

BlogCFC was created by Raymond Camden. This blog is running version 5.5.006. | Protected by Akismet | Blog with WordPress