| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| How to run Castor JDO's test suiteOverview Intended Audience Prerequisites 2 versions of CTF Steps to setup environment for old CTF Steps to run old CTF from commandline Steps to run old CTF out of eclipse Short description of the old CTF tests Steps to setup environment for new CTF Steps to run new CTF out of eclipse Troubleshooting References OverviewAt the time of this writing Castor JDO has 3 kinds of test suites:
This document provides general information about running Castor JDO's test suite (CTF). Intended AudienceAnyone who wants to run the CTF test suite. This document outlines the basic steps to get people unfamiliar with this area started. PrerequisitesAnybody wishing to run the CTF test suite should have access to the source code of Castor. This can be obtained in one of the following ways:
2 versions of CTFAt the moment we are in the middle of replacing the old CTF with a new one. While the old CTF still is our reference for refactorings of Castor does the new CTF contain some tests which could not be added to the old one due to its limitations. On the other hand are not all tests ported to the new CTF yet. In the next sections we describe how to setup the environment to execute both CTF versions. While both versions of CTF are designed to be executed against every supported database engine, we will describe things with regard to mysql. Having said that there are only scripts for mysql at the new CTF at the moment. At a later step of the CTF refactoring we will add scripts for other databases as well. In addition we intend to allow its execution with an embedded derby database out of the box, but this have not been implemented yet. For those who might be wondering about the numbering of tests, the numbers of the old tests are just random. The numbers of the new tests are the jira issue numbers. Steps to setup environment for old CTFTo execute tests against mysql database you probably need access to a mysql server. To create a database for CTF, you have to execute the following commands on mysql consol.
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 can be found in "cpactf/src/old/ddl/" directory. For mysql it's "mysql.sql". If you like to use a different name for the database or use other user credential you can adjust them at "cpactf/src/old/resources/jdo/mysql.xml". 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. Another option is to modify "bin/test.sh" or "bin/test.bat" script depended on your operating system. 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. As already explained you will find JDO configurations for every supported database in "cpactf/src/old/resources/jdo". The JDO configurations are named mysql.xml, oracle.xml etc. In the same directory you will also find main mapping file "mapping.xml" that includes all other mappings which are located in the "cpactf/src/old/resources/ctf/jdo/..." directories. There is one more important file for the old tests "cpactf/src/old/resources/tests.xml", it is the main config file which defines which test should be executed against which database engine. As mentioned previously not every test works with every database engine as some missing some features or castor does not support everything of every engine. Steps to run old CTF from commandlineFrom a command line (e.g a shell), please execute the following commands to run the whole test suite against mysql (where <castor-root> points to the directory where you installed the Castor sources:
To execute just one of the many tests of the complete test suite, please change this to:
NOTE: You have to execute "build clean" and "build tests" again if you have changed anything within eclipse (e.g. a configuration file or a class). Steps to run old CTF out of eclipseNow, let's see how we can run these old CPACTF tests through eclipse.
Short description of the old CTF testsAs some features are not supported by all database engines (e.g. sequence keygenerator) or a test have not been verified against a database, only a subset of the following tests will be executed if you run CTF.
Steps to setup environment for new CTFTo execute tests against mysql database you probably need access to a mysql server. To create a database for CTF, you have to execute the following commands on mysql consol.
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. For mysql execute every "mysql.sql" script found in subdirectories of "cpactf/src/test/ddl/" directory. If you like to use a different name for the database or use other user credential you can adjust them at "cpactf/src/test/resources/cpactf-conf.xml". 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. Another option is to modify "bin/test.sh" or "bin/test.bat" script depended on your operating system. 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 run new CTF out of eclipseExecution of the new test suite from within eclipse against mysql is very simple.
In in the configuration file "cpactf-conf.xml" mysql is configuerd as default database. To execute tests against another database engine or to force execution of tests that have been excluded you can pass VM parameter to the test framework. VM Arguments can also be specified in eclipse.
The following VM parameters are supported by CTF.
TroubleshootingFor those who face the following problem in eclipse while executing the tests
It is a problem with memory configured for eclipse. It can be changed in eclipse.ini file which can be found in installation directory of Eclipse. By default it is -Xmx256m, just increase it and problem go away. References
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||