Skip to content

Commit

Permalink
MONDRIAN: Fix output of ParentChildHierarchyTest for Windows.
Browse files Browse the repository at this point in the history
[git-p4: depot-paths = "//open/mondrian/": change = 7576]
  • Loading branch information
julianhyde committed Sep 6, 2006
1 parent 9627309 commit aa6a5b6
Showing 1 changed file with 60 additions and 60 deletions.
120 changes: 60 additions & 60 deletions testsrc/main/mondrian/test/ParentChildHierarchyTest.java
Expand Up @@ -63,46 +63,46 @@ private TestContext getEmpClosureTestContext() {

public void testAll() {
assertQueryReturns(
"select {[Measures].[Org Salary], [Measures].[Count]} on columns,\n" +
"select {[Measures].[Org Salary], [Measures].[Count]} on columns,\n" +
" {[Employees]} on rows\n" +
"from [HR]",
"Axis #0:\n" +
fold("Axis #0:\n" +
"{}\n" +
"Axis #1:\n" +
"{[Measures].[Org Salary]}\n" +
"{[Measures].[Count]}\n" +
"Axis #2:\n" +
"{[Employees].[All Employees]}\n" +
"Row #0: $39,431.67\n" +
"Row #0: 7,392\n");
"Row #0: 7,392\n"));
}

public void testChildrenOfAll() {
assertQueryReturns(
"select {[Measures].[Org Salary], [Measures].[Count]} on columns,\n" +
"select {[Measures].[Org Salary], [Measures].[Count]} on columns,\n" +
" {[Employees].children} on rows\n" +
"from [HR]",
"Axis #0:\n" +
fold("Axis #0:\n" +
"{}\n" +
"Axis #1:\n" +
"{[Measures].[Org Salary]}\n" +
"{[Measures].[Count]}\n" +
"Axis #2:\n" +
"{[Employees].[All Employees].[Sheri Nowmer]}\n" +
"Row #0: $39,431.67\n" +
"Row #0: 7,392\n");
"Row #0: 7,392\n"));
}

// bug 1063369: DISTINCT COUNT applied to a parent/child hierarchy fails:
// unsupported when children expanded
public void testDistinctAll() {
// parent/child dimension not expanded, and the query works
assertQueryReturns(
"select {[Measures].[Count], [Measures].[Org Salary], \n" +
"select {[Measures].[Count], [Measures].[Org Salary], \n" +
"[Measures].[Number Of Employees], [Measures].[Avg Salary]} on columns,\n" +
"{[Employees]} on rows\n" +
"from [HR]",
"Axis #0:\n" +
fold("Axis #0:\n" +
"{}\n" +
"Axis #1:\n" +
"{[Measures].[Count]}\n" +
Expand All @@ -114,7 +114,7 @@ public void testDistinctAll() {
"Row #0: 7,392\n" +
"Row #0: $39,431.67\n" +
"Row #0: 616\n" +
"Row #0: $64.01\n");
"Row #0: $64.01\n"));
}

public void testDistinctChildrenOfAll() {
Expand All @@ -123,33 +123,33 @@ public void testDistinctChildrenOfAll() {
// mondrian.rolap.RolapAggregator$6.aggregate(RolapAggregator.java:72)
assertQueryReturns(
"select {[Measures].[Count], [Measures].[Org Salary], \n" +
"[Measures].[Number Of Employees], [Measures].[Avg Salary]} on columns,\n" +
"{[Employees].children} on rows\n" +
"from [HR]",
"Axis #0:\n" +
"{}\n" +
"Axis #1:\n" +
"{[Measures].[Count]}\n" +
"{[Measures].[Org Salary]}\n" +
"{[Measures].[Number of Employees]}\n" +
"{[Measures].[Avg Salary]}\n" +
"Axis #2:\n" +
"{[Employees].[All Employees].[Sheri Nowmer]}\n" +
"Row #0: 7,392\n" +
"Row #0: $39,431.67\n" +
"Row #0: 616\n" +
"Row #0: $64.01\n");
"[Measures].[Number Of Employees], [Measures].[Avg Salary]} on columns,\n" +
"{[Employees].children} on rows\n" +
"from [HR]",
fold("Axis #0:\n" +
"{}\n" +
"Axis #1:\n" +
"{[Measures].[Count]}\n" +
"{[Measures].[Org Salary]}\n" +
"{[Measures].[Number of Employees]}\n" +
"{[Measures].[Avg Salary]}\n" +
"Axis #2:\n" +
"{[Employees].[All Employees].[Sheri Nowmer]}\n" +
"Row #0: 7,392\n" +
"Row #0: $39,431.67\n" +
"Row #0: 616\n" +
"Row #0: $64.01\n"));
}

