How to put the pieces together

490 views
Skip to first unread message

Marius Schmidt

unread,
Jan 16, 2011, 2:55:41 PM1/16/11
to dbfit
Hello dbfit users,

maybe you can help me out. I have a current version of FitNesse
working together with phpslim (http://ggramlich.github.com/phpslim/)
to test my PHP application. Now I want to integrate my database tests
into this wiki as well. Since my backend database is Postgres I
therefore will have to use dbfit 2.0+.

My problem is, that I don't have any idea how to put the pieces
together. Where do I have to put which jar files and what information
do I have to provide on the wiki page? Do you know any good
documentation, perhaps about FitNesse in general, so that I can
understand how, e.g. the DbFit 1.+ All-inclusive version was bundled
together? Maybe I could use this for my purpose...

best regards,
Marius

Gojko Adzic

unread,
Jan 16, 2011, 2:58:28 PM1/16/11
to dbfit
Hi Marius,

DbFit doesn't support slim. I've seen a DbSlim project on sourceforge
(http://sourceforge.net/projects/dbslim/) that might do what you need
but I cannot guarantee, I've never used it or contributed to it. DbFit
only supports the FIT runners for .NET and Java.

gojko

On Jan 16, 7:55 pm, Marius Schmidt <gothicfict...@googlemail.com>
wrote:

Marius Schmidt

unread,
Jan 16, 2011, 3:30:44 PM1/16/11
to dbfit
Hi Gojko,

thank you for your fast answer once more. I guess I was a bit
misleading about my intention. I do not want to mix DbFit tests with
PhpSlim Tests on one page. But I want to have only a single FitNesse
Wiki server running with disjunct page hierarchies. I've downloaded
the current java implementation of fitnesse from
http://fitnesse.org/FrontPage.FitNesseDevelopment.DownLoad. Afterwards
I followed the instructions on http://ggramlich.github.com/phpslim/installation.html
to do some mysterious slim loading magic. I only had to define the
following on a wiki page, and all subordinate pages were able to use
my PHP fixture:

!define TEST_RUNNER (/opt/phpslim.phar)
!define COMMAND_PATTERN (php %m /path/to/project/Slim)
!define TEST_SYSTEM (slim)

Given that I defined the above on a page e.g. PhpSlimTests, shouldn't
it be possible to define another page parallel to the PhpSlimTests
hierarchy, e.g. DbFitTests where I put my DbFit tests?

Marius

Marius Schmidt

unread,
Jan 16, 2011, 7:08:01 PM1/16/11
to dbfit
I think I am a step further, but now I am stuck...

I installed the Fitnesse package (Fitnesse-Jan2011.zip) with a lot of
added libraries from here: https://www.socialtext.net/install/.

Afterwards I went to http://maven.neuri.com/org/dbfit/ and downloaded:
- http://maven.neuri.com/org/dbfit/dbfit-core/2.0.0-SNAPSHOT/dbfit-core-2.0.0-20090131.023656-1.jar
- http://maven.neuri.com/org/dbfit/dbfit-fitnesse/2.0.0-SNAPSHOT/dbfit-fitnesse-2.0.0-20090308.022424-3.jar
- http://maven.neuri.com/org/dbfit/dbfit-postgre/2.0.0-SNAPSHOT/dbfit-postgre-2.0.0-20090131.023656-1.jar

I renamed the jars into dbfit-core, dbfit-fitnesse and dbfit-postgres
and added them to the lib folder of Fitnesse.

On my local system I created the site http://localhost:8070/DbFitTests
with this content:

!path E:/Fitnesse-Jan2011/fitlibrary.jar
!path E:/Fitnesse-Jan2011/lib/*.jar

!define TEST_RUNNER {fitlibrary.suite.FitLibraryServer}

!|dbfit.PostgresTest|
!|Connect|localhost|myuser|mypassword|mydb

|query| select 'test' as x|
|x|
|test|

When I know try to run the test everything seems to work fine until
line !|Connect|localhost|myuser|mypassword|mydb.


I get the following errors:

connect Missing class or Missing method. Possibly:

* public Type connect(Type1 arg1) { }

localhost

query Missing class or Missing method. Possibly:

* public Type query(Type1 arg1) { }

select 'test' as x
x Missing class or Missing method. Possibly:

* public Type getX() { }
* public Type x() { }

test Missing class or Missing method. Possibly:

* public Type getTest() { }
* public Type test() { }

Any ideas whats wrong ?

kind regards,
Marius

On Jan 16, 9:30 pm, Marius Schmidt <gothicfict...@googlemail.com>
wrote:
> Hi Gojko,
>
> thank you for your fast answer once more. I guess I was a bit
> misleading about my intention. I do not want to mix DbFit tests with
> PhpSlim Tests on one page. But I want to have only a single FitNesse
> Wiki server running with disjunct page hierarchies. I've downloaded
> the current java implementation of fitnesse fromhttp://fitnesse.org/FrontPage.FitNesseDevelopment.DownLoad. Afterwards
> I followed the instructions onhttp://ggramlich.github.com/phpslim/installation.html

Gojko Adzic

unread,
Jan 17, 2011, 2:51:54 AM1/17/11
to dbfit
you should use the normal fitserver instead of fitlibraryserver. the
error message below is most likely a version incompatibility between
dbfit and fitlibrary.

gojko

On Jan 17, 12:08 am, Marius Schmidt <gothicfict...@googlemail.com>
wrote:

Gojko Adzic

unread,
Jan 17, 2011, 2:53:21 AM1/17/11
to dbfit
fit and slim can run side by side, as long as they are in different
test suites. set the TEST_SYSTEM variable at the top level of
hierarchy for each suite, and they will live happily next to each
other. with dbfit you can use !path definitions that include dbfit,
your database drivers and such in the same top level suite file.

gojko

On Jan 16, 8:30 pm, Marius Schmidt <gothicfict...@googlemail.com>
wrote:
> Hi Gojko,
>
> thank you for your fast answer once more. I guess I was a bit
> misleading about my intention. I do not want to mix DbFit tests with
> PhpSlim Tests on one page. But I want to have only a single FitNesse
> Wiki server running with disjunct page hierarchies. I've downloaded
> the current java implementation of fitnesse fromhttp://fitnesse.org/FrontPage.FitNesseDevelopment.DownLoad. Afterwards
> I followed the instructions onhttp://ggramlich.github.com/phpslim/installation.html

Marius Schmidt

unread,
Jan 17, 2011, 6:39:51 AM1/17/11
to dbfit
Unfortunately this does not work either, because without using the
FitLibraryServer I get an error message, stating I have to use it :-
( :

dbfit.PostgresTest

java.lang.RuntimeException: Please use FitLibraryServer instead of
FitServer. at fitlibrary.DoFixture.interpretTables(Unknown Source) at
dbfit.DatabaseTest.interpretTables(DatabaseTest.java:25) at
fit.Fixture.doTables(Fixture.java:79) at
fit.FitServer.process(FitServer.java:81) at
fit.FitServer.run(FitServer.java:56) at
fit.FitServer.main(FitServer.java:41)

connect Could not find fixture: connect. localhost

query Could not find fixture: query.

Gojko Adzic

unread,
Jan 17, 2011, 3:05:43 PM1/17/11
to dbfit
that is a version problem with fitlibrary. get the fitlibrary version
from http://maven.neuri.com/org/fitnesse/fitlibrary/20081102/, it
should work.

gojko

On Jan 17, 11:39 am, Marius Schmidt <gothicfict...@googlemail.com>

Marius Schmidt

unread,
Jan 18, 2011, 2:49:47 PM1/18/11
to dbfit
Hi Gojko,

thank you very much for your answer, it solved my problem.


Just to complete the setup steps for everyone who may read this:

Beside the fitlibrary mentioned by Gojko you will need the correct
JDBC
Driver for the Db you want to connect to. Otherwise you will run into
an
error like e.g. the one for a Postgres connection:

java.lang.Error: Cannot register SQL driver org.postgresql.Driver

Just add it to %FITNESSE_INSTALL_DIR%/lib and you are done. For
Postgres
you may test your setup with the following lines of code:

|query| select character varying 'Hello World' as "x"|
|x|
|test|



On Jan 17, 9:05 pm, Gojko Adzic <goj...@gmail.com> wrote:
> that is a version problem with fitlibrary. get the fitlibrary version
> fromhttp://maven.neuri.com/org/fitnesse/fitlibrary/20081102/, it

tko...@pictage.com

unread,
Feb 18, 2011, 8:24:00 PM2/18/11
to dbfit
I have been trying to get DbFit running with Postgres for a few days
now. No matter how many times I attempt to follow this walk through,
my connect command will not work. Even after changing to several
different versions of fitlibrary.jar, I continue to get the following
error.

Missing class or Missing method. Possibly:

* public Type connectPostgresPostgres(Type1 arg1, Type2 arg2) { }
* public Type connect(Type p1, Type p2, Type p3, Type p4) {}

Any help would be appreciated. I'm just researching Fitnesse /
Fitnium type testing. But am excited to see this setup work. What is
frustrating is that I can get the MySQL connect to work. Just not
Postgres, which is what we use in production. So I can't just switch
over to MySQL to do testing.

-Tom

On Jan 18, 11:49 am, Marius Schmidt <gothicfict...@googlemail.com>
Reply all
Reply to author
Forward
0 new messages