Menu

Functionality

ponchy

What does ScenarLang lets you do ?

Declare complex java objects using a json like notation.

$SOME_PERSON = {
  name: "Doe",
  fistName: "John", 
  birthDate: "2012-12-15",
  isMale: true,
  address: {
     street: "1st Ave"
     number: 42
     zip: 10004
  } 
} as "my.kind.of.Person";

Explaination:

  • The above snippet declares a variable SOME_PERSON of type "my.kind.of.Person"
  • The simple values are defined the same way as in java
  • The type of the object to create is defined in the as clause. (Warning: quotes are not optional). When no type is specified, you get a Map<string, object=""></string,>
  • you may terminate your instruction with a semi-colon (actually it is required if you want to separate different instructions)

Define what the result of a call to a mock object should be

mockAgeCalculator.getAge($SOME_PERSON) = 42;

It lets you declare and inject your mocks directly from the script

caculator.ageCalculator = mock "my.age.AgeCalculator";

This documentation is partial and far from complete.

To be continued...


Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.