MonitoringViewProperties { public static String getDefaultInterval() { String interval = System.getProperty(PARFAIT_INTERVAL); if (interval == null) { return DEFAULT_INTERVAL; } try { Integer.parseInt(interval); } catch (NumberFormatException e) { return DEFAULT_INTERVAL; } return interval; }  static String getCommandBasename(String command); static String getDefaultCommand(); static String getParfaitName(); static String getRuntimeName(); static String getFallbackName(String runtimeName); static String getDefaultName(String parfaitName, String commandName, String runtimeName); static String getDefaultCluster(String name); static String getDefaultInterval(); static String getDefaultStartup(); static String getDefaultConnection(); static void setupProperties(); static String getName(); static Integer getCluster(); static Long getInterval(); static Long getStartup(); static String getConnection(); static final String PARFAIT; static final String PARFAIT_NAME; static final String PARFAIT_CLUSTER; static final String PARFAIT_INTERVAL; static final String PARFAIT_STARTUP; static final String PARFAIT_CONNECT; }
@Test public void checkValidIntervalSetting() { System.clearProperty(MonitoringViewProperties.PARFAIT_INTERVAL); String interval = MonitoringViewProperties.getDefaultInterval(); System.setProperty(MonitoringViewProperties.PARFAIT_INTERVAL, "bad-do-not-modify"); assertEquals(interval, MonitoringViewProperties.getDefaultInterval()); }
@Test public void checkInvalidIntervalSetting() { System.setProperty(MonitoringViewProperties.PARFAIT_INTERVAL, "13000"); assertEquals("13000", MonitoringViewProperties.getDefaultInterval()); System.clearProperty(MonitoringViewProperties.PARFAIT_INTERVAL); }