@Test public void testDateFormatsNoFormat() { String[] tests = new String[]{ "abcd", "2016-01-01 10:00:00", "2016 Sat, 1 Apr 2008 15:12:51 +0000", "Sat, 1 Dub 2008 15:12:51 +0000", "2016_01_01T10:00:00Z", "2016-01-01 10:00", "2016_01_01 10:00 +0000", "2016-01-01 10:00:00 +0000", "2016-01-01 10:00 +0000", "2016-01-02 10:00 +0000", "2017-01-01 10:00 +0700", "2016-12-31 10:00 +0000" }; RepositoryImplementation repository = new RepositoryImplementation(); repository.setDatePatterns(new String[0]); for (String test : tests) { try { repository.parse(test); Assert.fail("Shouldn't be able to parse the date: " + test); } catch (ParseException ex) { } } }
public Date parse(String dateString) throws ParseException { final DateFormat format = getDateFormat(); synchronized (format) { return format.parse(dateString); } }
Repository extends RepositoryInfo { public Date parse(String dateString) throws ParseException { final DateFormat format = getDateFormat(); synchronized (format) { return format.parse(dateString); } } }
Repository extends RepositoryInfo { public Date parse(String dateString) throws ParseException { final DateFormat format = getDateFormat(); synchronized (format) { return format.parse(dateString); } } Repository(); }
Repository extends RepositoryInfo { public Date parse(String dateString) throws ParseException { final DateFormat format = getDateFormat(); synchronized (format) { return format.parse(dateString); } } Repository(); String getRepoCommand(); boolean getHistoryGet(
            File target, String parent, String basename, String rev); InputStream getHistoryGet(
            String parent, String basename, String rev); final boolean isRepositoryFor(File file); final String determineParent(); final String determineBranch(); List<String> getIgnoredFiles(); List<String> getIgnoredDirs(); final String determineCurrentVersion(); String format(Date date); Date parse(String dateString); }
Repository extends RepositoryInfo { public Date parse(String dateString) throws ParseException { final DateFormat format = getDateFormat(); synchronized (format) { return format.parse(dateString); } } Repository(); String getRepoCommand(); boolean getHistoryGet(
            File target, String parent, String basename, String rev); InputStream getHistoryGet(
            String parent, String basename, String rev); final boolean isRepositoryFor(File file); final String determineParent(); final String determineBranch(); List<String> getIgnoredFiles(); List<String> getIgnoredDirs(); final String determineCurrentVersion(); String format(Date date); Date parse(String dateString);  }