Skip to content

Commit

Permalink
Makes the TCK run against MySQL by default. Seems like all other DBs …
Browse files Browse the repository at this point in the history
…mess up the row ordering and make tests fail randomly.

git-svn-id: https://olap4j.svn.sourceforge.net/svnroot/olap4j/trunk@543 c6a108a4-781c-0410-a6c6-c2d559e19af0
  • Loading branch information
lucboudreau committed Aug 2, 2012
1 parent d5ff50d commit cceb717
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 26 deletions.
12 changes: 2 additions & 10 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ src/org/olap4j/driver/xmla/XmlaOlap4jDriverVersion.java" />
</not>
</condition>

<target name="setup" depends="version-properties,compile,create-dot-classpath,init-foodmart"
<target name="setup" depends="version-properties,compile,create-dot-classpath"
description="Setups the project for eclipse." />

<target name="hudson" depends="clean-all,clean-tests,version-properties,jar,source.jar,tck-jar,xmla-jar,test,jar-jdk14"
Expand Down Expand Up @@ -311,7 +311,7 @@ class XmlaOlap4jDriverVersion {
</delete>
</target>

<target name="init-foodmart" if="init.foodmart">
<target name="init-foodmart" if="init.foodmart" description="Initializes the FoodMart database. Make sure to read and modify test.properties first.">
<pathconvert
property="test.classpath.formatted"
pathsep="${line.separator} "
Expand All @@ -324,10 +324,6 @@ class XmlaOlap4jDriverVersion {
</not>
</condition>
</fail>
<!-- HSQL SPECIFIC: Always clean first because foodmart
might be created when running the tests before calling
init-foodmart. -->
<antcall target="clean-foodmart"/>
<java classname="mondrian.test.loader.MondrianFoodMartLoader" maxmemory="1024m" fork="true">
<classpath refid="test.classpath"/>
<arg value="-verbose"/>
Expand All @@ -344,12 +340,8 @@ class XmlaOlap4jDriverVersion {
<arg value="-outputJdbcUser=${org.olap4j.foodmartLoader.user}"/>
<arg value="-outputJdbcPassword=${org.olap4j.foodmartLoader.password}"/>
</java>
<!-- HSQL SPECIFIC: Delete the lock file. -->
<delete file="${basedir}/foodmart/foodmart.lck" failonerror="false"/>
</target>

<target name="init-tests" depends="subfloor.init-tests,init-foodmart"/>

<!-- Override of subfloor to resolve modules artifacts -->
<target name="resolve" depends="install-ivy,install-antcontrib">

Expand Down
4 changes: 3 additions & 1 deletion ivy-tck.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@

<dependency org="commons-dbcp" name="commons-dbcp" rev="1.1"/>

<dependency org="hsqldb" name="hsqldb" rev="1.8.0.7"/>
<!--dependency org="hsqldb" name="hsqldb" rev="1.8.0.7"/>
<dependency org="com.h2database" name="h2" rev="1.3.168"/-->
<dependency org="mysql" name="mysql-connector-java" rev="5.1.21"/>

<dependency org="commons-pool" name="commons-pool" rev="1.1"/>

Expand Down
33 changes: 18 additions & 15 deletions test.properties
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
###############################################################################
# This activates the Mondrian in-process tester.
# It is the default in-process Mondrian tester.
# By default, it will use a file based HSQLDB in the
# /foodmart folder. If you want to test olap4j against
# By default, it will use a MySQL database containing
# the Foodmart database. If you want to test olap4j against
# a different database, edit 'org.olap4j.test.connectUrl'

org.olap4j.test.helperClassName=mondrian.test.MondrianOlap4jTester
Expand Down Expand Up @@ -87,27 +87,30 @@ org.olap4j.test.helperClassName=mondrian.test.MondrianOlap4jTester
# tester, or if your Foodmart is deployed on another DBMS.
# If you deploy Foodmart in another DBMS and you modify this line,
# you might want to set 'org.olap4j.foodmartLoader.disabled' down below.
org.olap4j.test.connectUrl=jdbc\:mondrian\:Catalog\=./foodmart/FoodMart.xml;;JdbcDriver\=org.hsqldb.jdbcDriver;Jdbc\=jdbc\:hsqldb\:file\:foodmart/foodmart;JdbcUser\=sa;JdbcPassword\=
org.olap4j.test.connectUrl=jdbc\:mondrian\:Catalog\=./foodmart/FoodMart.xml;JdbcDrivers\=com.mysql.jdbc.Driver;Jdbc\=jdbc\:mysql\://localhost\:3306/foodmart;JdbcUser\=foodmart;JdbcPassword\=foodmart

# This is an example URL for Foodmart deployed in MySQL.
# This is an example URL for Foodmart deployed in HSQL.
# You will need to add a JAR driver into the 'dev-lib' folder
# for it to work.
#org.olap4j.test.connectUrl=jdbc\:mondrian\:Catalog\=./foodmart/FoodMart.xml;;JdbcDriver\=com.mysql.jdbc.Driver;Jdbc\=jdbc\:mysql\://localhost\:3306/foodmart;JdbcUser\=foodmart;JdbcPassword\=foodmart
#org.olap4j.test.connectUrl=jdbc\:mondrian\:Catalog\=./foodmart/FoodMart.xml;;JdbcDriver\=org.hsqldb.jdbcDriver;Jdbc\=jdbc\:hsqldb\:file\:foodmart/foodmart;JdbcUser\=sa;JdbcPassword\=

###############################################################################
# These properties allow the build script to load FoodMart into
# an HSQLDB database so it can run the tests.
# It only gets executed once, or after invocations of 'clean-all'.
# It is possible to make this script deploy Foodmart in another
# a database so it can run the tests.
# It is possible to make this script deploy Foodmart in a
# DBMS and run the tests against it, but it needs some hacking.
# You would need to tweak 'org.olap4j.test.connectUrl' and
# The Ant targets to clean/deploy Foodmart are 'clean-foodmart'
# and 'init-foodmart'.
# You also need to tweak 'org.olap4j.test.connectUrl' and
# disable some checks in build.xml.
org.olap4j.foodmartLoader.driver=org.hsqldb.jdbcDriver
org.olap4j.foodmartLoader.url=jdbc\:hsqldb\:file\:foodmart/foodmart
org.olap4j.foodmartLoader.user=sa
org.olap4j.foodmartLoader.password=
# You can disable the loader altogether by uncommenting this line.
#org.olap4j.foodmartLoader.disabled=true

#org.olap4j.foodmartLoader.driver=com.mysql.jdbc.Driver
#org.olap4j.foodmartLoader.url=jdbc\:mysql\://localhost\:3306/foodmart
#org.olap4j.foodmartLoader.user=foodmart
#org.olap4j.foodmartLoader.password=foodmart

# You can enable the loader by uncommenting this line.
org.olap4j.foodmartLoader.disabled=true

###############################################################################
# End test.properties

0 comments on commit cceb717

Please sign in to comment.