0

We have an application that serves as a simulator for a type of agent in a distributed system. Its intended use is for integration testing and thus it has to be very flexible. We have a fluent interface, that might evolve into an internal DSL, for defining the agent's behaviour: the test scenarios.

We also have a wizard for the users (the testers) to create the test scenarios but we find this to be very inefficient: the user themselves would have enough domain and technical knowledge to write the scenarios using the fluent interface while we're wasting time programming the wizard that does exactly that.

We were therefore wondering if there's any light "console" that would allow the users to write in, at runtime, the chained methods (or a DSL) with help of auto-completion and validation, just like we do while coding. If possible without having to fire up an eclipse instance.

Think of a light, embeddable "xText console" or a "groovy console with suggestions" for dynamically invoking the fluent interface methods or write the DSL.

Any ideas? How's the easiest way for your users to use your DSL?

vlfig
  • 365
  • 1
  • 13

1 Answers1

0

One way to do it is to use the Scala console:

$ scala -classpath <your-class-files>

It has dot-completion for methods. You can even take advantage of the fluent syntax where you omit the dot and parenthesis which is great for DSLs. Instead of:

scala> "howdy".contains("how")
res0: Boolean = true

...you can write:

scala> "howdy" contains "how"
res1: Boolean = true

Where "contains" could be a method of your DSL/fluent interface, of course.

[Yes, I'm answering to myself, wuoh oh oh ow].

vlfig
  • 365
  • 1
  • 13