query.getAxis(Axis.ROWS).addDimension(timeDimension);
query.getAxis(Axis.COLUMNS).addDimension(measuresDimension);
query.validate();
SelectNode mdx = query.getSelect();
String mdxString = mdx.toString();
TestContext.assertEqualsVerbose(
"SELECT\n"
+ "{[Measures].[Store Sales]} ON COLUMNS,\n"
+ "CrossJoin([Product].[Drink].Children, "
+ "CrossJoin({[Store].[USA], "
+ "[Store].[USA].Children}, "
+ "[Time].[1997].Children)) ON ROWS\n"
+ "FROM [Sales]",
mdxString);
// Push down the Products dimension.
query.getAxis(Axis.ROWS).pushDown(0);
query.validate();
mdx = query.getSelect();
mdxString = mdx.toString();
TestContext.assertEqualsVerbose(
"SELECT\n"
+ "{[Measures].[Store Sales]} ON COLUMNS,\n"
+ "CrossJoin({[Store].[USA], "
+ "[Store].[USA].Children}, "
+ "CrossJoin([Product].[Drink].Children, "
+ "[Time].[1997].Children)) ON ROWS\n"
+ "FROM [Sales]",
mdxString);
// Pull Up the Time dimension.
query.getAxis(Axis.ROWS).pullUp(2);
query.validate();
mdx = query.getSelect();
mdxString = mdx.toString();
TestContext.assertEqualsVerbose(
"SELECT\n"
+ "{[Measures].[Store Sales]} ON COLUMNS,\n"
+ "CrossJoin({[Store].[USA], "
+ "[Store].[USA].Children}, "