Skip to content

Commit

Permalink
MONDRIAN: If username and password were not set, connect string conta…
Browse files Browse the repository at this point in the history
…ined bogus values for JdbcUser and JdbcPassword properties. As a result, tests against Oracle were failing.

[git-p4: depot-paths = "//open/mondrian/": change = 3587]
  • Loading branch information
julianhyde committed May 16, 2005
1 parent 701c9b8 commit 15e1ba1
Showing 1 changed file with 33 additions and 6 deletions.
39 changes: 33 additions & 6 deletions build.xml
Expand Up @@ -307,8 +307,35 @@ unzip-FoodMartAccessDB"/>
"mondrian.foodmart.catalogURL" properties. The easiest way to
do this is to edit the file "build.properties". -->

<target name="set.connectString">
<!-- Ensure that the JdbcUser parameter is only added to the connect string
if the mondrian.foodmart.jdbcUser property is set. Likewise
JdbcPassword. -->
<condition property="jdbcUser"
value=";JdbcUser='${mondrian.foodmart.jdbcUser}'">
<isset property="mondrian.foodmart.jdbcUser"/>
</condition>
<condition property="jdbcUser" value="">
<not>
<isset property="mondrian.foodmart.jdbcUser"/>
</not>
</condition>
<condition property="jdbcPassword"
value=";JdbcPassword='${mondrian.foodmart.jdbcPassword}'">
<isset property="mondrian.foodmart.jdbcPassword"/>
</condition>
<condition property="jdbcPassword" value="">
<not>
<isset property="mondrian.foodmart.jdbcPassword"/>
</not>
</condition>
<property name="mondrian.test.connectString"
value="Provider=mondrian;Jdbc='${mondrian.foodmart.jdbcURL}'${jdbcUser}${jdbcPassword};Catalog='${mondrian.foodmart.catalogURL}'"/>
</target>

<target name="FoodMartTest"
description="Runs a few queries using the FoodMart schema.">
description="Runs a few queries using the FoodMart schema."
depends="set.connectString">
<java classpathref="project.classpath" classname="mondrian.test.Main"
fork="yes">

Expand All @@ -320,7 +347,7 @@ unzip-FoodMartAccessDB"/>
<!-- mondrian.test.connectString is the mondrian connect-string.
Provider must be 'mondrian'. -->
<sysproperty key="mondrian.test.connectString"
value="Provider=mondrian;Jdbc='${mondrian.foodmart.jdbcURL}';Catalog='${mondrian.foodmart.catalogURL}';JdbcUser='${mondrian.foodmart.jdbcUser}';JdbcPassword='${mondrian.foodmart.jdbcPassword}'"/>
value="${mondrian.test.connectString}"/>

</java>
</target>
Expand All @@ -330,7 +357,7 @@ unzip-FoodMartAccessDB"/>
<antcall target="test-dbms"/>
</target>

<target name="test-dbms" depends="compile,compile.tests"
<target name="test-dbms" depends="compile,compile.tests,set.connectString"
description="
Runs all JUnit tests, using the given database connection
in {mondrian.foodmart.jdbcURL}.">
Expand All @@ -347,15 +374,15 @@ in {mondrian.foodmart.jdbcURL}.">
<sysproperty key="mondrian.test.foodmart.catalogURL"
value="${mondrian.foodmart.catalogURL}"/>
<sysproperty key="mondrian.test.connectString"
value="Provider=mondrian;Jdbc='${mondrian.foodmart.jdbcURL}';JdbcUser='${mondrian.foodmart.jdbcUser}';JdbcPassword='${mondrian.foodmart.jdbcPassword}';Catalog='${mondrian.foodmart.catalogURL}'"/>
value="${mondrian.test.connectString}"/>
<!-- tests require en_US locale -->
<sysproperty key="user.language" value="en"/>
<sysproperty key="user.region" value="US"/>

</java>
</target>

<target name="junit-main" depends="compile,compile.tests">
<target name="junit-main" depends="compile,compile.tests,set.connectString">
<mkdir dir="junit-results"/>
<junit printsummary="yes" fork="yes" haltonfailure="yes" haltonerror="yes">
<classpath>
Expand All @@ -367,7 +394,7 @@ in {mondrian.foodmart.jdbcURL}.">
<sysproperty key="mondrian.jdbcDrivers"
value="${mondrian.jdbcDrivers}"/>
<sysproperty key="mondrian.test.connectString"
value="Provider=mondrian;Jdbc='${mondrian.foodmart.jdbcURL}';Catalog='${mondrian.foodmart.catalogURL}'"/>
value="${mondrian.test.connectString}"/>
<sysproperty key="mondrian.test.foodmart.catalogURL"
value="${mondrian.foodmart.catalogURL}"/>

Expand Down

0 comments on commit 15e1ba1

Please sign in to comment.