maeste edited this page Oct 12, 2010 · 3 revisions
      Sibilla Samples Quick Ref

This project is a collection of basic samples for playing and getting started with the Sibilla Test features.

The sample project is currently based on a multi-module Maven project. The main pom.xml adds the Sibilla Maven Plugin for binding Sibilla to the process-test-classes Maven phase while turning off Surefire plugin in the test phase (that's required for handing over the test execution to Sibilla). This way Sibilla is able to properly detect which classes are modified in between subsequent compilations and establish which tests really need to be executed and which can be safetly skipped.

  • Instrumentation-only sample This sample is enabled by default. Just run 'mvn clean test' from the main dir of the project for an initial run of all tests. Sibilla takes care of instrumenting classes code for populating its metadata (which is stored in the target directory). Once the first full test run is over, you can try running 'mvn test' again and you'll see that no test is run, as nothing changed, so there's no need of re-running anything. Now you can try applying a basic change to -for instance- the it.javalinux.sibilla.sample.taxi.Stop class. Then run again 'mvn test'. Now the only executed tests is it.javalinux.sibilla.sample.taxi.TaxiTest#testRun as that's the only test in the only test classes that currently exercises the modified Stop class. An additional modification of the Address class followed by another 'mvn test' would trigger the the same TaxiTest as before plus it.javalinux.sibilla.sample.taxi.AddressTest which the other unit test covering the Address class. Nice, isn't it?

  • Annotation sample To test what Sibilla could with Annotation we have provided in this sample the interface Location and its LocationTest To enable them uncomment @Test annotation into LocationTest and @TestedBy annotation into Location. Now TestedBy will run (after a mvn clean) LocationTest against all implementation of Location interface. In our samples Locations is impemented by Depot and Stop classes. In both classes the setAddress test have a commented line that have to be uncommented to make LocationTest pass. Try to run "mvn clean install" leaving that line commented in both concrete class and you will see 2 tests failing. Uncomment this line and you will get test pass. The "magic" here is that the test are defined against the interface (have a look how we are instanciating Location object in LocationTest) and TestedBy take care to run this test against all concrete implementation of the interface. In fact you are defining runtime comtract on the interface veryfied during test phase. In future version we willsupport also annotation on the other way (annotation of test classes and not classes under test)

Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.