[Mondrian] JUnit test cross-talk
julianhyde at speakeasy.net
Thu Mar 15 22:06:49 EDT 2007
> Is there a way for these two tests to create
> temporary dimensions, run their tests, and
> the remove the dimensions after their tests
Yes! Use a sub-class of TestContext which reads a modified version of
FoodMart as it creates its connection.
Use the TestContext.create() and TestContext.createSubstitutingCube()
methods. See SchemaTest for examples.
I've been intending to clean up tests which use createCube and
createDimension - and also to remove mutant definitions in Foodmart.xml,
such as "Sales 2" and "Sales Ragged" - but I never got round to it.
> -----Original Message-----
> From: mondrian-bounces at pentaho.org
> [mailto:mondrian-bounces at pentaho.org] On Behalf Of Richard Emberson
> Sent: Tuesday, March 13, 2007 8:11 AM
> To: Mondrian developer mailing list
> Subject: [Mondrian] JUnit test cross-talk
> The junit tests testAllMemberCaption and
> testAllLevelName in the file BasicQueryTest.java
> create Dimensions in the Sales cube, Gender3 and
> Gender4 respectfully. For all subsequent
> JUnit tests these dimensions are a part of the
> the Sales cube definition.
> This is junit test cross-talk.
> I assume that junit tests with side-effects are
> not a good thing.
> Quis custodiet ipsos custodes:
> This email message is for the sole use of the intended
> recipient(s) and
> may contain confidential information. Any unauthorized review, use,
> disclosure or distribution is prohibited. If you are not the intended
> recipient, please contact the sender by reply email and destroy all
> copies of the original message.
> Mondrian mailing list
> Mondrian at pentaho.org
More information about the Mondrian