A step by step example to create an run a simple acceptance test.
- Edit the FrontPage[?] and add the link ^ExampleAcceptanceTest. Click save.
- You should see ^ExampleAcceptanceTest? appear on the screen.
- Click on the ? to open the page.
- This will open an edit window on the page FrontPage.ExampleAcceptanceTest.
- Add the following to the page:
- |myFixtures.rightTriangle|
- |a|b|c|right()|
- |3|4|5|true|
- |6|8|10|true|
- |3|5|9|false|
- ----
- ClassPath
- and hit save.
- beware: if you copy and past the lines above, be sure to remove any white space at the end of the rows. FitNesse will otherwise not be able to parse the rows.
- Click on properties.
- click the test check box
- hit save.
- Click on the ? after ClassPath
- Add the following to the ClassPath page:
- !path fitnesse.jar
- !path FitNesseRoot/files/examples
- and hit save.
- Click on [.FrontPage] and then on ^ExampleAcceptanceTest to get back to the test page.
- Create the following java program:
- package myFixtures;
- import fit.ColumnFixture;
- public class rightTriangle extends ColumnFixture
- {
- public double a;
- public double b;
- public double c;
- public boolean right()
- {
- return (a*a+b*b)==(c*c);
- }
- }
- Save this program in root/FitNesseRoot/files/examples/myFixtures
- Compile this program.
- You can do this by going to the root/FitNesseRoot/files/examples directory and typing the following command:
- javac -classpath ../../../fitnesse.jar myFixtures/rightTriangle.java
- Or perhaps you have a better way...
- Hit the test button on the ExampleAcceptanceTest screen.
- The cells in the right() column should all turn green.
Add Child Page to CreateExampleAcceptanceTest