@SuppressWarnings("deprecation") @Test public void testStripRrdExtensionWithValidExtension() throws Exception { String strippedName = m_snmpThresholder.stripRrdExtension("foo" + RrdUtils.getExtension()); assertNotNull("stripped file name should not be null", strippedName); assertEquals("stripped file name", "foo", strippedName); }
protected String stripRrdExtension(String fileName) { if (!fileName.endsWith(RrdUtils.getExtension())) { log().info("stripRrdExtension: File '" + fileName + "' does not end with the RRD extension '" + RrdUtils.getExtension() + "'."); return null; } return fileName.substring(0, fileName.lastIndexOf(RrdUtils.getExtension())); }
SnmpThresholder implements ServiceThresholder { protected String stripRrdExtension(String fileName) { if (!fileName.endsWith(RrdUtils.getExtension())) { log().info("stripRrdExtension: File '" + fileName + "' does not end with the RRD extension '" + RrdUtils.getExtension() + "'."); return null; } return fileName.substring(0, fileName.lastIndexOf(RrdUtils.getExtension())); } }
SnmpThresholder implements ServiceThresholder { protected String stripRrdExtension(String fileName) { if (!fileName.endsWith(RrdUtils.getExtension())) { log().info("stripRrdExtension: File '" + fileName + "' does not end with the RRD extension '" + RrdUtils.getExtension() + "'."); return null; } return fileName.substring(0, fileName.lastIndexOf(RrdUtils.getExtension())); }  }
SnmpThresholder implements ServiceThresholder { protected String stripRrdExtension(String fileName) { if (!fileName.endsWith(RrdUtils.getExtension())) { log().info("stripRrdExtension: File '" + fileName + "' does not end with the RRD extension '" + RrdUtils.getExtension() + "'."); return null; } return fileName.substring(0, fileName.lastIndexOf(RrdUtils.getExtension())); }  String serviceName(); void initialize(Map<?,?> parameters); void reinitialize(); void release(); void initialize(ThresholdNetworkInterface netIface, Map<?,?> parms); void release(ThresholdNetworkInterface iface); int check(ThresholdNetworkInterface netIface, EventProxy eproxy, Map<?,?> parms); ThresholdsDao getThresholdsDao(); void setThresholdsDao(ThresholdsDao thresholdsDao); IfInfoGetter getIfInfoGetter(); void setIfInfoGetter(IfInfoGetter ifInfoGetter); }
SnmpThresholder implements ServiceThresholder { protected String stripRrdExtension(String fileName) { if (!fileName.endsWith(RrdUtils.getExtension())) { log().info("stripRrdExtension: File '" + fileName + "' does not end with the RRD extension '" + RrdUtils.getExtension() + "'."); return null; } return fileName.substring(0, fileName.lastIndexOf(RrdUtils.getExtension())); }  String serviceName(); void initialize(Map<?,?> parameters); void reinitialize(); void release(); void initialize(ThresholdNetworkInterface netIface, Map<?,?> parms); void release(ThresholdNetworkInterface iface); int check(ThresholdNetworkInterface netIface, EventProxy eproxy, Map<?,?> parms); ThresholdsDao getThresholdsDao(); void setThresholdsDao(ThresholdsDao thresholdsDao); IfInfoGetter getIfInfoGetter(); void setIfInfoGetter(IfInfoGetter ifInfoGetter);  }