// same two tests, but on a subtree
public void testDistinctSubtree() {
// also fails with UnsupportedOperationException
assertQueryReturns(
"select {[Measures].[Count], [Measures].[Org Salary], \n" +
"select {[Measures].[Count], [Measures].[Org Salary], \n" +
"[Measures].[Number Of Employees], [Measures].[Avg Salary]} on columns,\n" +
"{[Employees].[All Employees].[Sheri Nowmer].[Rebecca Kanagaki]} on rows\n" +
"from [HR]",
"Axis #0:\n" +
fold("Axis #0:\n" +
"{}\n" +
"Axis #1:\n" +
"{[Measures].[Count]}\n" +
Expand All @@ -161,7 +161,7 @@ public void testDistinctSubtree() {
"Row #0: 24\n" +
"Row #0: $234.36\n" +
"Row #0: 2\n" +
"Row #0: $117.18\n");
"Row #0: $117.18\n"));
}


Expand All @@ -171,11 +171,11 @@ public void testDistinctSubtree() {
*/
public void testDistinctAllExplicitClosure() {
getEmpClosureTestContext().assertQueryReturns(
"select {[Measures].[Count], [Measures].[Org Salary], \n" +
"select {[Measures].[Count], [Measures].[Org Salary], \n" +
"[Measures].[Number Of Employees], [Measures].[Avg Salary]} on columns,\n" +
"{[EmployeesClosure]} on rows\n" +
"from [HR]",
"Axis #0:\n" +
fold("Axis #0:\n" +
"{}\n" +
"Axis #1:\n" +
"{[Measures].[Count]}\n" +
Expand All @@ -187,7 +187,7 @@ public void testDistinctAllExplicitClosure() {
"Row #0: 7,392\n" +
"Row #0: $39,431.67\n" +
"Row #0: 616\n" +
"Row #0: $64.01\n");
"Row #0: $64.01\n"));
}

public void testDistinctChildrenOfAllExplicitClosure() {
Expand All @@ -197,7 +197,7 @@ public void testDistinctChildrenOfAllExplicitClosure() {
"[Measures].[Number Of Employees], [Measures].[Avg Salary]} on columns,\n" +
"{[EmployeesClosure].FirstChild} on rows\n" +
"from [HR]",
"Axis #0:\n" +
fold("Axis #0:\n" +
"{}\n" +
"Axis #1:\n" +
"{[Measures].[Count]}\n" +
Expand All @@ -209,16 +209,16 @@ public void testDistinctChildrenOfAllExplicitClosure() {
"Row #0: 7,392\n" +
"Row #0: $39,431.67\n" +
"Row #0: 616\n" +
"Row #0: $64.01\n");
"Row #0: $64.01\n"));
}

public void testDistinctSubtreeExplicitClosure() {
getEmpClosureTestContext().assertQueryReturns(
"select {[Measures].[Count], [Measures].[Org Salary], \n" +
"select {[Measures].[Count], [Measures].[Org Salary], \n" +
"[Measures].[Number Of Employees], [Measures].[Avg Salary]} on columns,\n" +
"{[EmployeesClosure].[All Employees].[7]} on rows\n" +
"from [HR]",
"Axis #0:\n" +
fold("Axis #0:\n" +
"{}\n" +
"Axis #1:\n" +
"{[Measures].[Count]}\n" +
Expand All @@ -230,43 +230,43 @@ public void testDistinctSubtreeExplicitClosure() {
"Row #0: 24\n" +
"Row #0: $234.36\n" +
"Row #0: 2\n" +
"Row #0: $117.18\n");
"Row #0: $117.18\n"));
}



public void testLeaf() {
// Juanita Sharp has no reports
assertQueryReturns(
"select {[Measures].[Org Salary], [Measures].[Count]} on columns,\n" +
"select {[Measures].[Org Salary], [Measures].[Count]} on columns,\n" +
" {[Employees].[All Employees].[Sheri Nowmer].[Rebecca Kanagaki].[Juanita Sharp]} on rows\n" +
"from [HR]",
"Axis #0:\n" +
fold("Axis #0:\n" +
"{}\n" +
"Axis #1:\n" +
"{[Measures].[Org Salary]}\n" +
"{[Measures].[Count]}\n" +
"Axis #2:\n" +
"{[Employees].[All Employees].[Sheri Nowmer].[Rebecca Kanagaki].[Juanita Sharp]}\n" +
"Row #0: $72.36\n" +
"Row #0: 12\n");
"Row #0: 12\n"));
}

