[英]Dbfit cannot find fixtures
I wrote the folowing test but am getting error: 我写了下面的测试但是收到了错误:
Could not find fixture: Connect. 找不到夹具:连接。
!path lib/*.jar
!path lib / * .jar
!|Import|
!|导入| !|dbfit.SqlServerTest|
!| dbfit.SqlServerTest |
!|Import|
!|导入| |dbfit.fixture|
| dbfit.fixture |
!|Connect|Data Source=ACER\\SQLEXPRESS;Initial Catalog=NopCommerce;Integrated Security=SSPI;|
!| Connect | Data Source = ACER \\ SQLEXPRESS; Initial Catalog = NopCommerce; Integrated Security = SSPI; |
!|query|select * from dbo.Employees|
!| query | select * from dbo.Employees |
!|Query|
!|查询| select 'test' as x|
选择'test'作为x | |x|
| X | |test|
|考试|
在页面顶部添加以下内容:
!define TEST_SYSTEM {fit}
According to this answer , the syntax for the import should be: 根据这个答案 ,导入的语法应该是:
!|import fixture|
|dbfit.fixture|
Note: the dbfit.fixture is in a separated row, and has no preceding exclamation mark, the sign of a command, so the mentioned error message should be read as: "Oh, I have found import command asking for something like dbfit.fixture , but the next line asks for a Connect fixture, which is not expected, because Connect is another command ". 注意: dbfit.fixture位于一个单独的行中,并且没有前面的感叹号,即命令的符号,因此上面提到的错误消息应该读作:“哦,我发现import命令要求像dbfit.fixture这样的东西 ,但下一行要求连接夹具,这是不期望的,因为Connect是另一个命令 “。
Try the following: 请尝试以下方法:
|import fixture|
|dbfit.fixture|
!|DatabaseEnvironment|sqlserver|
|Connect|192.168.0.3|user|pass|nz_db|
|Store query|!-select * from sql_tbl-!|fromtbl|
!|Query|<<fromsql|
|Rollback|
!|dbfit.util.ExportFixture|
|dbfit.fixture|
This works for me in DBFit Java. 这适用于DBFit Java。
Anything (even comments) between the 'DatabaseEnvironment' and the 'Connect' will also cause the 'Could not find fixture: Connect' error. “DatabaseEnvironment”和“Connect”之间的任何内容(甚至注释)也会导致“找不到夹具:连接”错误。
So, this fails: 所以,这失败了:
|DatabaseEnvironment|sybase|
|Connect | jdbc:jtds:sybase://10.158.0.189:8000;user=myuser;password=mypass;databaseName=mydb |
But this works: 但这有效:
|DatabaseEnvironment|sybase |
|Connect |jdbc:jtds:sybase://10.158.0.141:8000;user=myuser;password=mypass;databaseName=mydb|
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.