简体   繁体   中英

FitNesse test returns “Class RunEtlFixture is not a fixture”

I set up FitNesse locally, and I'm trying to run a test, using my own java code.

Here is the Fixture class:

import fit.ColumnFixture;

public class RunEtlFixture
{
   private String etlName;
   private int numOfInputRecords;
   private int numOfOutputRecords;

   public void setEtlName(String etlName) {
      this.etlName = etlName;
   }

   public void setNumberOfInputRecords(int num){
      this.numOfInputRecords = num;
   }

} 

And here is the test wiki:

<test page>

!path /Users/shay/Projects/AMP/Talend Jobs Testing/FitNesseTests

| RunEtlFixture                          |
| EtlName | InputRecords | OutputRecords |
| etl_one | 5            | 5             |
| etl_two | 10           | 10            |

However, when I run the test, I get:

Class RunEtlFixture is not a fixture.

I tried searching for help online, but it seems the FitNesse resources are very few. Can anyone help?

Turns out all I was missing is extending the proper fixture:

public class RunEtlFixture extends ColumnFixture {
   ...
}

我认为更好的方法是在子Wiki中定义以下内容:

!define TEST_SYSTEM {slim}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM