Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MONDRIAN: adds clearview Solve Order test; enhances ClearViewBase and…
… generateDiffRepositoryJUnit.xsl to support creating calculatedMember; replaces the double-checking pattern for syncrhonization in TestContext [git-p4: depot-paths = "//open/mondrian/": change = 9100]
- Loading branch information
Khanh Vu
committed
Apr 13, 2007
1 parent
b36c970
commit 8e4164f
Showing
7 changed files
with
220 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
// $Id$ | ||
// This software is subject to the terms of the Common Public License | ||
// Agreement, available at the following URL: | ||
// http://www.opensource.org/licenses/cpl.html. | ||
// Copyright (C) 2007 Julian Hyde and others | ||
// All Rights Reserved. | ||
// You must accept the terms of that agreement to use this software. | ||
// | ||
*/ | ||
package mondrian.test.clearview; | ||
|
||
import junit.framework.*; | ||
|
||
import mondrian.test.*; | ||
|
||
/** | ||
* <code>MiscTest</code> is a test suite which tests miscellaneous | ||
* complex queries against the FoodMart database. MDX queries and their | ||
* expected results are maintained separately in MiscTest.ref.xml file. | ||
* If you would prefer to see them as inlined Java string literals, run | ||
* ant target "generateDiffRepositoryJUnit" and then use | ||
* file MiscTestJUnit.java which will be generated in this directory. | ||
* | ||
* @author Khanh Vu | ||
* @version $Id$ | ||
*/ | ||
public class MiscTest extends ClearViewBase { | ||
|
||
public MiscTest() { | ||
super(); | ||
} | ||
|
||
public MiscTest(String name) { | ||
super(name); | ||
} | ||
|
||
protected DiffRepository getDiffRepos() { | ||
return getDiffReposStatic(); | ||
} | ||
|
||
private static DiffRepository getDiffReposStatic() { | ||
return DiffRepository.lookup(MiscTest.class); | ||
} | ||
|
||
public static TestSuite suite() { | ||
return constructSuite(getDiffReposStatic(), MiscTest.class); | ||
} | ||
|
||
} | ||
|
||
// End MiscTest.java |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
<?xml version="1.0" ?> | ||
<Root> | ||
<TestCase name="testSolveOrder"> | ||
<Resource name="description"> | ||
<![CDATA[ | ||
Tests that solve order is correctly generated such that max is applied on top of rank on top of ratio measure. | ||
]]> | ||
</Resource> | ||
<Resource name="modifiedCubeName"> | ||
<![CDATA[ | ||
Sales | ||
]]> | ||
</Resource> | ||
<Resource name="calculatedMembers"> | ||
<![CDATA[ | ||
<CalculatedMember | ||
name='Sales as % of Cost' | ||
dimension='Measures' | ||
formula='([Measures].[Store Sales] - [Measures].[Store Cost])/[Measures].[Store Cost]'> | ||
<CalculatedMemberProperty name='FORMAT_STRING' value='####0.0%'/> | ||
</CalculatedMember> | ||
]]> | ||
</Resource> | ||
<Resource name="mdx"> | ||
<![CDATA[ | ||
With | ||
Set [*NATIVE_CJ_SET] as 'Filter([*BASE_MEMBERS_Product], Not IsEmpty ([Measures].[Sales as % of Cost]))' | ||
Set [*SM_RSUM_SET_0] as 'Generate([*NATIVE_CJ_SET], {([Product].CurrentMember)})' | ||
Set [*BASE_MEMBERS_Measures] as '{[Measures].[Sales as % of Cost],[Measures].[*SUMMARY_METRIC_0]}' | ||
Set [*BASE_MEMBERS_Product] as '[Product].[Product Department].Members' | ||
Set [*NATIVE_MEMBERS_Product] as 'Generate([*NATIVE_CJ_SET], {[Product].CurrentMember})' | ||
Member [Measures].[*SUMMARY_METRIC_0] as 'Rank(([Product].CurrentMember),[*SM_RSUM_SET_0],[Measures].[Sales as % of Cost])', SOLVE_ORDER=50 | ||
Member [Product].[*CTX_MEMBER_SEL~SUM] as 'Sum({[Product].[All Products]})', SOLVE_ORDER=-100 | ||
Member [Product].[*CTX_MEMBER_SEL~MAX] as 'Max([*NATIVE_MEMBERS_Product])', SOLVE_ORDER=100 | ||
Select | ||
[*BASE_MEMBERS_Measures] on columns, | ||
Non Empty Union({[Product].[*CTX_MEMBER_SEL~MAX]},Union({[Product].[*CTX_MEMBER_SEL~SUM]},Generate([*NATIVE_CJ_SET], {([Product].CurrentMember)}))) on rows | ||
From [Sales] | ||
]]> | ||
</Resource> | ||
<Resource name="result"> | ||
<![CDATA[ | ||
Axis #0: | ||
{} | ||
Axis #1: | ||
{[Measures].[Sales as % of Cost]} | ||
{[Measures].[*SUMMARY_METRIC_0]} | ||
Axis #2: | ||
{[Product].[*CTX_MEMBER_SEL~MAX]} | ||
{[Product].[*CTX_MEMBER_SEL~SUM]} | ||
{[Product].[All Products].[Drink].[Alcoholic Beverages]} | ||
{[Product].[All Products].[Drink].[Beverages]} | ||
{[Product].[All Products].[Drink].[Dairy]} | ||
{[Product].[All Products].[Food].[Baked Goods]} | ||
{[Product].[All Products].[Food].[Baking Goods]} | ||
{[Product].[All Products].[Food].[Breakfast Foods]} | ||
{[Product].[All Products].[Food].[Canned Foods]} | ||
{[Product].[All Products].[Food].[Canned Products]} | ||
{[Product].[All Products].[Food].[Dairy]} | ||
{[Product].[All Products].[Food].[Deli]} | ||
{[Product].[All Products].[Food].[Eggs]} | ||
{[Product].[All Products].[Food].[Frozen Foods]} | ||
{[Product].[All Products].[Food].[Meat]} | ||
{[Product].[All Products].[Food].[Produce]} | ||
{[Product].[All Products].[Food].[Seafood]} | ||
{[Product].[All Products].[Food].[Snack Foods]} | ||
{[Product].[All Products].[Food].[Snacks]} | ||
{[Product].[All Products].[Food].[Starchy Foods]} | ||
{[Product].[All Products].[Non-Consumable].[Carousel]} | ||
{[Product].[All Products].[Non-Consumable].[Checkout]} | ||
{[Product].[All Products].[Non-Consumable].[Health and Hygiene]} | ||
{[Product].[All Products].[Non-Consumable].[Household]} | ||
{[Product].[All Products].[Non-Consumable].[Periodicals]} | ||
Row #0: 151.8% | ||
Row #0: 23 | ||
Row #1: 150.5% | ||
Row #1: 12 | ||
Row #2: 151.6% | ||
Row #2: 5 | ||
Row #3: 150.7% | ||
Row #3: 9 | ||
Row #4: 149.3% | ||
Row #4: 22 | ||
Row #5: 150.7% | ||
Row #5: 8 | ||
Row #6: 151.6% | ||
Row #6: 4 | ||
Row #7: 151.8% | ||
Row #7: 1 | ||
Row #8: 150.2% | ||
Row #8: 16 | ||
Row #9: 151.6% | ||
Row #9: 3 | ||
Row #10: 149.5% | ||
Row #10: 21 | ||
Row #11: 150.5% | ||
Row #11: 14 | ||
Row #12: 149.7% | ||
Row #12: 19 | ||
Row #13: 150.6% | ||
Row #13: 10 | ||
Row #14: 150.4% | ||
Row #14: 15 | ||
Row #15: 150.5% | ||
Row #15: 12 | ||
Row #16: 150.5% | ||
Row #16: 13 | ||
Row #17: 150.7% | ||
Row #17: 7 | ||
Row #18: 149.7% | ||
Row #18: 20 | ||
Row #19: 149.8% | ||
Row #19: 18 | ||
Row #20: 151.7% | ||
Row #20: 2 | ||
Row #21: 147.1% | ||
Row #21: 23 | ||
Row #22: 151.1% | ||
Row #22: 6 | ||
Row #23: 150.2% | ||
Row #23: 17 | ||
Row #24: 150.6% | ||
Row #24: 11 | ||
]]> | ||
</Resource> | ||
</TestCase> | ||
</Root> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters