Package mondrian.olap

Examples of mondrian.olap.Result


  public void testMetadataForNullPositions() {
    Axis axColumn = mockAxis( null );
    Axis axRow = mockAxis( null );
    Axis[] axes = new Axis[] { axColumn, axRow };

    Result nativeResultSet = mock( Result.class );
    when( nativeResultSet.getAxes() ).thenReturn( axes );

    MDXMetaData metadata = new MDXMetaData( nativeResultSet );

    checkEmptyResult( metadata );
  }
View Full Code Here


  public void testMetadataForEmptyPositions() {
    Axis axColumn = mockAxis( ListUtils.EMPTY_LIST );
    Axis axRow = mockAxis( ListUtils.EMPTY_LIST );
    Axis[] axes = new Axis[] { axColumn, axRow };

    Result nativeResultSet = mock( Result.class );
    when( nativeResultSet.getAxes() ).thenReturn( axes );

    MDXMetaData metadata = new MDXMetaData( nativeResultSet );

    checkEmptyResult( metadata );
  }
View Full Code Here

    Axis axColumn = mockAxis( positions );
    Axis axRow = mockAxis( positions );
    Axis[] axes = new Axis[] { axColumn, axRow };

    Result nativeResultSet = mock( Result.class );
    when( nativeResultSet.getAxes() ).thenReturn( axes );

    MDXMetaData metadata = new MDXMetaData( nativeResultSet, true );

    checkColumnHeaders( positions, metadata.getColumnHeaders() );
    checkRowHeaders( positions, metadata.getRowHeaders() );
View Full Code Here

    Axis axColumn = mockAxis( positions );
    Axis axRow = mockAxis( positions );
    Axis[] axes = new Axis[] { axColumn, axRow };

    Result nativeResultSet = mock( Result.class );
    when( nativeResultSet.getAxes() ).thenReturn( axes );

    MDXMetaData metadata = new MDXMetaData( nativeResultSet );
    Object[][] columnHeaders = metadata.getColumnHeaders();

    checkExtendedColumnHeaders( positions, columnHeaders );
View Full Code Here

    checkExtendedRowHeaderNames( positions, metadata.getRowHeaderNames() );
  }

  @Test
  public void testGetEmptyColumnName() {
    Result nativeResultSet = mock( Result.class );
    when( nativeResultSet.getAxes() ).thenReturn( new Axis[0] );

    MDXMetaData metadata = new MDXMetaData( nativeResultSet );

    String columnName = metadata.getColumnName( -1 );
    assertEquals( StringUtils.EMPTY, columnName );
View Full Code Here

    Axis axColumn = mockAxis( positions );
    Axis axRow = mockAxis( positions );
    Axis[] axes = new Axis[] { axColumn, axRow };

    Result nativeResultSet = mock( Result.class );
    when( nativeResultSet.getAxes() ).thenReturn( axes );

    MDXMetaData metadata = new MDXMetaData( nativeResultSet );

    String columnName = metadata.getColumnName( 0 );
    assertEquals( metadata.getRowHeaderNames()[0], columnName );
View Full Code Here

    Axis axColumn = mockAxis( positions );
    Axis axRow = mockAxis( positions );
    Axis[] axes = new Axis[] { axColumn, axRow };

    Result nativeResultSet = mock( Result.class );
    when( nativeResultSet.getAxes() ).thenReturn( axes );

    MDXMetaData metadata = new MDXMetaData( nativeResultSet );

    int columnCount = metadata.getColumnCount();
    assertEquals( positions.size(), columnCount );
View Full Code Here

    assertEquals( positions.size(), columnCount );
  }

  @Test
  public void testGetZeroColumnCount() {
    Result nativeResultSet = mock( Result.class );
    when( nativeResultSet.getAxes() ).thenReturn( new Axis[0] );

    MDXMetaData metadata = new MDXMetaData( nativeResultSet );

    int columnCount = metadata.getColumnCount();
    assertEquals( 0, columnCount );

    when( nativeResultSet.getAxes() ).thenReturn( new Axis[] { null } );

    metadata = new MDXMetaData( nativeResultSet );

    columnCount = metadata.getColumnCount();
    assertEquals( 0, columnCount );

    Axis axColumn = mockAxis( null );
    when( nativeResultSet.getAxes() ).thenReturn( new Axis[] { axColumn } );

    metadata = new MDXMetaData( nativeResultSet );

    columnCount = metadata.getColumnCount();
    assertEquals( 0, columnCount );
View Full Code Here

   *
   * @see org.pentaho.connection.IPentahoConnection#executeQuery(java.lang.String)
   */
  public IPentahoResultSet executeQuery( final String query ) {
    Query mdxQuery = nativeConnection.parseQuery( query );
    Result result = nativeConnection.execute( mdxQuery );
    resultSet = new MDXResultSet( result, nativeConnection, useExtendedColumnNames );
    return resultSet;
  }
View Full Code Here

        // Execute query but do not used the CrossJoin nonEmptyList optimization
        propSaver.set(
            MondrianProperties.instance().CrossJoinOptimizerSize,
            Integer.MAX_VALUE);
        Result result1 = getTestContext().executeQuery(mdx);
        String resultString1 = TestContext.toString(result1);

        // Execute query using the new version of the CrossJoin
        // nonEmptyList optimization
        propSaver.set(
            MondrianProperties.instance().CrossJoinOptimizerSize,
            Integer.MAX_VALUE);
        Result result2 = getTestContext().executeQuery(mdx);
        String resultString2 = TestContext.toString(result2);

        // This succeeds.
        assertEquals(resultString1, resultString2);
    }
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.