4

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|

here is the errors

Ibexy I
  • 1,123
  • 6
  • 16
  • 29

4 Answers4

1

Include the following at the top of your page:

!define TEST_SYSTEM {fit}
Mike Stockdale
  • 5,256
  • 3
  • 29
  • 33
1

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".

0

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.

gagneet
  • 35,729
  • 29
  • 78
  • 113
0

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|
Owen B
  • 1,185
  • 13
  • 15