@Test public void getReportOutput_パターンなし() { String input = "report_20121012.html"; String actual = AntParameterUtil.getReportOutput(input); assertEquals(input, actual); }
public static String getReportOutput(String s) throws IllegalArgumentException { Pattern formatPattern = Pattern.compile("(.+)\\{(.+)\\}(.+)"); String replaced = s; Matcher matcher; Date now = new Date(); while ((matcher = formatPattern.matcher(replaced)).matches()) { replaced = matcher.group(1) + new SimpleDateFormat(matcher.group(2)).format(now) + matcher.group(3); } return replaced; }
AntParameterUtil { public static String getReportOutput(String s) throws IllegalArgumentException { Pattern formatPattern = Pattern.compile("(.+)\\{(.+)\\}(.+)"); String replaced = s; Matcher matcher; Date now = new Date(); while ((matcher = formatPattern.matcher(replaced)).matches()) { replaced = matcher.group(1) + new SimpleDateFormat(matcher.group(2)).format(now) + matcher.group(3); } return replaced; } }
AntParameterUtil { public static String getReportOutput(String s) throws IllegalArgumentException { Pattern formatPattern = Pattern.compile("(.+)\\{(.+)\\}(.+)"); String replaced = s; Matcher matcher; Date now = new Date(); while ((matcher = formatPattern.matcher(replaced)).matches()) { replaced = matcher.group(1) + new SimpleDateFormat(matcher.group(2)).format(now) + matcher.group(3); } return replaced; } private  AntParameterUtil(); }
AntParameterUtil { public static String getReportOutput(String s) throws IllegalArgumentException { Pattern formatPattern = Pattern.compile("(.+)\\{(.+)\\}(.+)"); String replaced = s; Matcher matcher; Date now = new Date(); while ((matcher = formatPattern.matcher(replaced)).matches()) { replaced = matcher.group(1) + new SimpleDateFormat(matcher.group(2)).format(now) + matcher.group(3); } return replaced; } private  AntParameterUtil(); static String getReportOutput(String s); static String parseToday(String s); }
AntParameterUtil { public static String getReportOutput(String s) throws IllegalArgumentException { Pattern formatPattern = Pattern.compile("(.+)\\{(.+)\\}(.+)"); String replaced = s; Matcher matcher; Date now = new Date(); while ((matcher = formatPattern.matcher(replaced)).matches()) { replaced = matcher.group(1) + new SimpleDateFormat(matcher.group(2)).format(now) + matcher.group(3); } return replaced; } private  AntParameterUtil(); static String getReportOutput(String s); static String parseToday(String s);  }