File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
xmpbox/src/test/java/org/apache/xmpbox Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change 2121
2222package org .apache .xmpbox ;
2323
24+ import java .io .IOException ;
25+
2426import static org .junit .jupiter .api .Assertions .assertEquals ;
27+ import static org .junit .jupiter .api .Assertions .assertThrows ;
2528
2629import java .text .SimpleDateFormat ;
2730import java .time .ZonedDateTime ;
@@ -52,6 +55,11 @@ void testDateConversion() throws Exception
5255 Calendar convDate = DateConverter .toCalendar ("2015-02-02" );
5356 assertEquals (2015 , convDate .get (Calendar .YEAR ));
5457
58+ convDate = DateConverter .toCalendar ("D:2015-02-02" );
59+ assertEquals (2015 , convDate .get (Calendar .YEAR ));
60+
61+ assertThrows (IOException .class , () -> DateConverter .toCalendar ("123" ));
62+
5563 //Test missing seconds
5664 assertEquals (DateConverter .toCalendar ("2015-12-08T12:07:00-05:00" ),
5765 DateConverter .toCalendar ("2015-12-08T12:07-05:00" ));
You can’t perform that action at this time.
0 commit comments