MonitoringViewProperties { public static String getDefaultStartup() { String startup = System.getProperty(PARFAIT_STARTUP); if (startup == null) { return Long.toString(DynamicMonitoringView.defaultQuietPeriod()); } try { Long.parseLong(startup); } catch (NumberFormatException e) { return Long.toString(DynamicMonitoringView.defaultQuietPeriod()); } return startup; }  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 checkValidStartupSetting() { System.clearProperty(MonitoringViewProperties.PARFAIT_STARTUP); String startup = MonitoringViewProperties.getDefaultStartup(); System.setProperty(MonitoringViewProperties.PARFAIT_STARTUP, "bad-do-not-modify"); assertEquals(startup, MonitoringViewProperties.getDefaultStartup()); }
@Test public void checkInvalidStartupSetting() { System.setProperty(MonitoringViewProperties.PARFAIT_STARTUP, "15000"); assertEquals("15000", MonitoringViewProperties.getDefaultStartup()); System.clearProperty(MonitoringViewProperties.PARFAIT_STARTUP); }