将dbslim与Fitnesse连接 [英] Connect dbslim with Fitnesse

查看:157
本文介绍了将dbslim与Fitnesse连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从Fitnesse连接到数据库,但是它始终显示错误消息. 我正在使用MarkFink的dbslim: https://github.com/markfink/dbslim

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

我不断收到的消息是: 无法为DbSlimSetup调用构造函数

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

这是我当前的页面:

!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 |

推荐答案

调用测试时,很可能没有将dbslim jar/或生成的.class文件的路径包括在类路径中.尝试在测试页上(或实际上在测试用例的路径上的任何地方)插入以下内容

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

如果直接包含Db Slim的源代码,则该路径是生成的.class文件的位置;如果您将其构建为罐子,请使用罐子的路径.

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.

为了稍微解释一下,FitNesse将在运行时调用实际的测试系统,或者换句话说,测试用例是在与FitNesse Web服务器本身不同的进程上运行的.默认情况下,FitNesse仅将fitnesse.jar包含在被调用进程的类路径中.调用!path时,实际上包括了被调用进程的累积类路径的路径.您可以在!path 此处

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

这篇关于将dbslim与Fitnesse连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