Skip to content
Switch branches/tags

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

Build Status


Jnario is a framework for writing executable specifications for Java. It provides all the goodness of Xtend while being specifically tailored to writing acceptance and unit tests. It is easy to integrate as Jnario specifications are compiled to plain Java Junit tests. Head over to for more information.

See the release notes for the current version.

Dependencies & Installation

  • Jnario requires at least Eclipse 3.6 with Xtext 2.6 and Xtend 2.6. You can install both from this update site
  • The latest snapshot verion of Jnario can be installed from the following update site


Acceptance Specification

Feature: Addition

  In order to avoid silly mistakes
  As a math idiot
  I want to be told the sum of two numbers
  Scenario: Add two numbers
    Calculator calculator = new Calculator()
    Given I have entered "50" into the calculator
    And I have entered "70" into the calculator
    When I press "add"
    Then the result should be "120" on the screen
      calculator.result => args.first

Unit Specifications

package example

import java.util.Stack
import java.util.EmptyStackException

describe Stack{
  context "empty stack"{
    fact subject.size should be 0
    fact subject.pop throws EmptyStackException
  context "one element"{ 
    before subject.add("element")
    fact subject.size should be 1
    fact "pop decreases size"{
      subject.size => 0 
    fact "pop removes last element"{
      subject.pop => "element"
      subject.contains("element") => true

Setting up a development environment

  • If you haven't got an Eclipse installation, download the Xtend Distribution.
  • Install the latest Xtext 2.6.1 release from: (this is not required if you have downloaded the Xtend distribution).
  • Install the latest Jnario snapshot:
  • Clone the jnario repository:
$ git clone git://
  • Start Eclipse and import all projects from jnario/* into your Eclipse workspace
  • Open the target definition tools/ and click Set as Target Plattform in the upper right corner
  • If you want to change the grammar import org.eclipse.xtend.core and org.eclipse.xtext.xbase into your workspace via import->Plug-in Development->Plug-ins and Fragments with Import As->Projects with source folder. This is necessary for the workflow to find the custom source classes of Xtend and Xbase.


Build with Maven 3 and Tycho. Run the following command in the repository root:

mvn clean install