Connect dbslim with Fitnesse

会有一股神秘感。 提交于 2019-12-13 00:46:43

问题


I'm trying to connect to a database from Fitnesse, but it keeps giving an error message. I'm using dbslim of MarkFink: https://github.com/markfink/dbslim

the message I keep getting is: Could not invoke constructor for DbSlimSetup

this is my current page:

!contents -R2 -g -p -f -h

!define TEST_SYSTEM {slim} 

!*> setup
|import|
|fitnesse.slim.test|
|fitnesse.fixtures|
|slim|

| script | Db Slim Setup |!-oracle.jdbc.driver.OracleDriver-!| jdbc:oracle:thin:@host_name:1521:database_name | username | password |

回答1:


Most likely you did not include the dbslim jar / or the path to the generated .class files into your classpath when invoking test. Try putting in something like below on the test page (or actually anywhere on the path of your test case)

!path /the/path/to/your/project/output

The path is the place that your generated .class files will go if you directly include source code of Db Slim; if you built it as a jar, use the path to the jar.

To explain this a little bit, FitNesse will invoke the actual test system in the runtime, or in another word, the test cases are running on a seperate process than the FitNesse webserver itself. By default, FitNesse will only include fitnesse.jar in the classpath of the invoked process. When you call !path, you actually include the path to the accumulated classpath of the invoked process. You can find out more on !path here



来源:https://stackoverflow.com/questions/34151508/connect-dbslim-with-fitnesse

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