OSDN Git Service

green: タイムスタンプのUTCとローカル時間との表示変換機能のテストを追加
authorhayashi <hayashi.yuu@gmail.com>
Fri, 30 Jun 2017 08:17:32 +0000 (17:17 +0900)
committerhayashi <hayashi.yuu@gmail.com>
Fri, 30 Jun 2017 08:17:32 +0000 (17:17 +0900)
importPicture/test/osm/jp/gpx/ElementMapTRKPTTest.java
importPicture/test/osm/jp/gpx/ImportPictureTest.java

index 982a020..90d4a1f 100644 (file)
@@ -4,6 +4,7 @@ import static org.hamcrest.CoreMatchers.is;
 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;
@@ -226,4 +227,17 @@ public class ElementMapTRKPTTest {
                        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"));
+               }
+               
+       }
 }
index 7f9bb42..a2181fc 100644 (file)
@@ -602,7 +602,7 @@ public class ImportPictureTest {
                }
                }
        }
-
+       
        static void setup(Fixture dataset) throws IOException {
                System.out.println(dataset.toString());