Why cannot DbFit be imported in SuiteSetUp?

别等时光非礼了梦想. 提交于 2021-01-29 11:50:19

问题


I have had DbFit running in Standalone mode for a while and have had the fixture import in my SetUp wiki like

#SetUp content
[...]
!|Import|
|dbfit.fixture|
[...]

and with a test wiki like

#DbTestWiki content
!|DatabaseEnvironment|ORACLE|
 |Connect|${URI}|${USERNAME}|${PASSWORD}|
[...]

It is working perfectly fine in this way. But I thought that it would be nicer to have all imports made in the SuiteSetUp wiki. So I moved the import code there and ran my test; the result was this exception

java.lang.NullPointerException
at dbfit.fixture.DatabaseEnvironment.connect(DatabaseEnvironment.java:56)
[...]
at fitlibrary.suite.InFlowPageRunner.run(InFlowPageRunner.java:34)
[...]

So it seems like it is run in Flow mode in this way. So why is it working in SetUp, but not in SuiteSetUp?

Minimum example hierarchy with the content given above (that is without any content in [...]).

FitNesseRoot
+->DbFitTest
\->SuiteSetUp

回答1:


A SetUp page is included in each page so the content is executed as part of each test. A SuiteSetUp page is executed once as a separate test before any of the other tests. So the DatabaseEnvironment table will be the second table in your test with SetUp and the first table with SuiteSetUp.



来源:https://stackoverflow.com/questions/21781394/why-cannot-dbfit-be-imported-in-suitesetup

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!