Skip to content

Configuration

timfarr edited this page May 18, 2011 · 16 revisions

Configuration

Once Madcow is setup and running correctly, the configuration files within the conf directory will need to be changed for the particular site that you are working on.

## URL Configuration To assist in managing multiple target environments, Madcow supports single or multiple URL property files. These property files are used to substitute the URL being invoked by the Invoke Url command.

Single URL Property File

For instance, having a hard-coded URL for a Create Address page,

invokeUrl = http://test-site/address/create

can be expressed as

invokeUrl = TEST_SITE/address/create

where the TEST_SITE key is defined in the URL mappings file

TEST_SITE=http://test-site

For this example, when Madcow is executing the invokeUrl command, it will substitute TEST_SITE with http://test-site

Filename format

For a single URL property file, it must be named madcow.url.properties. There is no restriction on the number of key/value pairs in the property file.

Multiple URL Property Files

As Madcow supports multiple URL properties files, you can therefore have a collection of url files, each with a unique URL, using the same identification key to allow quick switching between target environments, without any need to change individual invokeUrl commands.

Each URL property file must be suffixed with .madcow.url.properties, however, when specifying which to use, it is only the name in front of the .madcow.url.properties postfix that is used.

So if we had two URL property files, one named development.madcow.url.properties and the other integrated.madcow.url.properties, they are referred to by development and integrated respectively.

In order to specify which URL property file to use, set the URL filename on the command line / set the relevant ant property.

Using the shell script:

./runMadcow.sh -u development
./runMadcow.sh -u integrated

Or as an ant property:

ant run-all-tests -Dmadcow.url.properties.file="development"
ant run-all-tests -Dmadcow.url.properties.file="integrated"

Filename format

For multiple URL property files, each must be suffixed with .madcow.url.properties. There is no restriction on the number of key/value pairs in the property file.

Database Configuration

The Madcow Execute SQL step allows the user execute a given SQL script into a database under test. In order to facilitate this process, Madcow will attempt to find a database properties file containing the database connection details. Madcow supports having either a single or multiple database property files.

###A single database properties file### By default, Madcow will attempt to load database properties from a file called madcow.database.properties. If only one environment is going to be tested against, then add the database properties to this file in the conf directory.

###Multiple database properties files If Madcow will be run against multiple environments, it's advisable to keep a separate database properties file for each environment.

Each database property file must be suffixed with .madcow.database.properties, and only the part of the filename in front of .madcow.database.properties needs to be supplied when specifying which properties file to use.

So, if we had two database property files, one named development.madcow.database.properties and the other integrated.madcow.database.properties, they are referred to by development and integrated respectively.

In order to specify which database properties file to use, the filename needs to be specified when running Madcow.

Using the shell script:

./runMadcow.sh -d development
./runMadcow.sh -d integrated

Or as an ant property:

ant run-all-tests -Dmadcow.database.properties.file="development"
ant run-all-tests -Dmadcow.database.properties.file="integrated"

###Required configurables### The following example file shows all of the properties that need to be set in order to have Madcow utilise database connectivity. {code title="Example madcow.database.properties"} jdbc.className=com.mysql.jdbc.Driver jdbc.url=jdbc:mysql://localhost:3306/madcowdatabase jdbc.user=madcowuser jdbc.password=madcowpassword {code}

Clone this wiki locally