[Mondrian] consolidation of approaches to diff-based testing

John V. Sichi jsichi at gmail.com
Wed Feb 28 22:34:10 EST 2007


Per Julian's request, the change below replaces two earlier file-based 
diffing approaches used in the XML/A tests.  The replacement approach is 
uniform usage of DiffRepository.  Now there is one .ref.xml file per 
test class; the individual resource/ref files have been deleted.  In 
passing, I also squelched stderr from XmlaErrorTest, so you should no 
longer see that noise in the JUnit ... output of ant test.

There were two wrinkles:

1.  DiffRepository doesn't currently support test-global resources (only 
per testcase) so I just duplicated the resources that were previously 
aliased to the same file.  Those were small resources and there were 
only a few of them.  I preserved the original filenames as the resource 
names, so it should be easy to find them if anyone enhances 
DiffRepository later.

2.  I got rid of the ServletContext support, since there was no test 
case actually making use of it.

XmlaTest remains dynamic (if you add a new testcase to the corresponding 
.ref.xml file, it will be run automatically), whereas the other Xmla 
tests remain static (you have to add a test method explicitly to the 
.java file).

The change also converts ClearViewTest to use DiffRepository; many more 
test cases will be added there soon.

For ClearViewTest, I also added a new ant target 
"generateDiffRepositoryJUnit".  This uses XSL to transform 
ClearViewTest.ref.xml into a corresponding file ClearViewJUnit.java in 
the same directory; it looks the same as the original ClearViewTest.java 
before I converted it, so you can use that to debug a test case in your 
IDE, see the test data/input inline, etc.

JVS

-------- Original Message --------
Subject: Eigenbase perforce change 8805 for review
Date: Wed, 28 Feb 2007 16:02:02 -0800 (PST)
From: John V. Sichi <jsichi at gmail.com>
To: Andreas Voss <tonbeller at a-voss.de>, Bart Pappyn 
<bppn at users.sourceforge.net>, Hartmut Haas <Hartmut_Haas at tonbeller.com>, 
Julian Hyde <jhyde at users.sourceforge.net>, John V. Sichi 
<jsichi at gmail.com>, Kinkoi Lo <kinkoi at gmail.com>, Matt Campbell 
<Matthew.Campbell at thomson.com>, Sam Birney <sbirney at jaspersoft.com>

http://p4web.eigenbase.org/@md=d&c=6PU@//8805?ac=10

Change 8805 by jvs at jvs.kotick.eigenbase on 2007/02/28 16:00:39

	MONDRIAN:  finish conversion of all XML/A tests to use DiffRepository;
	convert ClearViewTest to use DiffRepository; add XSL for
	converting ClearViewTest back to inlined Java form;
	enhance DiffRepository to support setting testcase name
	explicitly via ThreadLocal (instead of relying on crawling
	up the stack, which doesn't work for dynamic suites)



More information about the Mondrian mailing list