PentahoVersionCheckReflectHelper { public static List performVersionCheck( final boolean ignoreExistingUpdates, final int versionRequestFlags ) { if ( PentahoVersionCheckReflectHelper.isVersionCheckerAvailable() ) { try { Class helperClass = Class.forName( "org.pentaho.platform.util.versionchecker.PentahoVersionCheckHelper" ); Object helper = helperClass.getConstructors()[0].newInstance( new Object[] {} ); Method setIgnoreExistingUpdatesMethod = helperClass.getDeclaredMethod( "setIgnoreExistingUpdates", new Class[] { Boolean.TYPE } ); setIgnoreExistingUpdatesMethod.invoke( helper, new Object[] { new Boolean( ignoreExistingUpdates ) } ); Method setVersionRequestFlagsMethod = helperClass.getDeclaredMethod( "setVersionRequestFlags", new Class[] { Integer.TYPE } ); setVersionRequestFlagsMethod.invoke( helper, new Object[] { new Integer( versionRequestFlags ) } ); Method performUpdateMethod = helperClass.getDeclaredMethod( "performUpdate", new Class[] {} ); performUpdateMethod.invoke( helper, new Object[] {} ); Method getResultsMethod = helperClass.getDeclaredMethod( "getResults", new Class[] {} ); List results = (List) getResultsMethod.invoke( helper, new Object[] {} ); return results; } catch ( Exception e ) { } } return null; }  static boolean isVersionCheckerAvailable(); static List performVersionCheck( final boolean ignoreExistingUpdates, final int versionRequestFlags ); static String logVersionCheck( final List results, final Log logger );  }
@Test public void performVersionCheckTest() { List results = PentahoVersionCheckReflectHelper.performVersionCheck( false, -1 ); assertNotNull( results ); assertTrue( results.size() > 0 ); validateResult( results.get( 0 ).toString() ); }