Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

61 lines (35 sloc) 2.566 kb

Creating test database

By default unit tests use MySQL database but PostgreSQL and Oracle databases are supported as well. Set MONDRIAN_DRIVER environment variable to “mysql” (default), “postgresql”, “oracle” or “luciddb” to specify database driver that should be used.

If using MySQL or PostgreSQL database then create database user mondrian_test with password mondrian_test, create database mondrian_test and grant full access to this database for mondrian_test user. By default it is assumed that database is located on localhost (can be overridden with DATABASE_HOST environment variable).

If using Oracle database then create database user mondrian_test with password mondrian_test. By default it is assumed that database orcl is located on localhost (can be overridden with DATABASE_NAME and DATABASE_HOST environment variables).

If using LucidDB database then create schema MONDRIAN_TEST and create user MONDRIAN_TEST with password mondrian_test and with default schema MONDRIAN_TEST. By default it is assumed that database is located on localhost (can be overridden with DATABASE_HOST environment variable).

See spec/spec_helper.rb for details of default connection parameters and how to override them.

Creating test data

Install necessary gems with

bundle install

Create tables with test data using

rake db:create_data

or specify which database driver to use

rake db:create_data MONDRIAN_DRIVER=mysql
rake db:create_data MONDRIAN_DRIVER=postgresql
rake db:create_data MONDRIAN_DRIVER=oracle

In case of LucidDB data are not generated and inserted directly into database but are imported from MySQL mondrian_test database (because inserting individual records into LucidDB is very inefficient). Therefore at first generate test data with mysql (using default database settings) and then run data creation task for LucidDB.

rake db:create_data MONDRIAN_DRIVER=mysql
rake db:create_data MONDRIAN_DRIVER=luciddb

Running tests

Run tests with

rake spec

or specify which database driver to use

rake spec MONDRIAN_DRIVER=mysql
rake spec MONDRIAN_DRIVER=postgresql
rake spec MONDRIAN_DRIVER=oracle
rake spec MONDRIAN_DRIVER=luciddb

or also alternatively with

rake spec:mysql
rake spec:postgresql
rake spec:oracle
rake spec:luciddb

You can also run all tests on all databases with

rake spec:all

JRuby versions

It is recommended to use RVM (rvm.beginrescueend.com) to run tests with different JRuby implementations. mondrian-olap is being tested with latest versions of JRuby 1.6 on Java 6.

Jump to Line
Something went wrong with that request. Please try again.