MessageFormatter implements IMessageFormatter { public void formatSuccessMessage( final String mimeType, final IRuntimeContext context, final StringBuffer messageBuffer, final boolean doMessages ) { formatSuccessMessage( mimeType, context, messageBuffer, doMessages, true ); }  void formatErrorMessage( final String mimeType, final String title, final String message,
      final StringBuffer messageBuffer ); String getFirstError( final List messages ); void formatErrorMessage( final String mimeType, final String title, final List messages,
      final StringBuffer messageBuffer ); void formatFailureMessage( final String mimeType, final IRuntimeContext context,
      final StringBuffer messageBuffer, final List defaultMessages ); @Override void formatFailureMessage( final String mimeType, final IRuntimeContext context,
      final StringBuffer messageBuffer, final List defaultMessages, final boolean showStacktrace ); void formatExceptionMessage( String mimeType, ActionSequenceException exception, StringBuffer messageBuffer ); void formatExceptionMessage( String mimeType, ActionSequenceException exception, StringBuffer messageBuffer,
      boolean showStacktrace ); void formatFailureMessage( final String mimeType, final IRuntimeContext context,
      final StringBuffer messageBuffer ); @SuppressWarnings( { "deprecation", "null" } ) void formatResultSetAsHTMLRows( final IPentahoResultSet resultSet, final StringBuffer messageBuffer ); void formatSuccessMessage( final String mimeType, final IRuntimeContext context,
      final StringBuffer messageBuffer, final boolean doMessages ); @SuppressWarnings( { "deprecation", "null" } ) void formatSuccessMessage( final String mimeType, final IRuntimeContext context,
      final StringBuffer messageBuffer, final boolean doMessages, final boolean doWrapper ); static final String HTML_MIME_TYPE; static final String TEXT_MIME_TYPE; static final int MAX_RESULT_THRESHOLD; }
@Test public void formatSuccessMessage() throws Exception { Set inputNames = new HashSet<String>( ); inputNames.add( "Test" ); IActionParameter actionParameter = new ActionParameter( "Test", "Test", "<img%20src=\"http: + ".com/sites/all/themes/pentaho_resp/logo.svg\"%20/>", null, "" ); when( runtimeCtx.getOutputNames() ).thenReturn( inputNames ); doReturn( actionParameter ).when( runtimeCtx ).getOutputParameter( anyString() ); MessageFormatter mf = new MessageFormatter(); StringBuffer messageBuffer = new StringBuffer(); mf.formatSuccessMessage( MessageFormatter.HTML_MIME_TYPE, runtimeCtx, messageBuffer, false ); assertEquals( "<html><head><title>Pentaho BI Platform - Start Action</title><link rel=\"stylesheet\" " + "type=\"text/css\" href=\"/pentaho-style/active/default.css\"></head><body dir=\"LTR\"><table " + "cellspacing=\"10\"><tr><td class=\"portlet-section\" colspan=\"3\">Action Successful<hr " + "size=\"1\"/></td></tr><tr><td class=\"portlet-font\" valign=\"top\">Test=<img%20src=\"http: + ".pentaho.com/sites/all/themes/pentaho_resp/logo.svg\"%20/><br/></td></tr></table></body></html>", messageBuffer.toString() ); }