Menu

#3 Making a CFCUnit API

open
cfcUnit (3)
5
2005-01-06
2005-01-06
No

Goal: Creating some method of integrating CFCUnit with
other applications.

An example could be Ant integration, running all the
CFCUnit tests for the project and only deploying if
they succeed. The easiest way I can see of doing this
would be to do a GET task [1] or some Anteater task [2]
on the CFCUnit URL and parse out the results.

Another more complex example would be an Eclipse plugin
(haven't thought this through very well yet) or a Flash
projector file running on the desktop (Paul's idea).

I guess we could approach this using REST or RPC/SOAP
(or both?). To me REST seems like the easiest to
implement & most flexible. SOAP is probably better from
the "play nicely and easily with the MM product suite"
perspective.

Option 1 - (the easy way) HTTP Headers:
If some HTTP headers were added to both the existing
runners it at least allow applications to easy see
whether the we had any failures or errors. For example:

X-CFCUnit-StatusCode: 200
X-CFCUnit-StatusText: Tests run: 31, Failures: 0,
Errors: 0

OR:

X-CFCUnit-StatusCode: 500
X-CFCUnit-StatusText: Tests run: 31, Failures: 4,
Errors: 1

Option 2 - XML Output:
If we also had an XML runner we could go a step further
and provide more verbose output. Maybe RSS or Atom [3]
could be hijacked for the purpose? Maybe there are more
appropriate formats? Regardless the idea would be to
provide full information on each test in each suite.

Option 3 - SOAP Interface:
Provide a simple web service interface such as
cfcunit.runTest(testClassName).

[1] http://ant.apache.org/manual/CoreTasks/get.html
[2] http://aft.sourceforge.net/
[3] http://www.intertwingly.net/wiki/pie/FrontPage

Discussion


Log in to post a comment.

MongoDB Logo MongoDB