Xpect is a unit- and integration-testing framework that stores test data in any kind of text files and is based on JUnit.
The focus of Xpect is on testing Xtext languages and supporting the process of designing Xtext languages.
Read a longer introduction in my blog
Install Xpect via the update site
Xpect is published under the
Eclipse Public License (EPL)
If you find bugs, please
report them using the Github bugtracker
The build is hosted by TypeFox
Professional Support is available via TypeFox GmbH
If you have suggestions, fork the project on Github and send me a pull request :)
If you have questions, send me an email to moritz dot eysholdt at typefox dot io
View the Project on GitHub eclipse/Xpect
Hosted on GitHub Pages — Theme by orderedlist
package mytest; import org.junit.runner.RunWith; import org.xpect.runner.XpectRunner; import org.xpect.xtext.lib.tests.XtextTests; @RunWith(XpectRunner.class) public class MyXtextTests extends XtextTests { }The class XtextTests is a test suite with predefined tests that ships with Xpect.
/* XPECT_SETUP mytest.MyXtextTests END_SETUP */ package pkg1 { entity MyEntity1 { // int should be the java primitive // XPECT linkedName at int --> int id:int // String should be from java.lang // XPECT linkedName at String --> java.lang.String name:String // besides "int", we can reference... and we can not reference foooobar // XPECT scope at int --> int, String, java.lang.String, boolean, !foooobar, ... id:int // XPECT errors --> "Couldn't resolve reference to JvmType 'integer'." at "integer" id:integer } }