@Test
public void testGetMimeType() throws Exception {

  MockOutputHandlerSelector selector = new MockOutputHandlerSelector();
  HashMap<String, String> outputTypes = new HashMap<String, String>();
  outputTypes.put( "table/html;page-mode=stream", "text/html" ); //$NON-NLS-1$ //$NON-NLS-2$
  outputTypes.put( "table/html;page-mode=page", "text/html" ); //$NON-NLS-1$ //$NON-NLS-2$
  outputTypes.put( "table/excel;page-mode=flow", "application/vnd.ms-excel" ); //$NON-NLS-1$ //$NON-NLS-2$
  outputTypes.put( "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;page-mode=flow",
    "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" ); //$NON-NLS-1$ //$NON-NLS-2$
  outputTypes.put( "table/csv;page-mode=stream", "text/csv" ); //$NON-NLS-1$ //$NON-NLS-2$
  outputTypes.put( "table/rtf;page-mode=flow", "application/rtf" ); //$NON-NLS-1$ //$NON-NLS-2$
  outputTypes.put( "pageable/pdf", "application/pdf" ); //$NON-NLS-1$ //$NON-NLS-2$
  outputTypes.put( "pageable/text", "text/plain" ); //$NON-NLS-1$ //$NON-NLS-2$
  outputTypes.put( "mime-message/text/html", "mime-message/text/html" ); //$NON-NLS-1$ //$NON-NLS-2$
  outputTypes.put( "table/xml", "application/xml" ); //$NON-NLS-1$ //$NON-NLS-2$
  outputTypes.put( "pageable/xml", "application/xml" ); //$NON-NLS-1$ //$NON-NLS-2$
  outputTypes.put( "pageable/X-AWT-Graphics;image-type=png", "image/png" ); //$NON-NLS-1$ //$NON-NLS-2$
  outputTypes.put( "", "application/octet-stream" ); //$NON-NLS-1$ //$NON-NLS-2$
  for ( Map.Entry<String, String> outputType : outputTypes.entrySet() ) {
    selector.setOutputType( outputType.getKey() );
    assertEquals( outputType.getValue(), roh.getMimeType( selector ) );
  }
}