CurlUnit 1.0 @  SourceForge Logo



09/14/2001

CurlUnit is a simple framework to write repeatable tests in the Curl content language as executed by the Surge plug-in.  CurlUnit is an instance of the xUnit architecture commonly used as a testing framework within the Extreme Programming methodology (XP) methodology. CurlUnit is a derivative work of JUnit 3.7 porting the xUnit core and most of its tests, the simple samples, the Money examples and the cookbook to Curl. Like JUnit before it CurlUnit is Open Source Software, released under the IBM Public License  and hosted on SourceForge .

Try it ! (you must have the Suge plugin from Curl.com  installed. See Installation  for more details about running CurlUnit direct from the web site.).

Curl, XP & CurlUnit!   Curl is a content language for the creation of web applications. It scales gracefully from simple static pages to complex applications all within the same programming model.

Curl is ideal for Extreme Programming. It is a dynamic language with first class procedures, a well defined package structure, the capability to load dynamically from any location on the web and a GUI toolkit supporting a declarative style of UI development not dissimilar to Tkl.

CurlUnit demonstrates several of these features, for example loading an applet with a simple GUI off the web, then having that applet dynamically load and run code from another location. The code loaded refers to other code packages on the web. These are transparently loaded if and only if required.

To learn more about Curl visit Curl.com  the corporate home of Curl, curlbreaker.com a journal Curl development, includes a mailing list, and curlexamples.com a site with lots of executable examples complete with source code.

Contents of the Release

index.html this file
licence.html copy of the text of the IBM Public License
testrunner.curl an applet that launches the UI allowing tests to be run
source the curl source code of CurlUnit
    tests the CurlUnit tests of CurlUnit itself
samples sample tests
doc

documentation and articles

Installation

When installing CurlUnit you have the choice of running it directly from the CurlUnit web site or installing it in your local environment. Running CurlUnit directly from the CurlUnit web site minimizes the hassle. The disadvantage is that in order to exercise your own test code you will need to make the CurlUnit applet a privileged applet.  Either way a pre-requisit is that you install the Surge plugin or the SugeLab IDE from Curl.com .

Web Installation

It is possible to run CurlUnit directly from this site without installing anything on your local hard drive. Do this by invoking the TestRunner . If you have the Surge plug-in or IDE installed the SimpleTestRunner should launch otherwise you will be prompted to install the Surge plug-in from Curl.com. Before running any tests present in your environment, as opposed to the ones provided on the CurlUnit site, you will need to make curlunit.sourceforge.net a privilaged location. See the documentation for Surge on how to do this. Now it should be possible to verify the installation as described under Verify Installation .

If you choose to run from the CurlUnit site your test packages should import the CURLUNIT.FRAMEWORK package from this site.

Local Installation

Below are the installation steps for installing CurlUnit to your local hard drive and running it from there:
  1. unzip the curlunit.zip file

If you choose to run from your own installation of CurlUnit page your test packages should import the CURLUNIT.FRAMEWORK package from your site. 

Verify Installation

  1. Test the installation by loading path to CurlUnit /testrunner.curl and using the TestRunner tool to run the tests that come with this release. All the tests should pass OK with the exception of a couple of tests in ./samples/sampletests.curl which are designed to show the outcome of failure.
  2. Copy the file .samples/mypackage.curl to your local drive and attempt to execute the test file://///mypackage.curl#MYPACKAGE.MyTest . This should also run. If not ensure the curlunit.sourceforge.net is a privilaged location and restart the TestRunner.

 

Getting Started

To get started with unit testing and CurlUnit read the the CurlUnit Cookbook. This shows how to get started with with CurlUnit. You find additional samples in the /samples/sampletests.curl#CURLUNIT.SAMPLETESTS package:

For a more extensive example see /samples/money/money.curl and /samples/money/tests/money.tests.curl. These implement a multi currency money framework and the test cases for it.

For a more sophisticated introduction to xUnit style testing and XP programming see the Java Report article: Test Infected - Programmers Love Writing Tests . This article  demonstrates the development process with xUnit in the context of the money example.

To do

Missing core function:

Enhancements, extensions and niceties

Ideas for the future

Documentation

CurlUnit Documentation

CurlUnit Cookbook
    A cookbook for implementing tests with CurlUnit.

Related Documentation

Test Infected - Programmers Love Writing Tests 
    Java - An article demonstrating the development process with JUnit.
JUnit - A cooks tour 
    Java - An article exploring the design of JUnit on which CurlUnit is based.

Trade Marks

Curl, the Curl logo, Surge, Surge Lab, Gentle Slope, Get Curled!, and Curl Connected are trademarks of the Curl Corporation.