Package mondrian.test

Examples of mondrian.test.SqlPattern


            + "    `agg_l_05_sales_fact_1997`.`store_id`";
        assertQuerySqlOrNot(
            context,
            mdx,
            new SqlPattern[] {
                new SqlPattern(
                    Dialect.DatabaseProduct.ORACLE,
                    sqlOracle,
                    sqlOracle.length()),
                new SqlPattern(
                    Dialect.DatabaseProduct.MYSQL,
                    sqlMysql,
                    sqlMysql.length())
            },
            false, false, true);
View Full Code Here


        assertQuerySqlOrNot(
            context,
            mdx,
            new SqlPattern[] {
                new SqlPattern(
                    Dialect.DatabaseProduct.MYSQL,
                    sqlMysql,
                    sqlMysql.length())
            },
            false, false, true);
View Full Code Here

        assertQuerySqlOrNot(
            context,
            mdx,
            new SqlPattern[] {
                new SqlPattern(
                    Dialect.DatabaseProduct.MYSQL,
                    sqlMysqlTupleQuery,
                    sqlMysqlTupleQuery.length())
            },
            false, false, true);

        assertQuerySqlOrNot(
            context,
            mdx,
            new SqlPattern[] {
                new SqlPattern(
                    Dialect.DatabaseProduct.MYSQL,
                    sqlMysqlSegmentQuery,
                    sqlMysqlSegmentQuery.length())
            },
            false, false, true);

        // Because we have caused a many-to-many relation between the agg table
        // and the dim table, we expect retarded numbers here.
        context.assertQueryReturns(
            mdx,
            "Axis #0:\n"
            + "{}\n"
            + "Axis #1:\n"
            + "{[Measures].[Unit Sales]}\n"
            + "Axis #2:\n"
            + "{[Time].[1997], [Store].[USA]}\n"
            + "{[Time].[1998], [Store].[USA]}\n"
            + "Row #0: 8,119,905\n"
            + "Row #1: 8,119,905\n");

        // Make sure that queries on lower levels don't trigger a
        // false positive with the agg matcher.
        assertQuerySqlOrNot(
            context,
            mdxTooLowForAgg,
            new SqlPattern[] {
                new SqlPattern(
                    Dialect.DatabaseProduct.MYSQL,
                    sqlMysqlTooLowTupleQuery,
                    sqlMysqlTooLowTupleQuery.length())
            },
            false, false, true);

        assertQuerySqlOrNot(
            context,
            mdxTooLowForAgg,
            new SqlPattern[] {
                new SqlPattern(
                    Dialect.DatabaseProduct.MYSQL,
                    sqlMysqlTooLowSegmentQuery,
                    sqlMysqlTooLowSegmentQuery.length())
            },
            false, false, true);
View Full Code Here

            + "    \"agg_c_10_sales_fact_1997\".\"the_year\"";
        assertQuerySqlOrNot(
            context,
            "select Time.[1997] on 0 from sales",
            new SqlPattern[]{
                new SqlPattern(
                    Dialect.DatabaseProduct.MYSQL,
                    sqlMysql,
                    sqlMysql.length()),
                new SqlPattern(
                    Dialect.DatabaseProduct.ORACLE,
                    sqlOra,
                    sqlOra.length())},
            false, false, true);
    }
View Full Code Here

            + "    `customer`.`gender`";
        assertQuerySqlOrNot(
            context,
            "select gender.gender.members on 0 from sales",
            new SqlPattern[]{
                new SqlPattern(
                    Dialect.DatabaseProduct.MYSQL,
                    sqlMysql,
                    sqlMysql.length()),
                new SqlPattern(
                    Dialect.DatabaseProduct.ORACLE,
                    sqlOra,
                    sqlOra.length())},
            false, false, true);
    }
View Full Code Here

        assertQuerySqlOrNot(
            context,
            "select Time.[1997] on 0 from sales where "
            + "measures.[Customer Count]",
            new SqlPattern[]{
                new SqlPattern(
                    Dialect.DatabaseProduct.MYSQL,
                    sqlMysql,
                    sqlMysql.length()),
                new SqlPattern(
                    Dialect.DatabaseProduct.ORACLE,
                    sqlOra,
                    sqlOra.length())},
            false, false, true);
    }
View Full Code Here

            sqlpat = sqlWithLevelGroupBy;
        } else {
            sqlpat = sqlWithAllGroupBy;
        }
        SqlPattern[] sqlPatterns = {
            new SqlPattern(Dialect.DatabaseProduct.MYSQL, sqlpat, sqlpat)
        };

        // Use dimension with level-dependent property
        TestContext tc = TestContext.instance().create(
            storeDimensionLevelDependent,
View Full Code Here

        assertQuerySqlOrNot(tc, queryCubeA, sqlPatterns, false, false, true);
    }

    public void testIndependentPropertyNotSkipped() {
        SqlPattern[] sqlPatterns = {
            new SqlPattern(
                Dialect.DatabaseProduct.MYSQL,
                sqlWithAllGroupBy,
                sqlWithAllGroupBy)
        };
View Full Code Here

    public void testGroupBySkippedIfUniqueLevel() {
        // If unique level is included and all properties are level
        // dependent, then group by can be skipped regardless of dialect
        SqlPattern[] sqlPatterns = {
            new SqlPattern(
                Dialect.DatabaseProduct.MYSQL,
                sqlWithNoGroupBy,
                sqlWithNoGroupBy)
        };
View Full Code Here

        assertQuerySqlOrNot(tc, queryCubeA, sqlPatterns, false, false, true);
    }

    public void testGroupByNotSkippedIfIndependentProperty() {
        SqlPattern[] sqlPatterns = {
            new SqlPattern(
                Dialect.DatabaseProduct.MYSQL,
                sqlWithAllGroupBy,
                sqlWithAllGroupBy)
        };
View Full Code Here

TOP

Related Classes of mondrian.test.SqlPattern

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.