OpenGammaComponentServer { protected String extractServerName(String fileName) { if (fileName.contains(":")) { fileName = StringUtils.substringAfter(fileName, ":"); } fileName = FilenameUtils.removeExtension(fileName); String first = FilenameUtils.getName(FilenameUtils.getPathNoEndSeparator(fileName)); String second = FilenameUtils.getName(fileName); if (StringUtils.isEmpty(first) || first.equals(second) || second.startsWith(first + "-")) { return second; } return first + "-" + second; }  static void main(String[] args); boolean run(String[] args); ComponentRepository run(String configFile, Map<String, String> properties, ComponentLogger logger); ComponentManager createManager(String configFile, Map<String, String> properties); static final String STARTING_MESSAGE; static final String STARTUP_FAILED_MESSAGE; static final String STARTUP_COMPLETE_MESSAGE; }
@Test(dataProvider = "extractName") public void test_dash_properties(String input, String expected) { OpenGammaComponentServer test = new OpenGammaComponentServer(); assertEquals(expected, test.extractServerName(input)); }