Git Product home page Git Product logo

cornipickle's Introduction

Cornipickle: a runtime monitor for layout constraints

Travis SonarQube Coverage

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.

Table of Contents {#toc}

Compiling and Installing Cornipickle {#install}

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

Installing dependencies

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).

Compiling

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).

Testing

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.

Command-line Usage {#cli}

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.

Built-in Examples

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.

Status page

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.

About the author {#about}

Cornipickle was written by Sylvain Hallé, associate professor at Université du Québec à Chicoutimi, Canada.

cornipickle's People

Contributors

chafdev avatar colmagh avatar faterou avatar gbastien1 avatar paullesur avatar sylvainhalle avatar tripeace avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.