Installation
From ServiceFixture
Contents |
[edit]
Install ServiceFixture and FitNesse Bundle
- Download servicefixture-0.9-fitnesse20060719-bundle.zip from download page.
- Unzip the file.
- Make sure you have JDK 1.5.0_x installed and JDK bin directory is added to PATH env variable.
- Go to folder where the file is unzipped in command window(Windows) or terminal window(Unix), execute run.bat or run.sh. You should see:
- Open your favorite internet browser, go to: http://localhost, you should see:
- Go to: http://localhost/ServiceFixture or click ServiceFixture link on the front page, you should see:
And if you run the suite test, you will get:
- To try out template creator, edit the page, and pick one of fixtures in the drop down list, scroll down to the end of edit box. You should see following if you select net.servicefixture.sample.service.fixture.CreateProduct:
!|net.servicefixture.sample.service.fixture.CreateProduct|
|set|product|${type:net.servicefixture.sample.domain.Book}|
|set|product.numberOfPages|0|
|set|product.availability|IN_STOCK;OUT_OF_STOCK;NOT_SUPPLIED;|
|set|product.publishDate|${date.after(0)}|
|set|product.productId|0|
|set|product.price|0|
|set|product.description|String|
|set|product.isbn|String|
|set|product.name|String|
|set|product.authors|String|
|set|product|${type:net.servicefixture.sample.domain.Computer}|
|set|product.memory|0|
|set|product.monitorSize|0|
|set|product.availability|IN_STOCK;OUT_OF_STOCK;NOT_SUPPLIED;|
|set|product.productId|0|
|set|product.price|0|
|set|product.description|String|
|set|product.name|String|
|set|product|${type:net.servicefixture.sample.domain.Software}|
|set|product.platforms[0]|java.lang.Object|
|set|product.availability|IN_STOCK;OUT_OF_STOCK;NOT_SUPPLIED;|
|set|product.productId|0|
|set|product.price|0|
|set|product.description|String|
|set|product.media|String|
|set|product.name|String|
|set|product.itemQuantity|0|
|invoke||
|check|response != null|true|
|check|response.productId||
|check|response.name||
Notes about the above test table template:
- Since the first parameter type of CreateProduct operation in Product Service is Product which is an abstract type, template creator creates the templates for all of its derived classes: Computer and Software, you need just to pick one for the test script.
- availability attribute of Product class is of java.util.Enum type, so all the valid values are generated in the template separated by semi-colon, IN_STOCK;OUT_OF_STOCK;NOT_SUPPLIED;, just pick one of the values for the test.
[edit]
Install ServiceFixture on existing FitNesse Instance
[edit]
Configure ServiceFixture
- Download servicefixture-with-dependencies-0.9.zip from download page.
- Create a folder servicefixture in FitNesse home directory
- Unzip the servicefixture-with-dependencies-0.9.zip to above folder.
- Edit root page of your test scripts, and add following:
!path . !path ./servicefixture/servicefixture-0.9.jar !path ./servicefixture/commons-beanutils-1.7.0.jar !path ./servicefixture/commons-jexl-1.0.jar !path ./servicefixture/commons-lang-2.1.jar !path ./servicefixture/commons-logging-1.0.4.jar
[edit]
Configure ServiceFixture database fixtures
- Create servicefixture.properties in FitNesse home directory if it doesn't exist.
- Add database configuration to servicefixture.properties, following are sample configuration:
servicefixture.db.default.url=jdbc:hsqldb:mem:memDB servicefixture.db.default.user=sa servicefixture.db.default.password= servicefixture.db.default.driver=org.hsqldb.jdbcDriver servicefixture.db.memdb.url=jdbc:hsqldb:mem:memDB servicefixture.db.memdb.user=sa servicefixture.db.memdb.password= servicefixture.db.memdb.driver=org.hsqldb.jdbcDriver
- Edit the root page of your test scripts, add the jdbc driver library to the path.
[edit]
Configure ServiceFixture template creator
- Edit run.bat(Windows) or run.sh(Unix).
- Add ./servicefixture/servicefixture-0.9.jar;./servicefixture/jcifs-1.2.9.jar;./servicefixture/commons-lang-2.1.jar to the classpath.
- Create plugins.properties in FitNesse home directory if it doesn't exist.
- Add this line to plugins.properties:
Responders=tableWizard:net.servicefixture.fitnesse.TableWizardResponder
- Edit the root page of your test scripts, add the fixtures, for example:
!fixture net.servicefixture.sample.service.fixture.CreateProduct !fixture net.servicefixture.sample.service.fixture.GetProductDetail !fixture net.servicefixture.sample.service.fixture.ListAllProducts !fixture net.servicefixture.sample.service.fixture.ListProducts !fixture net.servicefixture.sample.service.fixture.CreateCustomer
- The above fixtures should show up in the drop down list when you edit a test page.
