import static org.hamcrest.CoreMatchers.nullValue;
import static org.junit.Assert.*;
+import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
assertThat(ret, is(nullValue()));
}
}
+
+ public static class タイムスタンプの書式 {
+ @Test
+ public void EXIF時刻書式テスト() throws Exception {
+ String dateTimeOriginal = "2017:06:30 09:59:59";
+ Date time = ImportPicture.toEXIFDate(dateTimeOriginal);
+ assertThat(ImportPicture.toEXIFString(time), is("2017:06:30 09:59:59"));
+ assertThat(ImportPicture.toUTCString(time), is("2017-06-30T09:59:59Z"));
+ DateFormat dfUTC = new SimpleDateFormat(ImportPicture.TIME_FORMAT_STRING);
+ assertThat(dfUTC.format(time), is("2017-06-30T18:59:59Z"));
+ }
+
+ }
}