@Test public void testRunDatabaseConsistencyCheck_IgnoreDBCheck() throws Exception { AmbariServer ambariServer = new AmbariServer(); System.setProperty("skipDatabaseConsistencyCheck", ""); final Injector mockInjector = Guice.createInjector(new AbstractModule() { @Override protected void configure() { } }); DatabaseConsistencyCheckHelper.setInjector(mockInjector); ambariServer.runDatabaseConsistencyCheck(); System.clearProperty("skipDatabaseConsistencyCheck"); }
protected void runDatabaseConsistencyCheck() throws Exception { if (System.getProperty("skipDatabaseConsistencyCheck") == null) { boolean fixIssues = (System.getProperty("fixDatabaseConsistency") != null); try { DatabaseConsistencyCheckResult checkResult = DatabaseConsistencyCheckHelper.runAllDBChecks(fixIssues); System.out.println("Database consistency check result: " + checkResult); if (checkResult.isError()) { System.exit(1); } } catch (Throwable ex) { System.out.println("Database consistency check result: " + DatabaseConsistencyCheckResult.DB_CHECK_ERROR); throw new Exception(ex); } } }
AmbariServer { protected void runDatabaseConsistencyCheck() throws Exception { if (System.getProperty("skipDatabaseConsistencyCheck") == null) { boolean fixIssues = (System.getProperty("fixDatabaseConsistency") != null); try { DatabaseConsistencyCheckResult checkResult = DatabaseConsistencyCheckHelper.runAllDBChecks(fixIssues); System.out.println("Database consistency check result: " + checkResult); if (checkResult.isError()) { System.exit(1); } } catch (Throwable ex) { System.out.println("Database consistency check result: " + DatabaseConsistencyCheckResult.DB_CHECK_ERROR); throw new Exception(ex); } } } }
AmbariServer { protected void runDatabaseConsistencyCheck() throws Exception { if (System.getProperty("skipDatabaseConsistencyCheck") == null) { boolean fixIssues = (System.getProperty("fixDatabaseConsistency") != null); try { DatabaseConsistencyCheckResult checkResult = DatabaseConsistencyCheckHelper.runAllDBChecks(fixIssues); System.out.println("Database consistency check result: " + checkResult); if (checkResult.isError()) { System.exit(1); } } catch (Throwable ex) { System.out.println("Database consistency check result: " + DatabaseConsistencyCheckResult.DB_CHECK_ERROR); throw new Exception(ex); } } }  }
AmbariServer { protected void runDatabaseConsistencyCheck() throws Exception { if (System.getProperty("skipDatabaseConsistencyCheck") == null) { boolean fixIssues = (System.getProperty("fixDatabaseConsistency") != null); try { DatabaseConsistencyCheckResult checkResult = DatabaseConsistencyCheckHelper.runAllDBChecks(fixIssues); System.out.println("Database consistency check result: " + checkResult); if (checkResult.isError()) { System.exit(1); } } catch (Throwable ex) { System.out.println("Database consistency check result: " + DatabaseConsistencyCheckResult.DB_CHECK_ERROR); throw new Exception(ex); } } }  String getServerOsType(); static AmbariManagementController getController(); @SuppressWarnings("deprecation") void run(); void stop(); @Deprecated void performStaticInjection(); void initViewRegistry(); static void setupProxyAuth(); static void enableLog4jMonitor(Map<String, String> configsMap); static void main(String[] args); }
AmbariServer { protected void runDatabaseConsistencyCheck() throws Exception { if (System.getProperty("skipDatabaseConsistencyCheck") == null) { boolean fixIssues = (System.getProperty("fixDatabaseConsistency") != null); try { DatabaseConsistencyCheckResult checkResult = DatabaseConsistencyCheckHelper.runAllDBChecks(fixIssues); System.out.println("Database consistency check result: " + checkResult); if (checkResult.isError()) { System.exit(1); } } catch (Throwable ex) { System.out.println("Database consistency check result: " + DatabaseConsistencyCheckResult.DB_CHECK_ERROR); throw new Exception(ex); } } }  String getServerOsType(); static AmbariManagementController getController(); @SuppressWarnings("deprecation") void run(); void stop(); @Deprecated void performStaticInjection(); void initViewRegistry(); static void setupProxyAuth(); static void enableLog4jMonitor(Map<String, String> configsMap); static void main(String[] args); static final String VIEWS_URL_PATTERN; static final EnumSet<DispatcherType> DISPATCHER_TYPES; volatile boolean running; }