ChartHelper { private static void deprecateWarning() { String key = "PentahoSystem.WARN_DEPRECATED_CLASS"; MessagesBase messages = org.pentaho.platform.engine.core.messages.Messages.getInstance(); String message = messages.getErrorString( key, ChartHelper.class.getCanonicalName() ); String stackTrace = StringUtils.join( Thread.currentThread().getStackTrace(), "\n\t" ); Logger.warn( ChartHelper.class, message + "\n\t" + stackTrace ); }  @Deprecated static boolean doChart( final String actionPath, final IParameterProvider parameterProvider,
      final StringBuffer outputStream, final IPentahoSession userSession, final ArrayList messages, ILogger logger ); @Deprecated static boolean doPieChart( final String actionPath, final IParameterProvider parameterProvider, final StringBuffer outputStream,
        final IPentahoSession userSession, final ArrayList messages, final ILogger logger ); @Deprecated static boolean doDial( final String solutionName, final String actionPath, final String chartName,
      final IParameterProvider parameterProvider, final StringBuffer outputStream, final IPentahoSession userSession,
      final ArrayList messages, final ILogger logger );  }
@Test @SuppressWarnings( "deprecation" ) public void deprecateWarningTest() { final Class<?> deprecatedClass = ChartHelper.class; final Method[] methods = deprecatedClass.getDeclaredMethods(); final List<Method> notPrivateMethods = new ArrayList<Method>( methods.length ); for ( Method m : methods ) { if ( !Modifier.isPrivate( m.getModifiers() ) ) { notPrivateMethods.add( m ); } } new NonStrictExpectations( Logger.class ) { { Logger.warn( deprecatedClass, withSubstring( "deprecated" ) ); result = new Exception(); times = notPrivateMethods.size(); } }; for ( Method m : notPrivateMethods ) { try { Deencapsulation.invoke( deprecatedClass, m.getName(), (Object[]) m.getParameterTypes() ); fail(); } catch ( Exception e ) { System.out.println( MessageFormat.format( "Method {0}.{1}(..) sucessfully deprecated", deprecatedClass .getCanonicalName(), m.getName() ) ); } } }