public void testOneAboveLeaf() {
// Rebecca Kanagaki has 2 direct reports, and they have no reports
assertQueryReturns(
"select {[Measures].[Org Salary], [Measures].[Count]} on columns,\n" +
"select {[Measures].[Org Salary], [Measures].[Count]} on columns,\n" +
" {[Employees].[All Employees].[Sheri Nowmer].[Rebecca Kanagaki]} on rows\n" +
"from [HR]",
"Axis #0:\n" +
fold("Axis #0:\n" +
"{}\n" +
"Axis #1:\n" +
"{[Measures].[Org Salary]}\n" +
"{[Measures].[Count]}\n" +
"Axis #2:\n" +
"{[Employees].[All Employees].[Sheri Nowmer].[Rebecca Kanagaki]}\n" +
"Row #0: $234.36\n" +
"Row #0: 24\n");
"Row #0: 24\n"));
}

/**
Expand Down Expand Up @@ -370,16 +370,16 @@ public void testHierarchyFalseCycle() {
// On the regular HR cube, this has always worked.
assertQueryReturns(
"SELECT {[Employees].[All Employees].Children} on columns,\n" +
" {[Measures].[Org Salary]} on rows\n" +
"FROM [HR]",
" {[Measures].[Org Salary]} on rows\n" +
"FROM [HR]",

"Axis #0:\n" +
"{}\n" +
"Axis #1:\n" +
"{[Employees].[All Employees].[Sheri Nowmer]}\n" +
"Axis #2:\n" +
"{[Measures].[Org Salary]}\n" +
"Row #0: $39,431.67\n");
fold("Axis #0:\n" +
"{}\n" +
"Axis #1:\n" +
"{[Employees].[All Employees].[Sheri Nowmer]}\n" +
"Axis #2:\n" +
"{[Measures].[Org Salary]}\n" +
"Row #0: $39,431.67\n"));

TestContext testContext = TestContext.create(
null,
Expand Down Expand Up @@ -411,15 +411,15 @@ public void testHierarchyFalseCycle() {
// On a cube with fewer dimensions, this gave a false failure.
testContext.assertQueryReturns(
"SELECT {[Employees].[All Employees].Children} on columns,\n" +
" {[Measures].[Org Salary]} on rows\n" +
"FROM [HR-fewer-dims]",
"Axis #0:\n" +
"{}\n" +
"Axis #1:\n" +
"{[Employees].[All Employees].[Sheri Nowmer]}\n" +
"Axis #2:\n" +
"{[Measures].[Org Salary]}\n" +
"Row #0: $271,552.44\n");
" {[Measures].[Org Salary]} on rows\n" +
"FROM [HR-fewer-dims]",
fold("Axis #0:\n" +
"{}\n" +
"Axis #1:\n" +
"{[Employees].[All Employees].[Sheri Nowmer]}\n" +
"Axis #2:\n" +
"{[Measures].[Org Salary]}\n" +
"Row #0: $271,552.44\n"));
}

public void testGenuineCycle() {
Expand Down

0 comments on commit aa6a5b6

Please sign in to comment.