PlugIns.JdbcSlim.UserGuide.3HowtoConfigureTheDatabaseConnection.FeatureOverviewOfPropertyFilesAndTables

PlugIns JdbcSlim UserGuide 3HowtoConfigureTheDatabaseConnection



Tests should be focused on requirements and in business users language.
On the other hand to implement the tests often additional configuration data is required.
To keep these separate Define Properties can be used.
They are like property files used commonly in Java.
They define key value pairs of strings

Define Properties have the following advantages:
* Properties can be defined on Wiki pages
* Properties can be defined in files
* Multiple property definitions can be merged into one big definition
* Properties like passwords can be encrypted
* A summary of all definitions can be added to the test results to track how the test was performed
* Slim Symbols or Wiki Variables can be used to switch between different sets of properties


Contents:


This page tests the combination of properties definition on this Fitnesse test page plus in a properties file. From the file again a definition
on the wiki page is referenced.

The definitions are then used/printed in a Sheet Fixture to confirm the correctness.

The following rules applies

To test this page you need a file with the following content:

File Content

Version=v20131230

jdbcDriver=com.sybase.jdbc4.jdbc.SybDriver
DBURL=jdbc:sybase:Tds:localhost/master
DBUSER=sa
DBPASSWORD=password
.include=SubDefinition
multiLine="""
Line1
Line2
Line3
"""
nextKey=Something Else

The file must be named as defined in the following variable:
variable defined: DefinitionFileName=${TestDbPath}definition.properties



Define Properties TopDefinition
key value
cmd myCommand with %NAME%, %CITY%, %AGE%
DEBUG
COMMAND YES
.include ./plugins/jdbcslim/TestDB/definition.properties
multiLine2 Hello World

The below "SubDefinition" will be included from the above file


Define Properties SubDefinition
key value
SORT 1,2,3,4
format.date YYYY-MM-DD
version OverwrittenFromSubDefintion

Check that all the content is now available
Table: SheetCommandBase TopDefinition SORT
Key?<1 Value?
cmd myCommand with %NAME%, %CITY%, %AGE%
command YES
dbpassword password
dburl jdbc:sybase:Tds:localhost/master
dbuser sa
debug
format.date YYYY-MM-DD
jdbcdriver com.sybase.jdbc4.jdbc.SybDriver
multiline Line1 Line2 Line3
multiline2 Hello World
nextkey Something Else
sort
version OverwrittenFromSubDefintion