content.txt 1.84 KB
!3 A step by step example to create an run a simple acceptance test.

 1 Edit the !-FrontPage-! and add the link !->ExampleAcceptanceTest-!.  Click save.
  * You should see !-^ExampleAcceptanceTest?-! appear on the screen.
 1 Click on the '''[?]''' to open the page.
  * This will open an edit window on the page !-FrontPage.ExampleAcceptanceTest-!.
 1 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.
 1 Click on ''properties''.
  * click the ''test'' check box
  * hit ''save''.
 1 Click on the '''[?]''' after !-ClassPath-!
  * Add the following to the !-ClassPath-! page:
   * !-!path fitnesse.jar-!
   * !-!path FitNesseRoot/files/examples-!
    * and hit save.
 1 Click on !-[.FrontPage]-! and then on !-^ExampleAcceptanceTest-! to get back to the test page.
 1 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);
  *   }
  * }
 1 Save this program in ''root''/!-FitNesseRoot-!/files/examples/myFixtures
 1 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...
 1 Hit the ''test'' button on the !-ExampleAcceptanceTest-! screen.  
  * The cells in the right() column should all turn green.