Fitnesse
The fully integrated standalone wiki and acceptance testing framework
Hello World
-
Download the
fitnesse-standalone.jar
-
Start
start fitnesse on port 7979
D:\Tools\fitnesse>java -jar fitnesse-standalone.jar -p 7979
十一月 10, 2016 3:36:46 下午 fitnesse.ConfigurationParameter loadProperties
信息: No configuration file found (D:\Tools\fitnesse\plugins.properties)
Bootstrapping FitNesse, the fully integrated standalone wiki and acceptance testing framework.
root page: fitnesse.wiki.fs.WikiFilePage: FitNesseRoot
logger: none
authenticator: fitnesse.authentication.PromiscuousAuthenticator
page factory: fitnesse.html.template.PageFactory
page theme: bootstrap
Unpacking new version of FitNesse resources. Please be patient...
**********************************************************
Files have been updated to a new version.
Please read the release notes on
http://localhost:7979/FitNesse.ReleaseNotes
to find out about the new features and fixes.
**********************************************************
Starting FitNesse on port: 7979
- visit
localhost:7979
- Edit page
根据第一句提示,直接点击【Edit】,然后在最后添加页面名称如【MyFirstPage】后保存。命名规则WikiWord有说明。
返回即可看见添加的页面。
- Start
houbinbindeMacBook-Pro:fitnesse houbinbin$ ls
fitnesse-standalone.jar
houbinbindeMacBook-Pro:fitnesse houbinbin$ pwd
/Users/houbinbin/it/tools/fitnesse
houbinbindeMacBook-Pro:fitnesse houbinbin$ java -jar fitnesse-standalone.jar -p 7979
十一月 10, 2016 10:17:24 下午 fitnesse.ConfigurationParameter loadProperties
信息: No configuration file found (/Users/houbinbin/IT/tools/fitnesse/plugins.properties)
Bootstrapping FitNesse, the fully integrated standalone wiki and acceptance testing framework.
root page: fitnesse.wiki.fs.WikiFilePage: FitNesseRoot
logger: none
authenticator: fitnesse.authentication.PromiscuousAuthenticator
page factory: fitnesse.html.template.PageFactory
page theme: bootstrap
Unpacking new version of FitNesse resources. Please be patient...
**********************************************************
Files have been updated to a new version.
Please read the release notes on
http://localhost:7979/FitNesse.ReleaseNotes
to find out about the new features and fixes.
**********************************************************
Starting FitNesse on port: 7979
- Add Page
MyFirstPage
1、Set the type of page into test in tools/properties
2、Edit page, add content like this:
!define TEST_SYSTEM {slim}
!path /Users/houbinbin/IT/tools/fitnesse/fitnesse-standalone.jar
!path /Users/houbinbin/it/tools/fitnesse/
!|HelloWorld|
|sayHello?|
|Hello|
内容详解:
Line 1: 使用FitNesse的slim模块,也就是使用网页的形式描述测试用例
Line 2: fitnesse-standalone.jar
jar文件路径。
Line 3: HelloWorld.class
class文件存放路径。
- HelloWorld.java
public class HelloWorld {
public String sayHello(){
return "Hello";
}
}
通过命令,编译后获得
$ javac HelloWorld.java
Line 4: 引入HelloWorld类
Line 5: 方法名称,带有?
说明此方法为返回值,Line 6 为对应的返回值。如果只是age
,则会调用对应setAge()
方法,下一行为设置的值。
- Test
点击页面【Test】,结果如下
Test Pages: 1 right, 0 wrong, 0 ignored, 0 exceptions Assertions: 1 right, 0 wrong, 0 ignored, 0 exceptions (0.530 seconds)