Reputation: 1143
I wrote the folowing test but am getting error:
Could not find fixture: Connect.
!path lib/*.jar
!|Import| !|dbfit.SqlServerTest|
!|Import| |dbfit.fixture|
!|Connect|Data Source=ACER\SQLEXPRESS;Initial Catalog=NopCommerce;Integrated Security=SSPI;|
!|query|select * from dbo.Employees|
!|Query| select 'test' as x| |x| |test|
Upvotes: 4
Views: 3163
Reputation: 1062
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".
Upvotes: 1
Reputation: 1184
Anything (even comments) between the 'DatabaseEnvironment' and the 'Connect' will also cause the 'Could not find fixture: Connect' error.
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|
Upvotes: 0
Reputation: 37349
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.
Upvotes: 0
Reputation: 5266
Include the following at the top of your page:
!define TEST_SYSTEM {fit}
Upvotes: 1