Package mondrian.olap

Examples of mondrian.olap.Result


            + "  </CalculatedMember>\n"
            + "</VirtualCube>",
            null,
            null,
            null);
        Result result = testContext.executeQuery(
            "select {[Measures].[Sales Count],\n"
            + " [Measures].[Store Cost],\n"
            + " [Measures].[Store Sales],\n"
            + " [Measures].[Units Shipped],\n"
            + " [Measures].[Profit]} on columns\n"
View Full Code Here


            + "</VirtualCube>",
            null,
            null,
            null);

        Result result = testContext.executeQuery(
            "select {[Measures].[Store Sqft]} ON COLUMNS,"
            + "{[HCB]} ON ROWS "
            + "from [VirtualTestStore]");

        Axis[] axes = result.getAxes();
        List<Position> positions = axes[0].getPositions();
        Member m0 = positions.get(0).get(0);
        String caption = m0.getCaption();
        assertEquals("Store Sqft Caption", caption);
    }
View Full Code Here

    /**
     * Test case for bug <a href="http://jira.pentaho.com/browse/MONDRIAN-902">
     * MONDRIAN-902, "mondrian populating the same members on both axes"</a>.
     */
    public void testBugMondrian902() {
        Result result = executeQuery(
            "SELECT\n"
            + "NON EMPTY CrossJoin(\n"
            + "  [Education Level].[Education Level].Members,\n"
            + "  CrossJoin(\n"
            + "    [Product].[Product Family].Members,\n"
            + "    [Store].[Store State].Members)) ON COLUMNS,\n"
            + "NON EMPTY CrossJoin(\n"
            + "  [Promotions].[Promotion Name].Members,\n"
            + "  [Marital Status].[Marital Status].Members) ON ROWS\n"
            + "FROM [Warehouse and Sales]");
        assertEquals(
            "[[Education Level].[Bachelors Degree], [Product].[Drink], [Store].[USA].[CA]]",
            result.getAxes()[0].getPositions().get(0).toString());
        assertEquals(45, result.getAxes()[0].getPositions().size());
        // With bug MONDRIAN-902, this gave the same result as for axis #0:
        assertEquals(
            "[[Promotions].[Bag Stuffers], [Marital Status].[M]]",
            result.getAxes()[1].getPositions().get(0).toString());
        assertEquals(96, result.getAxes()[1].getPositions().size());
    }
View Full Code Here

        // get value without aggregates
        propSaver.set(props.UseAggregates, false);

        String mdx =
            "select {[Measures].[Store Count]} on columns from Cheques";
        Result result = getTestContext().executeQuery(mdx);
        Object v = result.getCell(new int[]{0}).getValue();

        propSaver.set(props.UseAggregates, true);

        Result result1 = getTestContext().executeQuery(mdx);
        Object v1 = result1.getCell(new int[]{0}).getValue();

        assertTrue(v.equals(v1));
    }
View Full Code Here

        // get value without aggregates
        propSaver.set(props.UseAggregates, false);

        String mdx =
            "select {[Measures].[Sales Count]} on columns from Cheques";
        Result result = getTestContext().executeQuery(mdx);
        Object v = result.getCell(new int[]{0}).getValue();

        propSaver.set(props.UseAggregates, true);

        Result result1 = getTestContext().executeQuery(mdx);
        Object v1 = result1.getCell(new int[]{0}).getValue();

        assertTrue(v.equals(v1));
    }
View Full Code Here

        // get value without aggregates
        propSaver.set(props.UseAggregates, false);

        String mdx =
            "select {[Measures].[Total Amount]} on columns from Cheques";
        Result result = getTestContext().executeQuery(mdx);
        Object v = result.getCell(new int[]{0}).getValue();

        propSaver.set(props.UseAggregates, false);

        Result result1 = getTestContext().executeQuery(mdx);
        Object v1 = result1.getCell(new int[]{0}).getValue();

        assertTrue(v.equals(v1));
    }
View Full Code Here

        // get value without aggregates
        propSaver.set(props.UseAggregates, false);

        String mdx = "select {[Measures].[Avg Amount]} on columns from Cheques";

        Result result = getTestContext().executeQuery(mdx);
        Object v = result.getCell(new int[]{0}).getFormattedValue();

        // get value with aggregates
        propSaver.set(props.UseAggregates, true);

        Result result1 = getTestContext().executeQuery(mdx);
        Object v1 = result1.getCell(new int[]{0}).getFormattedValue();

        assertTrue(v.equals(v1));
    }
View Full Code Here

            + ") ON COLUMNS,"
            + " NON EMPTY Hierarchize(Union({[Geography].[All Regions]},"
            + "[Geography].[All Regions].Children)) ON ROWS"
            + " from [ImplicitMember]";

        Result result1 = getTestContext().executeQuery(mdx);
        String resultString1 = TestContext.toString(result1);
        Result result2 = getTestContext().executeQuery(mdx);
        String resultString2 = TestContext.toString(result2);

        assertEquals(resultString1, resultString2);
    }
View Full Code Here

            + " {[Bad]} on rows\n"
            + "FROM [Sales]", "Named set 'Bad' has bad formula");
    }

    public void testNamedSetMustBeSet() {
        Result result;
        String queryString;
        String pattern;

        // Formula for a named set must not be a member.
        queryString =
View Full Code Here

        propSaver.set(props.UseAggregates, false);
        propSaver.set(props.ReadAggregates, false);

        String mdx =
            "select {[Measures].[Total]} on columns from [Fact]";
        Result result = getTestContext().executeQuery(mdx);
        Object v = result.getCell(new int[]{0}).getValue();

        String mdx2 =
            "select {[Measures].[Total]} on columns from [Fact] where "
            + "{[Product].[Cat One].[Prod Cat One].[One]}";
        Result aresult = getTestContext().executeQuery(mdx2);
        Object av = aresult.getCell(new int[]{0}).getValue();

        // unless there is a way to flush the cache,
        // I'm skeptical about these results
        propSaver.set(props.UseAggregates, true);
        propSaver.set(props.ReadAggregates, false);

        Result result1 = getTestContext().executeQuery(mdx);
        Object v1 = result1.getCell(new int[]{0}).getValue();

        assertTrue(v.equals(v1));

        Result aresult2 = getTestContext().executeQuery(mdx2);
        Object av1 = aresult2.getCell(new int[]{0}).getValue();

        assertTrue(av.equals(av1));
    }
View Full Code Here

TOP

Related Classes of mondrian.olap.Result

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.