Skip to content
Jakub Raczek edited this page Nov 18, 2016 · 14 revisions

We can compare mdx queries using Microsoft SQL Server jdbc drivers.

Linked Server for Analysis Services mus be set first on tested server. Datasource definition for connection to OLAP, please download additional dll sqljdbc_auth.dll file and put in windows/system32 folder to use WIN-AUTH (integratedSecurity=true).

<datasource maxPollSize="6">
    <name>SQL_SERVER_WIN_AUTH</name>
    <driver>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver>
    <!-- to use WIN-AUTH (integratedSecurity=true) you must put sqljdbc_auth.dll file in windows/system32
    folder. Download it from here: https://www.microsoft.com/en-us/download/details.aspx?displaylang=en&id=11774 -->
    <url>jdbc:sqlserver://${SQL_SERVER};databaseName=master;integratedSecurity=true</url>
</datasource>

You can use fetch comparator to compare mdx queries, you can also compare mdx query with SQL using proper datasources.

<cmpSqlResultsTest>
    <compare mode="FETCH">
        <sql datasourceName="SQL_SERVER_WIN_AUTH">
            <![CDATA[
            SELECT *
            FROM OPENQUERY(CUBE, 'select {[Date].[CY 2005], [Date].[CY 2006] , [Date].[CY 2007]} on rows,
[Measures].[Internet Sales Amount] on columns from
[Adventure Works]');
            ]]>
        </sql>
        <sql datasourceName="SQL_SERVER_WIN_AUTH">
            <![CDATA[
            SELECT *
            FROM OPENQUERY(CUBE, 'select {[Date].[CY 2005], [Date].[CY 2006] , [Date].[CY 2007]} on rows,
[Measures].[Internet Sales Amount] on columns from
[Adventure Works]');
        ]]>
        </sql>
    </compare>
</cmpSqlResultsTest>