MonitoringViewProperties { public static String getDefaultCluster(String name) { String cluster = System.getProperty(PARFAIT_CLUSTER); if (cluster == null) { IdentifierSource clusterSource = new HashingIdentifierSource(1 << 12); Integer id = clusterSource.calculateId(name, Collections.<Integer>emptySet()); return id.toString(); } return cluster; }  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 checkValidClusterSetting() { System.setProperty(MonitoringViewProperties.PARFAIT_CLUSTER, "123"); assertEquals("123", MonitoringViewProperties.getDefaultCluster("anyname")); }
@Test public void checkDefaultClusterSetting() { System.clearProperty(MonitoringViewProperties.PARFAIT_CLUSTER); assertNotEquals("123", MonitoringViewProperties.getDefaultCluster("somename")); }