@Test public void testResolveFluoConfig() { URL testConfig = getClass().getClassLoader().getResource("test-fluo-conn.properties"); System.setProperty(CommandUtil.FLUO_CONN_PROPS, testConfig.getPath()); FluoConfiguration fluoConfiguration = CommandUtil.resolveFluoConfig(); assertEquals("app-name", fluoConfiguration.getApplicationName()); assertEquals(999, fluoConfiguration.getZookeeperTimeout()); }
public static FluoConfiguration resolveFluoConfig() { String connPropsPath = System.getProperty(FLUO_CONN_PROPS); if (connPropsPath == null) { return new FluoConfiguration(); } else { File connPropsFile = new File(connPropsPath); Preconditions.checkArgument(connPropsFile.exists(), "System property 'fluo.conn.props' is set to file that doesn't exist: " + connPropsPath); return new FluoConfiguration(connPropsFile); } }
CommandUtil { public static FluoConfiguration resolveFluoConfig() { String connPropsPath = System.getProperty(FLUO_CONN_PROPS); if (connPropsPath == null) { return new FluoConfiguration(); } else { File connPropsFile = new File(connPropsPath); Preconditions.checkArgument(connPropsFile.exists(), "System property 'fluo.conn.props' is set to file that doesn't exist: " + connPropsPath); return new FluoConfiguration(connPropsFile); } } }
CommandUtil { public static FluoConfiguration resolveFluoConfig() { String connPropsPath = System.getProperty(FLUO_CONN_PROPS); if (connPropsPath == null) { return new FluoConfiguration(); } else { File connPropsFile = new File(connPropsPath); Preconditions.checkArgument(connPropsFile.exists(), "System property 'fluo.conn.props' is set to file that doesn't exist: " + connPropsPath); return new FluoConfiguration(connPropsFile); } }  }
CommandUtil { public static FluoConfiguration resolveFluoConfig() { String connPropsPath = System.getProperty(FLUO_CONN_PROPS); if (connPropsPath == null) { return new FluoConfiguration(); } else { File connPropsFile = new File(connPropsPath); Preconditions.checkArgument(connPropsFile.exists(), "System property 'fluo.conn.props' is set to file that doesn't exist: " + connPropsPath); return new FluoConfiguration(connPropsFile); } }  static void verifyAppInitialized(FluoConfiguration config); static void verifyAppRunning(FluoConfiguration config); static FluoConfiguration resolveFluoConfig(); }
CommandUtil { public static FluoConfiguration resolveFluoConfig() { String connPropsPath = System.getProperty(FLUO_CONN_PROPS); if (connPropsPath == null) { return new FluoConfiguration(); } else { File connPropsFile = new File(connPropsPath); Preconditions.checkArgument(connPropsFile.exists(), "System property 'fluo.conn.props' is set to file that doesn't exist: " + connPropsPath); return new FluoConfiguration(connPropsFile); } }  static void verifyAppInitialized(FluoConfiguration config); static void verifyAppRunning(FluoConfiguration config); static FluoConfiguration resolveFluoConfig(); static final String FLUO_CONN_PROPS; }