The Future of Xtext

by Sven Efftinge ( at May 28, 2015 01:20 PM

this is a write up of a presentation I gave together with Sebastian last week at XtextCON. It is about our future plans of Xtext. But before we talk about the future I would like to start with a quick summary of ...

The Status Quo

Xtext is in development for seven years now. We have always been between 6 and 10 active developers, currently being 9. With a total LOC of 5.747.523 our code base is huge. However you have to take into account that we not only check in generated code (it sometimes helps us to spot problems) but have many, many tests. All in all there is 27.539 usages of &commatTest which are executed in many different scenarios and against different platforms. All together we count over 180k unit tests.

This kind of test coverage together with a passion for code quality is key keep a software system maintainable and extensible after years.

Xtext 2.8.x

In the coming week we will release 2.8.3, a bugfix version of the 2.8.x stream that introduced many cool new features. With version 2.8.3 we have fixed over 120 bugs and improved quality furthermore. This is also the release that will be part of Eclipse Mars.

Error Reporting

Not sure if you have noticed, but with Mars also comes the new error reporting tool, an initiative by the developers behind Eclipse Code Recommenders. It basically asks you to automatically send in error reports for all kinds of exceptions and UI freezes you experience when working with Eclipse. Although it is not yet included in the Luna SR2 packages we already got many helpful tickets through that feature from the milestone builds. Please, turn this feature on and provide as much information as possible. It really helps!

What about future releases?

To figure our what the community demands, we did a survey. Thanks for everyone who attended! The survey was targeted at Xtext users, and besides some more demographic questions, the most important question was:

"What should be changed or improved?"

The answers included a lot of valuable feedback. Most of them could be assigned to one of the following four themes. I put some of the original answers and comments from the survey on the slides.

People asked for more documentation, specifically around Xbase and in the code (i.e. JavaDoc). Also many asked for an overview chapter where a bird's eye view of the architecture and life cycles is explained. We agree that these parts should be added and enhanced and have put it on our agenda. Fortunately the documentation is now written in markdown and change is only one pull-request away (for everyone ;-)).

Performance has always been high on our list and for every release we spend a lot of time on profiling and optimization. If you suffer from performance problems, first make sure, that you are on the latest version. Performance makes huge steps from release to release.

Here is some of the improvements we have been working on lately:

  • Do nothing in UI thread - computations of any UI services have been moved to background jobs, such that nothing blocks the user.
  • Cancel everything - all UI services, such as outline, mark occurences, semantic highlighting, etc. get canceled on change (i.e. as you type). Since the state is outdated we can stop waste CPU cycles on it.
  • Cancelable builds - also incremental builds now get automatically canceled, when another change comes in.
  • Storaged Resources - Xtext can write fully resolved and computed resources to disk in a binary format, so it can later be loaded again quickly
  • Incremental standalone compilation (new in 2.9) - The eclipse builder has always been incremental. Now Xtext also has an incremental standalone compiler, that together with a running demon ensures super slick incremental compilation of changed files.

Of course, improving performance is never done!

Continuous integration with Xtext and Xtext-based languages has traditionally been a bit of a pain. This is mostly because we started out as an Eclipse only project, and building Eclipse plug-ins is "different". The Xtext project has had a continuous integration build for years, but our build infrastructure is not exactly simple. Targeting different platforms requires a bit of a zoo of build technologies on our side, which should not be necessary for clients. Since almost two years now, there is Maven support, including a plug-in to run your language in an arbitrary maven build. The same has been added for Gradle as well.

The next step is to allow for different project layouts, i.e. Eclipse vs. Maven/Gradle layout and allow for developing Xtext languages without any kind of Eclipse dependency. Which brings us to the last theme.

Xtext is a language framework that has significantly lowered the barrier to develop programming languages and external domain-specific languages. One of the sweet things is the cool Eclipse support you get. However even if you only need a compiler for a language without any Eclipse tooling the Xtext framework provides you with rich abstractions for scoping, indexing, incremental compilation and more. With the next release (version 2.9) it should be possible to create a runtime project only, without any Eclipse dependencies and without the necessity to deal with OSGi or eclipse plug-in mechanism. Our goal is to allow for vanilla Java projects with a normal Gradle or Maven build.

For the IDE part, we are working on supporting web editors and IntelliJ IDEA specifically at the moment. But maybe even more important in the long run, is the general extraction of the IDE services from Eclipse dependencies, such that they can be reused on other platforms easily. Tom Schindl for instance already uses Xtext in JavaFX applications and we are in contact with a group that has ported Xtext to Visual Studio through IKVM.

Just to be clear: The Eclipse support stays important and will be a first class citizen for the Xtext framework in the future, too!


As you can see, the direction is a mixture of improving quality and performance, making accessibility easier but also reaching out to new platforms. I hope you find this direction as exciting as we do. We plan to release Xtext 2.9 in the last quarter of 2015. In case you want to try the current state of the web or intelliJ IDEA support, go ahead and download the recently released beta version. More betas will be released in the coming weeks / months.
So long, have fun and remember your feedback is helpful and very welcome!

by Sven Efftinge ( at May 28, 2015 01:20 PM

Implementing WebWorkers with J2V8

by Ian Bull at May 28, 2015 12:33 AM

J2V8 is a set of Java bindings for Google’s popular JavaScript engine, V8. As we push towards J2V8 3.0, the focus has been on multithread support. We’ve already discussed how to use multiple threads with V8. In this tutorial we will show you some new API coming in 3.0, and how this can be used to implement web workers.


Each thread can have its own V8 runtime (isolated from all other runtimes). To make it even easier to run scripts in isolation, a V8Executor was added. The V8Executor will execute a script on a separate thread (and in a separate isolated runtime)  and make the results available to the caller. In addition to executing scripts, the V8Executor supports a terminateExecution() method to stop long running scripts. The terminateExecution() method can be called from any thread.

 V8Executor executor = new V8Executor("script to execute...");
 String result = executor.getResult();

V8Executors can marked as longlived which means after the original script is processed, they will wait in an event loop for messages to arrive. When messages arrive (using the sendMessage(String s) method), the messages will be processed and the V8Executor will return to the waiting state.

The V8Executor can also track other threads that were started. This way, if the first worker terminates, other workers will be shutdown too.

Receiver in Callback

When a Java method is called from JavaScript, J2V8 now uses the V8Object that the JS Function was called on as the first parameter.  Consider the following JavaScript:

var array1 = [{first:'Ian'}, {first:'Jordi'}, {first:'Holger'}];
for ( var i = 0; i < array1.length; i++ ) {[i]);

If print is Java method, the array element will now be passed as the first argument.
 class PersonPrinter implements JavaVoidCallback {
  public void invoke(final V8Object receiver, final V8Array parameters) {


J2V8 uses native handles (pointers) to C++ objects. These native handles must be released when they are no longer needed. For objects with a long life, especially for those used as keys in a map, managing them can be a pain. A V8Map has been added in which V8Objects can be used as keys. You can then release the handle to the V8Object immediately, and the V8Map will take over the memory management for you. For example:

 V8Map map = new V8Map<String>();
 class PersonMapper implements JavaVoidCallback {
  public void invoke(final V8Object receiver, final V8Array parameters) {
   map.put(receiver, receiver.getString("first"));

Items can be retrieved from this map in another callbacks. When the Map is no longer needed, it can be released freeing all the memory it manages. To make it even easier to manage, the map can be associated with a V8 Runtime, and when the runtime is released, so will the map.

Putting it all together

Using these three new features of J2V8, building WebWorkers is relatively easy. You will need the latest snapshot version of J2V8, which is now available in Maven Central.


First register the Worker, terminate(), and postMessage() function handlers. The terminate and postMessage functions are added to the prototype of Worker. The start function is mapped directly to the Worker constructor. This way when new Worker() is called, the start method will be invoked.
private void configureWorker(V8 runtime) {
  runtime.registerJavaMethod(this, "start", "Worker", new Class<?>[] { V8Object.class, String[].class }, true);
  V8Object worker = runtime.getObject("Worker");
  V8Object prototype = runtime.executeObjectScript("Worker.prototype");
  prototype.registerJavaMethod(this, "terminate", "terminate", new Class<?>[] { V8Object.class, Object[].class }, true);
  prototype.registerJavaMethod(this, "postMessage", "postMessage", new Class<?>[] {V8Object.class, String[].class}, true);

The Java implementation of Start is the most interesting. Web workers typically specify a file from which to load the script, however, for simplicity sake we will just pass the script as a string. In the start method, we seed the V8Executor with the script, and define a message handler called messageHandler. The Executor is marked as longliving. We then configure the worker so it can create additional workers. Finally, we register the worker with the existing runtime and start it.
public void start(V8Object worker, String... s) {
  String script = (String) s[0];
  V8Executor executor = new V8Executor(script, true, "messageHandler") {
    protected void setup(V8 runtime) {
  worker.getRutime().registerV8Executor(worker, executor);

The terminate and post message handlers are fairly straight forward. They both lookup the Executor from the current runtime and send a message. The postMessage only handles strings, but a more advanced version could serialize a complex object to JSON and pass it between runtimes.
  public void terminate(V8Object worker, Object... s) {
    V8Executor executor = worker.getRutime().removeExecutor(worker);
    if (executor != null) {
  public void postMessage(V8Object worker, String... s) {
    V8Executor executor = worker.getRutime().getExecutor(worker);
    if (executor != null) {

Finally, we put this all together by creating a main executor which creates a worker and executes a simple script on that worker. The script prints messages to the console. Finally, two messages are posted to the worker and then the worker is terminated.
  public void start() throws InterruptedException {
    V8Executor mainExecutor = new V8Executor(""
    + "var w = new Worker('messageHandler = function(e) { console.print(e[0]); }');\n"
    + "w.postMessage('message to send.');\n"
    + "w.postMessage('another message to send.');\n"
    + "w.terminate();\n") {
    protected void setup(V8 runtime) {

The complete example is available on GitHub.

This is a release candidate for J2V8 3.0. Try it out and let me know if you hit problems.

For more J2V8 updates, follow me on twitter.


Leave a Comment. Tagged with j2v8, j2v8

by Ian Bull at May 28, 2015 12:33 AM

openHAB 1.7 and 2.0 alpha 2 Release

by Kai Kreuzer ( at May 27, 2015 10:37 PM

The openHAB community is growing rapidly and so does the rate of contributions - it is therefore definitely time for a new release!
We have reached a new all-time record with a total of 160 add-ons (of which 23 are new bindings and 9 new actions) for openHAB 1.7 - you can find the full list of new features and enhancements in the release notes!
Nest Protect
As usual, I would like to highlight a few: First of all, there is support for Nest now - not only for the thermostats, but also for Nest Protect, the smoke detector. So finally Nest can claim that it "works with openHAB" ;-) Being an open and independent platform, when mentioning Nest, there should also be Ecobee - and indeed we have a new binding for this as well.
Another highlight is the Logitech Harmony Hub integration, which is a very popular device to control all of your entertainment racks. The binding supports bi-directional communication with the hub, i.e. it can send commands as well as being informed about actions on the hub, e.g. triggered through a Harmony remote control. Other new entertainment-related bindings are for example the ones for Denon receivers and for Plex. If you own a pool or an alarm system, you might be as well interested in the Autelis and the Satel bindings.

Besides the new bindings, there is another new feature that is targeting the developer-type of users: Besides the Xtext-based rules, it is now possible to write rules in any JSR223-compliant scripting language, like e.g. Jython. This is a really cool feature for people who prefer other languages and didn't get along with the default rule scripting syntax.

openHAB 2.0 alpha 2

So what about openHAB 2 then? Despite the fact that it is still called an alpha release, it has made a huge step forward: Most bugs of the first alpha release have been fixed, so that the runtime is pretty stable meanwhile and already used by a few users in production. One important step was the continued work on the 1.x compatibility layer - more than 30 add-ons of openHAB 1.x have already been reported to work smoothly on the openHAB 2 runtime. Although this is a good number, it still means that less than 20% has been tested so far. So with the alpha 2 release, I would like to encourage all users to test their 1.x add-ons on openHAB 2 - once we have reached 80%, we are ready to go for a first beta.
Auto-discovered devices
Besides backward compatibility, the real highlights of openHAB 2 are of course the new bindings that are already implemented against the Eclipse SmartHome APIs. This is where most efforts took place over the past months; as a result, we have by now almost 20 "new" bindings - besides the intial ones like for Philips Hue, LIFX, Belkin WeMo or Sonos, there is now support for AVM Fritz AHA devices, IPP-printers, eQ-3's MAX! system and more. The great thing about all these new bindings is their ease of setup: All you have to do is to launch the openHAB runtime and available devices are found automatically and ready to be used with a simple click.
Charging a Tesla through openHAB
There is of course one exception to the rule - the new Tesla binding cannot discover your Tesla automatically :-). But besides this limitation, this binding is my personal highlight - it cannot only do the obvious things like reporting the odometer, the location and the battery charging level; no, you can now also honk the horn, adjust the sunroof and activate valet mode on your car - isn't that cool? I am just slightly disappointed that I do not have any testing hardware myself at home... As charging is an important aspect of EVs, the Tesla binding is accompanied by a binding for Keba charging stations.

If you want to have a glance at openHAB 2 yourself, simply download the demo package, which comes with a few useful add-ons so that you should have an easy start.

Mobile Apps

Light and Dark Theme on Android app
I should not forget to mention that with this new release there are also updated versions of the openHAB native apps in the AppStore and the PlayStore - these updates also bring many fixes and are compatible with openHAB 2 already. The Android app has been updated to Material design with a choice of a light and a dark theme. Furthermore, it supports already the new discovery and inbox mechanisms of openHAB 2 - more features will follow soon!

by Kai Kreuzer ( at May 27, 2015 10:37 PM

IoT Requirements Meeting Berlin & San Jose

by Peter Kriens ( at May 27, 2015 03:52 PM

Last week Thursday we had an OSGi IoT Requirements day in Berlin and next week Thursday (June 4) we will have another workshop in San Jose. Now I always like to go to Berlin (I worked there part-time for Deutsche Telekom for about 3 years) but this time was even more special. The reason was the excitement that made me fondly remember the early days of the OSGi. The more than 30 people that

by Peter Kriens ( at May 27, 2015 03:52 PM

Eclipse and TextMate bundles support (LiClipse 2.1 released)

by Fabio Zadrozny ( at May 27, 2015 12:46 PM

LiClipse 2.1 now marks a significant milestone as it enables users to have syntax highlighting for almost any language available (that is, any language which has a related TextMate bundle can now be used in LiClipse/Eclipse).

The major portion of this update is related to syntax highlighting support and snippets (if the snippet matches the top-level grammar scope... future releases should improve on that so that it recognizes the more 'elaborate' scope selectors from TextMate).

Installing a bundle should be pretty simple (mostly put a zipped file with a '.tmbundle' extension in a tracked folder... has more details).

New languages supported out of the box now include PHP, Ruby and Markdown (through TextMate bundles).

Also, the LiClipse standalone is now based on 4.5 (actually 4.5rc2a), so, it's text search is much faster and its dark theme has nice improvements too (in both flavors: Eclipse 4 theme / LiClipse theme).

Enjoy ;)

by Fabio Zadrozny ( at May 27, 2015 12:46 PM

The SVenGers : Age of Sirius

by Melanie Bats at May 27, 2015 10:48 AM

Today we swing the Sirius posts series onto another topic : using SVG images in your designers.

Maybe you do not know yet but we will have to fight Pixels monsters this summer :

Our mission: save the world.
Our superpowered team: the SVenGers.


The story begins as any superhero blockbuster movie : a bad experiment generates a monster.
So our first step in this post is to introduce a pixel monster in the world. We define as usual a metamodel. This time, it represents our SVenGers team :

Then we provide a Sirius specification project with a new kind of representation named PixelatedDiagram and a ScalableGirl mapping.

As we already saw in a previous post we use the Workspace Image style to modelize our team member.

We create a new instance of our metamodel which defines the team with the SVenGers superheroes:

And finally, a new diagram is created :

Up to there everything is fine.

But in our mapping definition we set that the node is resizable:

Consequently, the diagram can be updated

And we are able to make the Scalable girl bigger:

And here is the point where the pixels attack.
Thankfully, Sirius came to our rescue.


To fix this problem, Sirius supports SVG images. A Scalable girl SVG image is created thanks to an appropriate vector graphics editor like Inkscape.

As mentioned in the Sirius best practices, we need to clean the SVG file. On the <svg> container node, we must add the following attributes: viewBox="0 0 width height" and preserveAspectRatio="none".

Then when you define the mapping workspace image style instead of giving a bitmap image, you need to provide an SVG file.

To continue with our example, we create a new representation named SVGDiagram and this time, we select an SVG image for the Workspace Image style and we create two other mappings to represent the other SVenGers team members:

After creating a new SVGDiagram on our example model, we resize the Scalable girl again:

This time, she looks perfect after the resize, there is no more pixel artifact.

Caution, the current Sirius 2.0 version has a reported bug (442268) about SVG images. When you use the zoom, the SVG images quality gets as bad as if it was bitmap images. This is a known issue that should be fixed for the next 3.1 version. Do not hesitate when you find a bug to report it on the Sirius bugzilla!

By using SVG images, you are able to create designers which still look great after resize. So join us and use SVGs to fight against pixels!


by Melanie Bats at May 27, 2015 10:48 AM

Eclipse Newsletter - Eclipse Builds

May 26, 2015 02:23 PM

In this issue of the newsletter, we will look at how Maven, Tycho, and Gradle can be used from inside Eclipse.

May 26, 2015 02:23 PM

EMF Dos and Don’ts #11

by Maximilian Koegel and Jonas Helming at May 26, 2015 11:47 AM

EMF is a very powerful framework and with power comes…responsibility. You can achieve great things with minimum  effort using EMF, but if something goes wrong, you may also spend hours trying to figure out why. This blog post is part of a series on things you should do and things you should not do when using EMF. You can use the link to the series pilot to navigate to the start and the link below to navigate to the next blog once it is published.

EMF Dos #11: Carefully use EcoreUtil.delete()

This static helper methods is used in many projects, but often causes trouble. Before we talk about potential issues with this method, let us have a look at the JavaDoc to understand, what it is supposed to do:

“Deletes the object from its containing resource and/or its containing object as well as from any other feature that references it within the enclosing resource set, resource, or root object.”

As described before, EMF model instances are typically structured in a tree (containment tree), the root node of this tree is typically a Resource. Removing an EObject from this tree will de-facto delete it. As an example, it will not be serialized anymore. In the following example a call of EcoreUtil.delete() on EObject C will remove the containment reference from A to C. As there is no incoming reference to C anymore, the EObject is deleted.


This sounds simple, but the second part of the description is the critical point. In the following example, C has two incoming references, the containment from A and a cross-reference from B. When deleting C, this cross-reference must also be deleted to keep a consistent model. Otherwise B would hold a dangling reference to an EObject, which is not part of the containment tree and which would not be serialized itself.


For this reason, EcoreUtil.delete() takes care about removing incoming cross-references, too. While this is principally a good thing, it can cause two issues: Cross-References to Children

1. Cross-References to Children

EcoreUtil.delete() will only remove cross-references to the EObject you called the method on, but not its children. In the following example, deleting EObject C will still create a dangling reference from B to D (marked in blue). Only the red references are removed in this case.


For that reason, there is a second method with a boolean parameter: EcoreUtil.delete(EObject toBeDeleted, boolean recursive), which will recursively visit all children of an EObject and remove incoming cross-references on them as well. While this keeps a consistent model, it can exaggerate the next issue.

2. Performance

To understand the potential performance problem of EcoreUtil.delete(), one has to understand how incoming cross-references pointing to the EObject to be deleted are identified. As the cross-references can be uni-directional, there is no efficient way to identify all other EObjects in a model instance, which hold a reference to the EObject to be deleted. That is the reason why all EObjects in the enclosing root EObjects, Resource or even Resource Set are visited and checked, regardless of whether they hold a cross-reference to the object to be deleted. If a cross-reference is found, it is removed. Therefore, the run-time of EcoreUtil.delete() is O(n), while n is the number of EObjects in a model instance. Even worse, this is only the case, if the model is already completely loaded in memory. If parts of the model are not yet loaded, the performance can be much worse, as those parts then need to be loaded during the delete operation. If you only deal with small models, this might never be a problem in your project, but models tend to grow over time.

There are two solutions for this issue. First, uni-directional references should be avoided completely, all references are bi-directional. In this case, you can implement a very efficient delete, as the cross-references can be removed from the side of the tree, which gets deleted (consider sub elements, too!). Second, the creation of a “cross-reference maps” in an additional data structure, which can help to find cross-references more efficiently. The cross-reference adapter, provided by EMF, helps to implement this, as it supports to be notified whenever a cross-references is added or removed. Model repositories such as CDO or EMFStore typically already implement a more efficient delete function like this. In both cases, using bi-directional references only and using cross-reference maps or a repository, you must not use EcoreUtil.delete.

By the way, the Delete Command, offered by the EMF framework shows the same behavior, meaning it searches recursively for cross-references and removes them.


2 Comments. Tagged with eclipse, emf, eclipse, emf

by Maximilian Koegel and Jonas Helming at May 26, 2015 11:47 AM

EMF-IncQuery: Query Explorer support for EMF Facet Model Browser

by harmathd at May 26, 2015 11:04 AM

The EMF Facet project provides a convenient editor for EMF models called the EMF Facet Model Browser which is a great replacement for the Sample Reflective Ecore Model Editor.

To use it, install the EMF Facet SDK as described here, and open your model with the EMF Facet Model Browser. It provides grouping model elements by type, grouping attribute and reference values by relation, text search and so on. The only downside is that it only works for models which have their metamodel registered, therefore if you are developing a metamodel, you have to launch a runtime Eclipse instance to be able to edit instance models of your metamodel with the Model Browser.

Starting from EMF-IncQuery 1.0M3, you can also load models from this advanced editor to EMF-IncQuery's Query Explorer view for your convenience! The Show location context menu command also works, but only partially: because the EMF Facet Model Browser can only select one element, it selects only the first element of the match.

by harmathd at May 26, 2015 11:04 AM

Screenshot of the Week: Missing JRE

by waynebeaton at May 25, 2015 03:29 PM

One of the more frustrating things about Eclipse–at least for some users–is that Eclipse doesn’t come with a Java Runtime Environment (JRE). Since Eclipse is itself a Java application, it needs a JRE to run. The intellectual property rules at Eclipse prevent us from including a JRE with the downloads, so you have to go and install one yourself.

If you try to run Eclipse without having first installed a JRE, you’ll see a message like this:

JRE Needed

The new installer provides a little more help. If you try to launch the installer without having first installed a JRE, you’ll see something like this:

JRE Needed with help

If you click “Yes”, a dialog box will open inviting to you locate a JRE (this would be the right option to use if you know that you have a JRE installed, but it isn’t on the class path).

If you click “No”, your browser will open with some handy links to help you install a JRE:

JRE Links

The list includes both JRE and Java Development Kit (JDK) links. If you’re using Eclipse to do Java development and just want things to work “out of the box”, install a JDK. More advanced users can configure JDKs in the preferences.

by waynebeaton at May 25, 2015 03:29 PM

“Eclipse Rich Client Platform” book – Revised third edition available based on Eclipse 4.4

by Lars Vogel at May 22, 2015 12:04 PM

I’m happy to announce that the revisted third edition of the Eclipse RCP book is available. It has been updated to Eclipse 4.4 and contains lots of small corrections and clarifications. The update resulted in approx. 100 more pages.

Eclipse Rich Client Platform

by Lars Vogel at May 22, 2015 12:04 PM

Unit Testing with scripts in EASE

by Christian Pontesegger ( at May 22, 2015 08:41 AM

In the company I work for we do lots of regression testing, mostly for interface testing of hardware devices. Therefore we needed a unit testbench similar to JUnit without the complexity of writing java code for our tests. So we implemented a simple Unit test framework for EASE.

Source code for this tutorial is available in the EASE scripts repository.

Step 1: Create a simple test script

Create a new Project in your workspace named JavaScript Unit Testing Tutorial. Create a new file Tests/Simple/01 Valid tests.js
// starts a simple test
startTest("empty", "an empty test case");
// ends a test

// start another test
startTest("no test code", "a test containing no assertions");
print("Hi from valid test");

// third test
startTest("valid assertions", "a test containing valid assertions");
// check

// code outside of a testcase
print('"' + getTestFile() + '" completed');
You might ask where these test functions come from as we do not load any modules. The unit test framework comes with a module called Unittest. It is hidden by default but will be loaded automatically when we execute EASE UnitTests. To unhide go to the Preferences/Scripting/Modules (Note: this is not necessary to use the module, it will only display it in UI components).

If you are familiar with unit testing in general you also know assertions and according methods like assertTrue(). In general these methods perform a check for validity. In case an expected result does not match with a current result, an error is generated for the containing test case.

So test cases are encapsulated between a startTest() and an endTest(). It is recommended to not use assertions outside test cases, yet not mandatory.

Step 2: Create and execute a test suite

To execute test files, we need to create a Test Suite, that sets up a test environment for us. Create a new Scripting/Script Testsuite named Testsuite.suite.  The editor will allow you to select test files you want to execute. Therefore we look for script files in the same project where the suite is located.

Select our previously created test file and hit the Run Test Suite button in the top right corner.

 A new view is opened that displays unit test results.

The top tree view reflects the file structure of our test files and displays decorators indicating the test execution result. If you select a test file, detailed results are displayed in the bottom section.

Step 3: Test errors

Create a new file Tests/Simple/02 Test errors.js.
// test containing assertions that fail
startTest("invalid assertions", "a test containing invalid assertions");

// manually create a failure
startTest("failure", "test throwing a failure");
failure("test broken, stop execution here");

// an exception would also create a failure
throw new java.lang.Exception("code exception");

startTest("never to be reached");
// not being reached as the failure above terminates test file execution
Save the test, add it to your suite and run the suite right away. When an assertion fails, error markers are generated on your script files on the according code location. You will also see the most critical assertion reflected in the Script Unit Test view. Double clicking on errors will open the source editor on the corresponding location.

Similar to JUnit there exist two different types of things that can go wrong: errors and failures. Errors are assertions that do not meet their criteria. They are recoverable, meaning script execution of the test file continues.

Failures on the other hand are not recoverable, so script execution of that test file is terminated immediately.

Step 4: Test Suite configuration

Typically tests need to be adapted to a certain environment. In general you do not want test engineers to modify your script code. So the test suite supports setting of Variables that are automatically available in all test files. The Setup section allows to execute arbitrary code on the Test Suite start, Test File start, startTest() call and also for the corresponding teardown sections. As you may provide multiple suite files within a project, these secions are a good place to adapt tests according to your environment.

Optional: Test automation

Often tests need to be executed automatically, eg for a nightly test run. The Unittest module allows to run a testsuite from a script. Together with the headless application from EASE you can run a suite from the commandline and create a report (we currently support the JUnit xml format that can be picked up from Hudson/Jenkins).

Optional: Additional assertions

If you want to provide your own assertion methods, simply create your own module and let your wrapped method return an IAssertion. If you call your method from within a test script it will automatically validate your assertion method.

So why do I want to write scripted tests?

In the company I work for we use these kind of tests for interface verification of hardware devices. Therefore we provide our own modules that allow us to send stimuli and validate expected responses. We also use it in combination with analog measurement devices to verify that certain hardware parameters are within valid ranges.

Currently Script Unit Testing is supported for the Rhino script engine only.

by Christian Pontesegger ( at May 22, 2015 08:41 AM

My favourite free Mac OSX apps

by David Bosschaert ( at May 21, 2015 01:11 PM

I have been a Windows guy for many, many years, starting with Windows 2.x in the late 1980's all the way up to Windows 7. Then, about 4 years ago I gave up. Not because Windows was so bad (I actually quite liked Windows 7) but because at the time I could not find any decent laptop for it! So I got a Mac in 2011. And, over the years I got to like it, especially the hardware. I was always a big fan of opensource and freeware/shareware which was always widely available for Windows. Over the past years a collected some good legal free software for the Mac and I thought I'd share with everyone what I like. The interesting bit here is that most of this stuff is not actually distributed via the Apple Appstore...

Here's my list in no particular order, starting with a bundle of freely available utilities...


Great video converter tool. Convert any videos that you might have into any other format. BTW if you're looking for good settings that give you videos that play/stream on most devices and are relatively modest in size, I use the following settings (everything not mentioned is left at default):
  • Format: MP4, Web Optimized
  • Picture: Size: source = destination, Cropping: automatic, Anamorphic: none, Filters: all off
  • Video: Codec: H.264, FPS: Same as source-variable, Quality: RF 22, Use Advanced Options
  • Audio: AAC Stereo, Samplerate auto, Bitrate 128
  • Advanced: Reference Frames: 6, CABAC Entropy Encoding: yes, 8x8 transform: yes, Weighted P-Frames: yes, Subpixel ME & Mode: 2  SATD qpel, Trellis: off, No DCT Decimation: off.
Download from


The video player that plays everything. If you install the right drivers it can even play Blu Ray discs, something the native DVD player on OSX cannot do. Download from


Previously called XBMC. Another media player. This one is really good for streaming over the network and has tons of plugins. You can also create a catalog that runs on a central server and stream that to all the devices in your house, for example. I wrote some details on how I use my Raspberry PI as such a media server here: Download from


This tool has a lot of features for the touchpad, but the main reason why I use it is not on the touchpad. I don't like the click feature of the touchpad, the fact that you have to press the touchpad itself. I prefer pressing a button to act as a mouseclick. On my UK keyboard there is a key that I never use, just above the TAB key there is a key with the § sign. The above screenshot shows how I used the BetterTouchTool to remap that key to be the mouseclick. I still use the trackpad to position my mouse, but no need to press it down, I do that with my other hand by pressing that mapped key. Download from here:
BetterTouchTool also has Windows 7-like window snapping functionality, which is really handy too. Although I personally use Breeze for that, which has more features in this area. It's not a free tool so it doesn't belong in this list, but its very cheap so worth checking out :)


This is a very handy little tool, that simply extends the clipboard with a history of up to 25 entries. Instead of cmd-V, use shift-cmd-V to cycle through all your past clipboard contents. Extremely useful. This one is free on the apple appstore:


This is a free WinZip-like tool for the Mac. It doesn't have as many features as WinZip, but I tend to find it very good for quickly peeking in a .zip or .jar file. And the program icon is just really cute! Download from:


I'm a VIM guy and this Mac version is really good! Download from


I'm relatively new to password management software but the recent vulnerabilities and attacks made me move to it. I'm a bit weary of storing my passwords in a cloud-based solution. I'd rather have a local file that's properly encrypted, so that it doesn't matter who actually sees that raw file. I also want something that automatically works with web browsers so that passwords are automatically entered. KeePass is a great Windows-based app that does all that. There's an Android version (KeePassDroid) that even works on my BlackBerry Z10. And there are Chrome (chromeIPass) and Firefox (PassIFox) integrations with the KeePass HTTP server that seamlessly enter your passwords in the appropriate websites if you approve this action.
There are a number of opensource projects to get this working on the Mac too. However, they seem to be in various stages of incompleteness. There is the KeePassX project, but it doesn't have support for the HTTP server (yet) that you need to integrate with the browser. There is a new project called MacPass which is another KeePass clone, but it also doesn't support the HTTP server (yet). Some people use Mono to run the Windows KeePass on OSX, but I found that not very satisfying and at some point it just started crashing continuously. In the end I found Keith Bennett's fork of KeePassX 2.0Alpha5 that has HTTP server support. The UI is a bit buggy, but it's the best I could find in the opensource arena for password management on OSX, so this is what I'm using right now. Looking forward to having a more stable version of KeePass on the Mac with HTTP server support.

PDF Split and Merge

I love PDFs :) (hey I work for Adobe). And there are tons of tools available for creating PDFs both from Adobe and from other vendors. PDFSam is a really nice little tool that helps you work with PDFs once they are created. Rearrange pages, split chapters off, merge multiple PDFs together, that kind of thing. I find myself using this tool pretty often. You can get it from here:

OSX Screen Saver runner

Ok, should maybe not be in this list, because it's not freeware or opensource, as it's shipped as part of OSX itself but it's free in that everyone who has OSX already has it, but you may not be aware of its existence. This is just a really simple way to lock your screen, if you need to walk away from your computer, for example. You simply find it on your local disk at /System/Library/Frameworks/ScreenSaver.framework/Versions/A/Resources/
and I normally have it locked to my dock, so I can just click it to lock my screen.


There are also a few larger applications where I think there are some great opensource products available that I use on a daily basis.

Openoffice / Libreoffice

Personally I prefer this office suite to the commercial ones available. Great features, great usability and it works on all the platforms that I use outside of OSX, including Linux. Download from

Thunderbird and Firefox

These two need no further introduction. Just an excellent webbrowser and a great email client. Get them at


Still the best IDE around for Java and other programming languages. Available from

That's it - these are my favourite opensource / freeware / shareware apps that I use all the time. Enjoy :)

by David Bosschaert ( at May 21, 2015 01:11 PM

Code editors in general with JavaFX

by Tom Schindl at May 20, 2015 11:17 AM

Yesterday I did a short demo on how one can build code editors with JavaFX while the talk was at Xtextcon most information apply to any code editor you may want to develop with the runtime components developed as part of e(fx)clipse.

I’ve uploaded the slides to slideshare

The important point is that all this is plain Java! No OSGi involved so eg the Java-Sample I showed looks like this:

public class SampleJavaCode extends Application {
  private final static String[] LEGAL_CONTENT_TYPES = new String[] { 
    IJavaPartitions.JAVA_STRING, IJavaPartitions.JAVA_CHARACTER };

  private int count = 0;

  public void start(Stage primaryStage) throws Exception {
    BorderPane container = new BorderPane();
    Document document = new Document();

    JavaSourceConfiguration configuration = new JavaSourceConfiguration();

    SourceViewer viewer = new SourceViewer();

    FastPartitioner partitioner = new FastPartitioner(new FastJavaPartitionScanner(), LEGAL_CONTENT_TYPES);
    document.setDocumentPartitioner(configuration.getConfiguredDocumentPartitioning(viewer), partitioner);


    Scene s = new Scene(container);

  public static void main(String[] args) {

and looks like this:



All sources for the stuff I presented are available in the e(fx)clipse git repository – watch out for projects starting with “org.eclipse.fx.xtext”.

by Tom Schindl at May 20, 2015 11:17 AM

My Journey to Mars, Eclipse Mars

by Doug Schaefer at May 18, 2015 06:05 PM

Wow, Eclipse Mars is almost finished and it’s been very busy for me and those I’ve been working with. We have a lot of exciting new features coming and I can’t wait to get them into the community’s hands and see where they take them.

I’m going to write more over the next few weeks on each of these, but I thought I’d give an overview of what you can expect for Mars. They all stem from a common theme, make Eclipse easier to use and lower the barrier to entry for new users, especially those writing C and C++ as a hobby, the new breed of hobbyist computer engineers using $10 computers to build amazing electronics projects. New users mean a growing and vibrant community.

Here are the highlights.

Serial Port Library

CDT has a pretty interesting native library that provides interfaces to native tools that the Java run-time doesn’t. This includes a Process subclass called Spawner that can send Unix signals, a Pseudo TTY interface (PTY) that can be used to set up terminal like interfaces to processes, and access to the Windows Registry.

One thing that is really common with these new $10 computers, especially the microcontrollers like Arduino is that you need to connect to them with a serial port to see what’s going on. For whatever reason, the serial port libraries out in the open were all GPL/LGPL and the main one, rxtx, has disappeared. Serial port programming isn’t rocket science, so I wrote my own library and added it to the CDT native feature. My first use is with the Arduino CDT covered below.

Remote Target Management

As I was building the LaunchBar (coming up next), I needed a way for the user to select which system to launch on. I made one that was pretty simple that adapted the targets such as those we were using for QNX and BlackBerry. I then started adding features, like a View to interact with the targets and then thought about a services architecture that would add command shells, remote launching, remote file access, i.e., a full blown target management system.

Well, that reminded me of Greg Watson (from PTP fame)’s talk from a few years ago about the fact we have too many target management systems, and none of them do everything we need. So he started one that does. I decided instead of writing my own, I’d add my vision to Greg’s and come up with an uber flexible, services oriented target management system. The beauty is that it’s easy to adapt to any existing TM system. And we’ll continue to build out features and make it a suitable replacement for RSE in upcoming releases.

Screen Shot 2015-05-18 at 1.56.06 PM

The LaunchBar

The LaunchBar has been the focus of my team at QNX’s efforts to fix up one of the biggest usability issues we see with Eclipse, the whole mechanism to launch the applications you’re building with the IDE. There’s been some work to improve that over the years, such as the launch shortcuts, but frankly, other IDEs do a much better job at this.

We felt it was important for the user to know exactly what was going to happen when they hit the run button. And that’s accomplished by showing the current selection, i.e. What you’re going to launch, Where you’re going to launch it to, and How you’re going to launch it. How is simply the launch modes we’ve had in the past but make more accessible. The Where relates to my work with the Remote TM system. In this day with embedded targets and cloud servers, we’re often building software that’s going to run somewhere else than our desktops.

The most important aspect what helping the user define What they’re going to launch. And really, my objective here was to make it so that the user never needs to go the the launch configuration dialog for the most common cases. To help with that, we have an automated system the populates potential What’s. By default, launch configurations are a What, obviously, and that makes the launch bar usable with existing launch configurations. But the system is flexible, and What’s can be anything, for example, Arduino projects.

Screen Shot 2015-05-18 at 2.00.03 PM

Arduino C++ IDE

My first foray into the hobbyist computer engineer world was with Arduino. I bought an Arduino Uno and built a little system with a sensor and a wifi shield that was a kind of Internet of Thing. But after years of using professional IDEs, the last many being Eclipse, I wasn’t very excited about the standard Arduino IDE. Also, Arduino programming is done through this language called Wiring which, come on!, it’s so close to C++, why not teach hobbyists those last two or three concepts and “Program Your Arduino in C++ Like a Pro”.

And, hey, I know this great C++ IDE they can use. So, and this is the self serving part, I set out to build an integration for the Arduino toolchain for CDT. And it turned out pretty nice and I enjoy using it for my Arduino projects. And as a bonus, I get to use the same IDE, hell, same workspace, to program the server side of my Internet of Thing project. For me, that has always been the promise of Eclipse: One IDE to rule them all!

I have the plug-ins in CDT and they’ll be coming out in Mars. It’s really only a preview at the moment and you’ll need to have the standard Arduino IDE installed for it to work. As I was wrapping up the Mars work, Arduino released their 1.6 version and with it and pretty nifty library and BSP management system with an open data format. I plan on adding support for that system to the Arduino CDT plug-ins as well and that should eliminate the need to install the Arduino IDE if you so desire.

The Journey Continues

As I mentioned, I’ll write a lot more about these features in the upcoming weeks. It’s going to be hard to try them without a little documentation and that will come here on my blog for now until things mature. There’s a lot more ahead as I get feedback from the community and people try to use these things in different configurations. I already have great feedback from the Red Hat JBoss guys who are trying to use the LaunchBar for WTP that’s resulted in a pretty big last minute change. But this stuff is only successful if people use it and contribute back so I’m more than willing to listen.

Also my journey into the computer engineer hobbyist world continues beyond Arduino. I have a Raspberry Pi B and I have been able to build an ARMv6 hardware float toolchain for it. We’ll likely make this the first official embedded target support provided by the CDT as an example for the embedded vendors to follow. We should have done that a long time ago.

I’ve also just purchased a couple of ESP8266 chips. They’re little microcontrollers inside a wifi chip with a healthy number of GPIO pins, all for $10 or less. The Chinese company that makes them has put out a pretty good SDK and the toolchain is again standard GCC. I need a CDT integration for these too :).

I mentioned in my note about EclipseCon that I think this is probably the most exciting time to be in the Eclipse community since they early days. So many new features and great work being done by a diverse team of really smart people has breathed some much needed new life into our favourite IDE.

by Doug Schaefer at May 18, 2015 06:05 PM

Eclipse DemoCamp “Mars” Vienna

by Florian Pirchner at May 18, 2015 10:32 AM

Lunifera GmbH and IoT-Vienna are organizing the Eclipse-DemoCampMars” on 19.6 2015.

With this event, we want to bring people and companies together to share their knowledge, experience with and about Eclipse. This meeting includes six Talks and a quick intro on the Eclipse Foundation’s role by Benjamin Cabé.


  • Tom Schindl: Something cool TBD
  • Werner Keil: Energie Sparen präzise Messwerte bei SmartHome und SmartGrid
  • Philip Langer: EMF Compare
  • Benjamin Cabé: IoT Talk
  • Florian Pirchner: OSGi-IoT-Vaadin

We also provide catering, drinks, beer and cakes as usual.

For details please visit

Hope to see you at the DemoCamp “Mars” Vienna…

the DemoCamp organizers

by Florian Pirchner at May 18, 2015 10:32 AM

Shared blog for EclipseSource Munich

by Jonas Helming at May 18, 2015 10:29 AM

As Maximilian already announced on his Blog: To make it simpler for you to follow our blog posts from EclipseSource Munich we will now use a joint blog for all topics related to our work in Munich. This means there will be less posts that appear on my blog since I will post many things on the new Blog. All posts on the new blog are announced on the Twitter Account and Google+ page, see details below:

New Blog:



See you on the new blog!


Leave a Comment

by Jonas Helming at May 18, 2015 10:29 AM

EclipseCon France - Early registration deadline

May 17, 2015 02:23 PM

The early registration deadline is May 26. Register now!

May 17, 2015 02:23 PM

Great Fix Winners, Round Three

May 17, 2015 02:22 PM

Here are the final winners for the Great Fix. Thank you to everyone who contributed!

May 17, 2015 02:22 PM

Honored to become Eclipse PDE committer

by Lars Vogel at May 13, 2015 12:11 PM

I’m happy to announce that I was elected as PDE committer. This made the integration of the new png icons in PDE much easier. I plan to work on the PDE templates and improve the PDE tooling for the IDE and PDE extensions in the Eclipse Neon release.

by Lars Vogel at May 13, 2015 12:11 PM