|  |  |  | License Codehaus OpenEJB OpenJMS OpenORB Tyrex

Old releases
General
Release 1.3
Release 1.3rc1
Release 1.2

Main
Home
About
Features
Download
Dependencies
Reference guide
Publications
JavaDoc
Maven 2 support
Maven 2 archetypes
DTD & Schemas
Recent HTML changes
News Archive
RSS news feed
Project Wiki

Development/Support
Mailing Lists
SVN/JIRA
Contributing
Support
Continuous builds
Prof. services

Related projects
Spring ORM support
Spring XML factories
WS frameworks

XML
XML

XML Code Generator
XML Code Generator

JDO
Introduction
First steps
Using JDO
JDO Config
Types
JDO Mapping
JDO FAQ
JDO Examples
JDO HOW-TOs
Tips & Tricks
Other Features
JDO sample JAR

Tools
Schema generator

Advanced JDO
Caching
OQL
Trans. & Locks
Design
KeyGen
Long Trans.
Nested Attrs.
Pooling Examples
LOBs
Best practice

DDL Generator
Using DDL Generator
Properties
Ant task
Type Mapping

More
The Examples
3rd Party Tools
JDO Tests
XML Tests
Configuration

About
License
User stories
Contributors
Marketplace
Status, Todo
Changelog
Library
Contact
Project Name

## How to run Castor JDO's performance tests

Overview
Prerequisites
Steps to setup environment for old CTF
Steps to execute performance tests in eclipse
References

## Overview

At the time of this writing Castor JDO has 3 kinds of test suites:

- | Database independend plan unit tests.
- | A JUnit based test suite that is used to test various functional areas against different database engines to give developers/committers some reassurance when changing the codebase.
- | A Junit based test suite to evaluate impact of changes on performance.

This document provides general information about running Castor JDO's performance tests.

## Prerequisites

See: How to setup Castor project in eclipse

## Steps to setup environment for old CTF

To execute performance tests against mysql database you probably need access to a mysql server. To create a database for PTF, you have to execute the following commands on mysql consol.

    # create database cpaptf;
    # grant all on cpaptf.* at "localhost" to "test" identified by "test";
    # use cpaptf;
    # source [path-to-script];

If the server is not installed on your local maschine (the one you execute the tests on) you have to replace "localhost" with the IP of the maschine the tests get executed on. The script to execute is "cpaptf/src/test/ddl/mysql.sql".

As we do not include JDBC drivers for every database with Castor you also have to add the driver you like to use to your classpath to execute the tests. The easiest way is to copy the driver to "lib/" directory as all jar's contained therein are added automatically.

For mysql we still use "mysql-connector-java-3.1.13-bin", also for mysql server of version 5. This version has proven to be stable. While other versions of mysql connector may also work, some of them have bugs from our experience.

## Steps to execute performance tests in eclipse

Execution of the performance test suite from within eclipse is very simple.

- | Select "cpaptf/src/test/java" -> "org.castor.cpaptf" -> "TestAll.java" and right click
- | Select "Run As" -> "JUnit Test"

By defeult the test uses 2000 service objects that get created, loaded with various configurations and deleted afterwords. Obviously this will take quite some time. Please be patient for normal termination of the tests as you will need to clean test tables by hand otherwise. To execute tests with a different number of objects you can adjust "FACTOR" constant in "TestCreate.java". For example, if you set "Factor" to 1.0 the tests will be executed with 10000 service objects. When using more test objects be aware that you may need to increase heap size of the virtual maschine for the test to finish.

By default you won't see any output of results on the consol as logging level of log4j is set to "warn" by default. But if you change log level of "org.castor.cpaptf" package to "info" you will see detailed execution times for every test on the consol. Be aware that there are quite some log4j.xml configurations in the whole Castor project at the moment of which the one first one on classpath will be used.

If you like to review some older test results you will find them under "cpaptf/src/site/resources/results/" but they depend heavy on the machine you are running the tests on.

## References

- | How to setup Castor project in eclipse

<notice> Copyright © 1999-2005 ExoLab Group, Intalio Inc., and Contributors. All rights reserved. </notice>
<notice> Java, EJB, JDBC, JNDI, JTA, Sun, Sun Microsystems are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and in other countries. XML, XML Schema, XSLT and related standards are trademarks or registered trademarks of MIT, INRIA, Keio or others, and a product of the World Wide Web Consortium. All other product names mentioned herein are trademarks of their respective owners. </notice>