PDA

View Full Version : [Mondrian] consolidation of approaches to diff-based testing



John V. Sichi
02-28-2007, 11:41 PM
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 (DOT) com>
To: Andreas Voss <tonbeller (AT) a-voss (DOT) de>, Bart Pappyn
<bppn (AT) users (DOT) sourceforge.net>, Hartmut Haas <Hartmut_Haas (AT) tonbeller (DOT) com>,
Julian Hyde <jhyde (AT) users (DOT) sourceforge.net>, John V. Sichi
<jsichi (AT) gmail (DOT) com>, Kinkoi Lo <kinkoi (AT) gmail (DOT) com>, Matt Campbell
<Matthew.Campbell (AT) thomson (DOT) com>, Sam Birney <sbirney (AT) jaspersoft (DOT) com>

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

Change 8805 by jvs (AT) jvs (DOT) 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)
_______________________________________________
Mondrian mailing list
Mondrian (AT) pentaho (DOT) org
http://lists.pentaho.org/mailman/listinfo/mondrian