0

I have followed the directions from this website (https://schuchert.wikispaces.com/FitNesse.Tutorials.0.Java) to the t, however I cannot get the code on FitNesse to run clean.

I am consistently getting the following exceptions:

|Create Programs Could not invoke constructor for CreatePrograms[0]

|House The instance decisionTable_1.setName. does not exist

Here is my code. I have ensured my classpath is correct. Thank you for your time and consideration - I am very frustrated and confused with this.

!contents -R2 -g -p -f -h
!define TEST_SYSTEM {slim}

!path fitnesse-standalone.jar

!define COLLAPSE_SETUP {true}
!define COLLAPSE_TEARDOWN {true}

!path Users/Julianne/src/fitnesse-tutorials/DVR/bin/
|import|
|com.om.example.dvr.fixtures|


!|Create Programs                                        |
|Name |Channel|DayOfWeek|TimeOfDay|DurationInMinutes|id? |
|House|4      |Monday   |19:00    |60               |$ID=|
4

3 回答 3

1

无法为 CreatePrograms[0] 调用构造函数

!path此错误告诉您测试执行在它启动的类路径(从语句中累积)中找不到夹具代码。

看起来你在这里给出了一个相对路径

!path Users/Julianne/src/fitnesse-tutorials/DVR/bin/

鉴于您在 Mac OS 上运行,如果您在没有前面的 '/' 的情况下指定它,它将成为从您启动服务器的位置开始的相对路径。

另一件要检查的事情是确保.../bin您拥有com/om/example/dvr/fixtures并且 .class 文件在那里。


附带说明:检查结果类路径以进行测试执行的一个有用技巧是将以下块添加到测试页面(或包含的设置页面)的某处

|script     |java properties|
|show   |property   |java.class.path|
于 2015-11-30T12:49:52.997 回答
0

尝试编辑根页面并在那里定义类路径和变量:即http://localhost:8090/root

#!***> Classpath

!path ${java.class.path}
!define TEST_SYSTEM {slim}
!define COLLAPSE_SETUP {true}
!define COLLAPSE_TEARDOWN {true}

#*!
于 2015-07-17T10:08:46.820 回答
0

对我来说,当我在 SetUp 文件夹下的 content.txt 中添加类包名称时,它就起作用了,所以会有一些类似的结构来设置测试的类路径。

于 2018-09-28T12:15:46.410 回答