Aug 13 2008
Please help test DbFit 1.1
I have merged DbFit with fitnessedotnet release 1.7.1 and fitnesse (java) release 20080812. I will publish a new official release (1.1) in a few days.
My acceptance tests are running OK. If you are using DbFit at the moment, please take 10 minutes to test the latest beta version and let me know if you encounter any problems, so that I can fix any potential issues before the release. Download the betas from:
dbfit-20080813.jar (java)
dbfit-dotnet-20080813.zip (dotnet)
![]() |
![]() |



Hi Gojko,
I have been using DbFit for about 2 weeks. It has been really helpful! Great job! What are the new features for 1.1? And how do I write a test expecting no results, but without using a ‘Count’ because I want useful failing data. For example:
Preferred:
!|Ordered Query|!-
SELECT CarName, MPGCity, MGGHwy
FROM CarDealership
WHERE
MPGCity < 15
-!|
|CarName|MPGCity?|MPGHwy?|
||||
Not Preferred:
!|Ordered Query|!-
SELECT COUNT(*) AS ExpectedCount
FROM CarDealership
WHERE
MPGCity < 15
-!|
|ExpectedCount|
|0|
Thanks,
Bryant
Bryant,
Just don’t list any data after the header (specify the result set format, though). So
!|Ordered Query|!-
SELECT CarName, MPGCity, MGGHwy
FROM CarDealership
WHERE
MPGCity < 15
-!|
|CarName|MPGCity?|MPGHwy?|
regarding new features, see the list on top ofchangelog, before the marker of 1.0 release.
Gojko,
Well, got past the first Set Parameter error where it couldn’t cast it to a fixture, but now it doesn’t appear to be setting the value of the parameter.
My set looks like this:
|Set Parameter|environment|UTest|
But when I go to use “<>environmentcodesetid|
!|Insert|code|
|codesetid|codevalue|codedsc|displaysq|isactive|isdefault|codeid?|
|<<environmentcodesetid|<>utestcodeid|
the “environment” value shows as null (though the environmentcodesetid value is correct), and my insert fails because the table won’t accept nulls in the column. Did the behavior of SetParameter change with this release, or am I doing something else wrong.
I should add that using
!|dbfit.SqlServer2000Test|
|Connect|etc|
The SetParameter fixture works, properly setting the value.
Brad,
the symbols (parameters) only work on full cell content, not on substrings. if you set the “environment” parameter, you have to read it as <
And for the record, I extracted the DbFit archive to the fitnesse\dotnet2 and set my TEST_RUNNER to “dotnet2\FitServer.exe”, because I noticed the dotnet directory was already populated with stuff that was dated later than the ones in your archive. I assumed that you intended your version of FitServer and fit.dll to be used with DbFit.
If I was supposed to put dbfit.* into the dotnet directory instead, I tried that and got an exception saying “Import” couldn’t be found in assemblies.
dotnet folder earlier contained the version of fit.net test runner that works with .NET 1.1. FitNesse.NET runner 1.7.1 is included in the latest dbfit beta release. You can install that separately if you want, it will not make any difference. You will have to change the !path variable if you change the dll location.
Hmmm, the wiki didn’t render my tables the same way I see them here, so I’ll try to repost what I have so that it looks right. I’ve added spaces between the greater than and less than symbols, as well as around the pipe symbols on the last row of the table. I hope that works. If not, I will post on the fitnesse list, if that’s OK.
The set looks like this:
|Set Parameter|environment|UTest|
The insert looks like this:
!|Insert|code|
|codesetid|codevalue|codedsc|displaysq|isactive|isdefault|codeid?|
| < < environmentcodesetid | < > utestcodeid |
This construct works using the previous version of DbFit, and in fact works in the beta version if I’m in Flow mode, where environment contains “UTest”. It does not work, however, work in Standalone mode. In Standalone mode, environment is null.
based on the documentation it seems that sqlserver is not supported for Java. Is this correct?
>> from dbfit.pdf
Support for Oracle (Java and .NET versions), MySql 5 (Java) and SQLServer
2000 and 2005 (.NET version).
Brad,
can you send me the table by e-mail. See my contact info here.
Oliver,
the docs are not updated yet, I am doing it now. Sql Server is supported in the beta version of dbfit-java 1.1. Not all data types are supported yet, but the basic support is there.
Brad,
I’m trying the following
!|Import|
|dbfit.fixture|
!|DatabaseEnvironment|SQLSERVER|
|Connect|jdbc:inetdae7a://….|
and I’m getting the following error with dbfit-20080813.jar any ideas why this connection is not working
java.lang.Error: Cannot register SQL driver com.microsoft.sqlserver.jdbc.SQLServerDriver
at dbfit.environment.AbstractDbEnvironment.registerDriver(AbstractDbEnvironment.java:36)
at dbfit.environment.AbstractDbEnvironment.connect(AbstractDbEnvironment.java:41)
at dbfit.fixture.DatabaseEnvironment.connect(DatabaseEnvironment.java:45)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at fitlibrary.closure.MethodClosure.invoke(MethodClosure.java:98)
at fitlibrary.closure.MethodTarget.invoke(MethodTarget.java:71)
at fitlibrary.closure.MethodTarget.invoke(MethodTarget.java:88)
at fitlibrary.closure.MethodTarget.invokeAndWrap(MethodTarget.java:234)
at fitlibrary.DoFixture.interpretCells(DoFixture.java:247)
at fitlibrary.DoFixture.interpretRow(DoFixture.java:236)
at fitlibrary.FlowFixture.runRow(FlowFixture.java:120)
at fitlibrary.FlowFixture.doTable(FlowFixture.java:99)
at fitlibrary.FlowFixture.doTable(FlowFixture.java:92)
at dbfit.fixture.DatabaseEnvironment.doTable(DatabaseEnvironment.java:35)
at fitlibrary.FlowFixture.interpretTableWithFixture(FlowFixture.java:89)
at fitlibrary.FlowFixture.interpretTable(FlowFixture.java:62)
at fitlibrary.FlowFixture.interpretTables(FlowFixture.java:46)
at fitlibrary.FlowFixture.interpretTables(FlowFixture.java:27)
at fit.Fixture.doTables(Fixture.java:73)
at fit.FitServer.process(FitServer.java:74)
at fit.FitServer.run(FitServer.java:50)
at fit.FitServer.main(FitServer.java:41)
You need to download Microsoft SQL Server JDBC driver from their site, it is not opensource and I cannot distribute it with DbFit. Deploy the JAR in the same folder as dbfit-XXX.jar and use Microsoft’s driver in your jdbc connection string.
Previous version just to work with current drivers like Merlia just using the appropriate connection string. Was this functionality removed?
previous version did not support sql server with java. were you using the official release of dbfit or something that you internally modified?
So this will work but it will be auto rollback per page
!|dbfit.SqlServerTest|
|Connect|jdbc:inetdae7a://conntectionstring|
insert
call code under test
query
|Close|
however I need to do inserts do commits then go to code under test and i believe the other connection type is the one that will allow me this freedom right?
Hi Oliver,
to use the inetdae7a driver, I need to change the sql server integration for you. can you use the normal microsoft sql jdbc driver for testing?
I see in the code source that DatabaseEnvironment does not implement close. Can this be added. If i have several builds running there are transactions left open until the whole suite completes. I would to have on my TearDown the
|DatabaseEnvironment|
|close|
I see it is implemented on the SqlServerTest. are there any plans to add this implementation.
thanks
O
I’ll add that in the next few days
Hi Oliver,
the close method is now implemented in the database environment fixture. get the new version from here
If I want to use a different jdbc driver (e.g. jtds for SQLServer access) how do I go about that? I see where I specify the connection URI but that is not enough since I also need to specify the driver
e.g.
net.sourceforge.jtds.jdbc.Driver
jdbc:jtds:sqlserver://amsxp/fund_master;instance=DEVLOCAL
You’ll have to implement your own DbEnvironment instance (and plug it into a DbTest instance). In your case, that might be as simple as just extending SqlServerEnvironment and changing the driver name and url.