Search in sources :

Example 11 with MondrianProperties

use of mondrian.olap.MondrianProperties in project mondrian by pentaho.

the class BUG_1541077 method testTotalAmount.

public void testTotalAmount() throws Exception {
    if (!isApplicable()) {
        return;
    }
    MondrianProperties props = MondrianProperties.instance();
    // 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));
}
Also used : MondrianProperties(mondrian.olap.MondrianProperties) Result(mondrian.olap.Result)

Example 12 with MondrianProperties

use of mondrian.olap.MondrianProperties in project mondrian by pentaho.

the class UsagePrefixTest method testUsagePrefix.

public void testUsagePrefix() throws Exception {
    if (!isApplicable()) {
        return;
    }
    MondrianProperties props = MondrianProperties.instance();
    // get value without aggregates
    propSaver.set(props.UseAggregates, true);
    propSaver.set(props.ReadAggregates, true);
    String mdx = "select {[StoreX].[Store Value].members} on columns, " + "{ measures.[Amount] } on rows from Cheques";
    getTestContext().withSchema(schema).assertQueryReturns(mdx, "Axis #0:\n" + "{}\n" + "Axis #1:\n" + "{[StoreX].[store1]}\n" + "{[StoreX].[store2]}\n" + "{[StoreX].[store3]}\n" + "Axis #2:\n" + "{[Measures].[Amount]}\n" + "Row #0: 05.0\n" + "Row #0: 02.5\n" + "Row #0: 02.0\n");
}
Also used : MondrianProperties(mondrian.olap.MondrianProperties)

Aggregations

MondrianProperties (mondrian.olap.MondrianProperties)12 Result (mondrian.olap.Result)5