Cornichon is a declarative language that can express desirable properties of a web application as a set of human-readable assertions on the page’s HTML and CSS data. Cornipickle, an automated testing tool that can verify Cornichon properties on-the-fly as a user interacts with an application.
First make sure you have the following installed:
- The Java Development Kit (JDK) to compile. Cornipickle was developed and tested on version 7 of the JDK, but it is probably safe to use either version 6 or 8.
- Ant to automate the compilation and build process
Download the sources for Cornipickle from Bitbucket or clone the repository using Git:
[email protected]:sylvainhalle/cornipickle.git
The project requires the following libraries to be present in the system:
- The Apache Commons CLI to handle command-line parameters (tested with version 1.3)
- The json-lif library for fast JSON parsing (tested with version 1.2)
- The Azrael library for serialization of Java objects. (tested with version 0.3-alpha)
- The Bullwinkle parser, an on-the-fly parser for BNF grammars. (tested with version 1.2)
- The Jerrydog server for basic HTTP server capabilities. (tested with version 0.1-alpha)
Using Ant, you can automatically download any libraries missing from your system by typing:
ant download-deps
This will put the missing JAR files in the deps
folder in the project's
root. These libraries should then be put somewhere in the classpath, such as
in Java's extension folder (don't leave them there, it won't work). You can
do that by typing (with administrator rights):
ant install-deps
or by putting them manually in the extension folder. Type ant init
and it
will print out what that folder is for your system.
Do not create subfolders there (i.e. put the archive directly in that folder).
Compile the sources by simply typing:
ant
This will produce a file called Cornipickle.jar
in the folder. This file
is runnable and stand-alone, or can be used as a library, so it can be moved
around to the location of your choice.
In addition, the script generates in the doc
folder the Javadoc
documentation for using Cornipickle. This documentation is also embedded in
the JAR file. To show documentation in Eclipse, right-click on the jar,
click "Properties", then fill the Javadoc location (which is the JAR
itself).
Cornipickle can test itself by running:
ant test
Unit tests are run with jUnit; a detailed report of
these tests in HTML format is availble in the folder tests/junit
, which
is automatically created. Code coverage is also computed with
JaCoCo; a detailed report is available
in the folder tests/coverage
.
Cornipickle works as a server. You start it on the command line with:
java -jar Cornipickle.jar [options] [file1 [file2 ...]]
where file1
, file2
, etc. are optional filenames containing Cornipickle
specifications that the server can pre-load. Available options are:
-h
, --help
: Display command line usage
-p
,--port <x>
: Listen on port x (default: 10101)
-s
,--servername <x>
: Set server name or IP address x (default: localhost)
--serve-as <path>
: Serve local folder as remote folder . For example, with the default
settings, when launching Cornipickle with --serve-as myfolder/
(note the
trailing slash), the URL http://localhost:10101/myfolder/foo.bar
will
refer to foo.bar
from the local folder where Cornipickle is launched.
This also works for nested folders.
Cornipickle contains a few examples. Using the default settings, you can try these examples by starting the server and visiting http://localhost:10101/examples/index.html in your browser.
You can have more detailed status on the specifications that Cornipickle is watching through a simple web interface. Using the default settings, you can try these examples by starting the server and visiting http://localhost:10101/status in your browser. Refresh the page to get updated info.
Cornipickle was written by Sylvain Hallé, associate professor at Université du Québec à Chicoutimi, Canada.