0

I am new to Fitnesse testing Tool. I was wondering what level of thread safety we need to provide for my fixture classes.

public class SampleModel {

    String code;
    String value;
    Integer index;
    Map<Integer, SomeClass> mapTest = new HashMap<>();
    // Setters

    public void execute() {
        
        mapTest.put(index++, new SomeClass(code, value));
    }

}

Decision Table

!| Sample Model
|code |value
|a    |apple
|b    |banana

In the above example if I run same test twice in Fitnesse at the same time does the variables index and mapTest posses an issue of thread safety ?

Alex
  • 33
  • 1
  • 6

1 Answers1

0

FitNesse is single threaded. All tests are executed sequentially in a single process, so your fixtures do not need to be thread safe.

You can however start multiple test processes in parallel, for instance by opening multiple browser tabs. Or having multiple tasks/jobs on a CI server.

So if you are testing an independent installed system (e.g. a deployment of web application in an acceptance environment) the state of your system under test is affected by all running tests. That is something to consider when writing tests (e.g. you cannot assume that if a test script first places an order and then retrieves the last placed order from a database that it will see its own order; it might get an order placed by another test process running in parallel).

Fried Hoeben
  • 3,247
  • 16
  • 14