[Mondrian] how to run the standard test suite of Mondrian

Luc Boudreau lucboudreau at gmail.com
Tue Apr 5 09:35:06 EDT 2011


Gentlemen,

I use Eclipse to work on Mondrian. Here are some tips.

Once you have imported the project into Eclipse, run the ant targets: "clean
compile compile.tests". This will do a few things for you. It will resolve
all artifacts and place them in the 'lib' and 'testlib' folders. Then it
will generate the parser and the message files. Once you have done that, you
can refresh the project from within Eclipse, and everything should build,
with the exception of the JDBC4 driver. You can safely ignore it, as the
runtime execution path will fork to the proper JDBC driver for the Java
version you are running against.

To run the test suite, you need to create a 'Run Configuration' which will
execute a single test class: 'mondrian.test.Main'. This test class will in
turn configure some stuff and call all the other tests. I suggest adding the
following JVM arguments to your run configuration: '-Xms512m -Xmx1024m'.

You should also take a look inside the file called 'mondrian.properties' at
the root of the project. You will need to use read this file and uncomment
the proper lines so Mondrian can test against a FoodMart database isntalled
on your machine. If you don't have the FoodMart database configured, you can
easily load it into your RDBMS. Look in Mondrian sources, there should be a
folder called 'demo'. Inside that folder are some examples of scripts to
import the data. Here's how to import the data for MySQL. First, create a
batch file. Call it whatever you fancy, but in there, add the following
commands:

-------------------------------------------------------------------------------------------
@echo off
set
CP=../lib/commons-dbcp.jar;../lib/commons-collections.jar;../lib/commons-pool.jar;../lib/commons-logging.jar
set
CP=%CP%;../lib/eigenbase-properties.jar;../lib/eigenbase-resgen.jar;../lib/eigenbase-xom.jar
set CP=%CP%;../lib/javacup.jar;../lib/mondrian.jar
set CP=%CP%;../lib/log4j.jar
set CP=%CP%;../dev-lib/mysql-connector-java-5.1.5-bin.jar
rem set CP=%CP%;../testlib/postgresql-driver-jdbc3-74-214.jar
rem set CP=%CP%;../testlib/jtds-1.2.jar

java -Xms100m -Xmx500m -cp "%CP%"
mondrian.test.loader.MondrianFoodMartLoader -verbose -aggregates -tables
-data -indexes
-inputFile="C:/workspace-olap4j/luc-mondrian-3.2/open/mondrian-release/3.2/demo/FoodMartCreateData.sql"
-jdbcDrivers=com.mysql.jdbc.Driver
-outputJdbcURL="jdbc:mysql://localhost:3306/foodmart"
-outputJdbcUser=foodmart -outputJdbcPassword=foodmart
-------------------------------------------------------------------------------------------

You might need to change the user/password/host, but you'll manage. If you
did deploy the data in MySQL, make sure that the contents of
mondrian.properties reflect that.

The only gotcha that I know of is when Eclipse decides to wipe out the class
output folders, it erases the generated resources as well. You might need to
re-run the ant target called generate.resources.

This should be it. If you have any other issues, let me know.

Luc


On Tue, Apr 5, 2011 at 6:42 AM, Michele Rossi <michele.rossi at gmail.com>wrote:

> Hi,
> I am having similar issues, I think it's a bit tricky to work on Mondrian
> in Eclipse.
> Perhaps most of the problems are to do with the fact that Mondrian supports
> both JDBC 3.0 and JDBC 4.0 at the same time.
>
> Julian - is supporting JDBC 3.0 and older versions of Java still a strong
> requirement?
>
> Perhaps at some point we could drop the support for Java 5.0 and people
> that don't want to upgrade could always use old versions of Mondrian?
> After all Java 6.0 with JDBC 4.0 was released in December 2006, 4 years and
> 4 months ago.
>
> If we did that and used Maven we would obtain automatic eclipse
> integration.
> You could change a line of code, hit ctrl+s and run your tests again from
> eclipse to verify that your new code works.
>
> I only mean to throw in some ideas, not to criticise - I think that
> Mondrian is great!
>
> thanks,
> Michele
>
>
> On 5 April 2011 12:32, Venkatesh U <venkatesh20 at gmail.com> wrote:
>
>> Hi,
>>  I have setup the mondrian code in eclipse and I run the build.xml to
>> build the project. I could debug and run cmdRunner successfully. But when i
>> also link the testsrc folder, there are lot of errors in the project. How to
>> run the standard test suite and verify the test results. I am sorry if this
>> is some thing very simple and obvious.
>>
>> Thanks,
>> Venki
>>
>> _______________________________________________
>> Mondrian mailing list
>> Mondrian at pentaho.org
>> http://lists.pentaho.org/mailman/listinfo/mondrian
>>
>>
>
> _______________________________________________
> Mondrian mailing list
> Mondrian at pentaho.org
> http://lists.pentaho.org/mailman/listinfo/mondrian
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.pentaho.org/pipermail/mondrian/attachments/20110405/e200e4f8/attachment.html 


More information about the Mondrian mailing list