MDXMetaData extends AbstractPentahoMetaData implements IMultiDimensionalMetaData { public String getColumnName( final int columnNumber ) { return ( ( columnNames != null ) && ( columnNumber >= 0 ) && ( columnNumber < columnNames.length ) ? columnNames[columnNumber] : "" ); } MDXMetaData();  MDXMetaData( final Result nativeResultSet, boolean useExtendedColumnNames );  MDXMetaData( final Result nativeResultSet ); String getColumnName( final int columnNumber ); @Override int getColumnCount(); @Override Object[][] getColumnHeaders(); @Override Object[][] getRowHeaders(); String[] getRowHeaderNames(); void setColumnNameFormat( String formatStr ); void generateColumnNames(); String[] getFlattenedColumnNames();  }
@Test @SuppressWarnings( "rawtypes" ) public void testGetColumnName() { List positions = mockPositions( COLUMN_SIZE, ROW_SIZE ); 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 ); }