
Resources.FitNesseRoot.FitNesse.UserGuide.WritingAcceptanceTests.SliM.SystemUnderTest.content.txt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fitnesse Show documentation
Show all versions of fitnesse Show documentation
The fully integrated standalone wiki, and acceptance testing framework.
!3 System Under Test
'''Currently only available in Java'''
!-Using SystemUnderTest allows you to let SliM directly invoke a method on your SystemUnderTest without having to create a method in a SliM fixture for it.-!
!4 Example
{{{
import fitnesse.slim.SystemUnderTest;
/**
* The slim fixture.
*/
public class SlimDriver {
// field MUST be declared PUBLIC
@SystemUnderTest
public Service service = new Service();
public void init() {
Database.clean();
}
}
/**
* The service under test.
*/
public class Service {
public void createPerson(String name) {
Database.persist(new Person("name"));
}
public boolean exists(String name) {
return Database.get(name) != null;
}
}
}}}
With the !-@SystemUnderTest-! annotation you can now say:
!|script|SlimDriver|
|init|
|create person|Ben Vonk|
|ensure|exists|Ben Vonk|
When a method that should be invoked on the !-SliM-! fixture is missing, it will try to invoke that method on a '''public''' field annotated with !-SystemUnderTest-!.
© 2015 - 2025 Weber Informatics LLC | Privacy Policy