diff --git a/.gitignore b/.gitignore index 4cfd2c6..8a483e3 100644 --- a/.gitignore +++ b/.gitignore @@ -6,11 +6,9 @@ *.jar *.tar.gz /target/ -/src/test/data/*~ -/src/test/data/*.log -/src/test/data/cameradata/ -/src/test/data/output -!/src/test/data/*.tar.gz +/src/test/resources/*~ +/src/test/resources/*.log nb*.xml Thumbs.db /nbproject/ +/.externalToolBuilders/ diff --git a/pom.xml b/pom.xml index 1055ced..c829caa 100644 --- a/pom.xml +++ b/pom.xml @@ -1,4 +1,5 @@ - + 4.0.0 osm.surveyor AdjustTime @@ -7,7 +8,7 @@ scm:git:http://surveyor.mydns.jp/gitbucket/git/yuu/AdjustTime.git http://surveyor.mydns.jp/gitbucket/yuu/AdjustTime/wiki scm:git:http://surveyor.mydns.jp/gitbucket/git/yuu/AdjustTime.git - HEAD + v5.3.5 @@ -33,6 +34,17 @@ + surveyor.mirror + Hayashi Repository + http://surveyor.mydns.jp/archiva/repository/mirror/ + + true + + + true + + + surveyor.haya4 Hayashi Repository http://surveyor.mydns.jp/archiva/repository/haya4/ @@ -78,13 +90,45 @@ true + + + sonatype-public-repository + https://oss.sonatype.org/content/groups/public + + true + + + true + + + + + com.googlecode.maven-download-plugin + https://mvnrepository.com/artifact + + true + + + true + + + org.apache.commons commons-imaging - 1.0-alpha1 + 1.0-alpha2 + jar + + + + + org.codehaus.plexus + plexus-utils + 3.0.5 + test jar @@ -110,6 +154,16 @@ test jar + + + + com.googlecode.maven-download-plugin + download-maven-plugin + 1.6.0 + test + jar + + @@ -137,7 +191,52 @@ org.codehaus.plexus plexus-utils - 3.0.24 + 3.0.5 + + + + + com.googlecode.maven-download-plugin + download-maven-plugin + 1.6.0 + + + install-Sony20170518 + generate-test-resources + + wget + + + http://surveyor.mydns.jp/data/Sony20170518.tar.gz + false + ${project.build.directory}/test-classes/imgdata + + + + install-WiMiUS20170518 + generate-test-resources + + wget + + + http://surveyor.mydns.jp/data/WiMiUS20170518.tar.gz + false + ${project.build.directory}/test-classes/imgdata + + + + install-separate + generate-test-resources + + wget + + + http://surveyor.mydns.jp/data/separate.tar.gz + false + ${project.build.directory}/test-classes/imgdata + + + diff --git a/src/main/java/osm/jp/gpx/GpxFolder.java b/src/main/java/osm/jp/gpx/GpxFolder.java index dd4af8c..9b6bcaa 100644 --- a/src/main/java/osm/jp/gpx/GpxFolder.java +++ b/src/main/java/osm/jp/gpx/GpxFolder.java @@ -46,7 +46,7 @@ else if (gpxDir.isDirectory()) { // 指定されたディレクトリ内のGPXファイルすべてを対象とする gpxfiles = gpxDir.listFiles(new GpxFileFilter()); - if (gpxfiles == null) { + if ((gpxfiles == null) || (gpxfiles.length < 1)) { // 対象となるGPXファイルがありませんでした。('%s') throw new FileNotFoundException( String.format(ImportPicture.i18n.getString("msg.110"), gpxDir.getAbsolutePath()) diff --git a/src/test/java/osm/jp/gpx/Fixture.java b/src/test/java/osm/jp/gpx/Fixture.java index 1f8633b..f9215e0 100644 --- a/src/test/java/osm/jp/gpx/Fixture.java +++ b/src/test/java/osm/jp/gpx/Fixture.java @@ -112,6 +112,7 @@ ), // 2 new Fixture( + "[A2].SONYカメラの場合.FILE_UPDATE時間を基準にして時間外のファイルもコピーする時", "target/test-classes/imgdata/Sony20170518.tar.gz", "target/test-classes/cameradata/20170518.gpx", @@ -153,6 +154,7 @@ new Expecter("cameradata/20170518_094827A.jpg", true, "2017:05:18 09:48:26", 90.0D, 180.0D, null), } ), + /* // 5. new Fixture( "[M1a].GPXが複数のTRKSEGに分割している場合.FILE_UPDATE時間を基準.GarminColorado", @@ -562,6 +564,7 @@ new Expecter("separate/20170529_104119A.jpg", true, "2017:05:29 10:41:19", 35.8339846227D, 138.0625408050D, "345"), } ), + */ }; //public static Fixture[] stddatas; diff --git a/src/test/java/osm/jp/gpx/ImportPictureTest.java b/src/test/java/osm/jp/gpx/ImportPictureTest.java index fbec0f1..ebcf388 100644 --- a/src/test/java/osm/jp/gpx/ImportPictureTest.java +++ b/src/test/java/osm/jp/gpx/ImportPictureTest.java @@ -43,13 +43,26 @@ UnZip.uncompress(new File(dataset.tarFilePath), new File("target/test-classes/cameradata")); // GPXファイルをセット - try (FileInputStream inStream = new FileInputStream(new File(dataset.gpxSourcePath)); - FileOutputStream outStream = new FileOutputStream(new File(dataset.gpxDestinationPath)); - FileChannel inChannel = inStream.getChannel(); - FileChannel outChannel = outStream.getChannel()) - { - inChannel.transferTo(0, inChannel.size(), outChannel); - } + //copy(new File(dataset.gpxSourcePath), new File(dataset.gpxDestinationPath)); + } + + void copy(File source, File dest) throws IOException { + if (source.isDirectory()) { + File[] files = source.listFiles(); + for (int i = 0; i < files.length; i++) { + File file = files[i]; + copy(file, dest); + } + } + else { + try (FileInputStream inStream = new FileInputStream(source); + FileOutputStream outStream = new FileOutputStream(dest); + FileChannel inChannel = inStream.getChannel(); + FileChannel outChannel = outStream.getChannel()) + { + inChannel.transferTo(0, inChannel.size(), outChannel); + } + } } /** diff --git a/src/test/resources/ini/AdjustTime.20170518.A2.ini b/src/test/resources/ini/AdjustTime.20170518.A2.ini index 41002e3..b2183b6 100644 --- a/src/test/resources/ini/AdjustTime.20170518.A2.ini +++ b/src/test/resources/ini/AdjustTime.20170518.A2.ini @@ -13,5 +13,5 @@ GPX.OVERWRITE_MAGVAR=false GPX.REUSE=false IMG.SOURCE_FOLDER=target/test-classes/cameradata/10170518 -GPX.SOURCE_FOLDER=target/test-classes/cameradata +GPX.SOURCE_FOLDER=target/test-classes/gpx/20170518.gpx IMG.OUTPUT_FOLDER=target/test-classes/output diff --git a/src/test/resources/ini/AdjustTime.20170518.B2.ini b/src/test/resources/ini/AdjustTime.20170518.B2.ini index bd5e067..b1f5939 100644 --- a/src/test/resources/ini/AdjustTime.20170518.B2.ini +++ b/src/test/resources/ini/AdjustTime.20170518.B2.ini @@ -13,5 +13,5 @@ GPX.REUSE=false IMG.BASE_FILE=20170518_092031A.jpg IMG.SOURCE_FOLDER=target/test-classes/cameradata -GPX.SOURCE_FOLDER=target/test-classes/cameradata/20170518.gpx +GPX.SOURCE_FOLDER=target/test-classes/gpx/20170518.gpx IMG.OUTPUT_FOLDER=target/test-classes/output diff --git a/src/test/resources/ini/AdjustTime.M1a.separate.ini b/src/test/resources/ini/AdjustTime.M1a.separate.ini index 2791866..f55175d 100644 --- a/src/test/resources/ini/AdjustTime.M1a.separate.ini +++ b/src/test/resources/ini/AdjustTime.M1a.separate.ini @@ -13,5 +13,5 @@ GPX.REUSE=false IMG.BASE_FILE=20170529_103146A.jpg IMG.SOURCE_FOLDER=target/test-classes/cameradata/separate -GPX.SOURCE_FOLDER=target/test-classes/cameradata/separate.gpx +GPX.SOURCE_FOLDER=target/test-classes/gpx/separate.gpx IMG.OUTPUT_FOLDER=target/test-classes/output diff --git a/src/test/resources/ini/AdjustTime.M1b.separate.ini b/src/test/resources/ini/AdjustTime.M1b.separate.ini index d28903d..b693b63 100644 --- a/src/test/resources/ini/AdjustTime.M1b.separate.ini +++ b/src/test/resources/ini/AdjustTime.M1b.separate.ini @@ -13,5 +13,5 @@ GPX.REUSE=false IMG.BASE_FILE=20170529_103146A.jpg IMG.SOURCE_FOLDER=target/test-classes/cameradata/separate -GPX.SOURCE_FOLDER=target/test-classes/cameradata/separate.gpx +GPX.SOURCE_FOLDER=target/test-classes/gpx/separate.gpx IMG.OUTPUT_FOLDER=target/test-classes/output diff --git a/src/test/resources/ini/AdjustTime.M1c.separate.ini b/src/test/resources/ini/AdjustTime.M1c.separate.ini index ef810b3..5022005 100644 --- a/src/test/resources/ini/AdjustTime.M1c.separate.ini +++ b/src/test/resources/ini/AdjustTime.M1c.separate.ini @@ -13,5 +13,5 @@ GPX.REUSE=false IMG.BASE_FILE=20170529_103146A.jpg IMG.SOURCE_FOLDER=target/test-classes/cameradata/separate -GPX.SOURCE_FOLDER=target/test-classes/cameradata/separate.gpx +GPX.SOURCE_FOLDER=target/test-classes/gpx/separate.gpx IMG.OUTPUT_FOLDER=target/test-classes/output diff --git a/src/test/resources/ini/AdjustTime.M1d.separate.ini b/src/test/resources/ini/AdjustTime.M1d.separate.ini index 36a903e..1feae43 100644 --- a/src/test/resources/ini/AdjustTime.M1d.separate.ini +++ b/src/test/resources/ini/AdjustTime.M1d.separate.ini @@ -13,5 +13,5 @@ GPX.REUSE=false IMG.BASE_FILE=20170529_103146A.jpg IMG.SOURCE_FOLDER=target/test-classes/cameradata/separate -GPX.SOURCE_FOLDER=target/test-classes/cameradata/separate.gpx +GPX.SOURCE_FOLDER=target/test-classes/gpx/separate.gpx IMG.OUTPUT_FOLDER=target/test-classes/output diff --git a/src/test/resources/ini/AdjustTime.M2a.separate.ini b/src/test/resources/ini/AdjustTime.M2a.separate.ini index 2791866..f55175d 100644 --- a/src/test/resources/ini/AdjustTime.M2a.separate.ini +++ b/src/test/resources/ini/AdjustTime.M2a.separate.ini @@ -13,5 +13,5 @@ GPX.REUSE=false IMG.BASE_FILE=20170529_103146A.jpg IMG.SOURCE_FOLDER=target/test-classes/cameradata/separate -GPX.SOURCE_FOLDER=target/test-classes/cameradata/separate.gpx +GPX.SOURCE_FOLDER=target/test-classes/gpx/separate.gpx IMG.OUTPUT_FOLDER=target/test-classes/output diff --git a/src/test/resources/ini/AdjustTime.M2b.separate.ini b/src/test/resources/ini/AdjustTime.M2b.separate.ini index d28903d..b693b63 100644 --- a/src/test/resources/ini/AdjustTime.M2b.separate.ini +++ b/src/test/resources/ini/AdjustTime.M2b.separate.ini @@ -13,5 +13,5 @@ GPX.REUSE=false IMG.BASE_FILE=20170529_103146A.jpg IMG.SOURCE_FOLDER=target/test-classes/cameradata/separate -GPX.SOURCE_FOLDER=target/test-classes/cameradata/separate.gpx +GPX.SOURCE_FOLDER=target/test-classes/gpx/separate.gpx IMG.OUTPUT_FOLDER=target/test-classes/output diff --git a/src/test/resources/ini/AdjustTime.M2c.separate.ini b/src/test/resources/ini/AdjustTime.M2c.separate.ini index ef810b3..5022005 100644 --- a/src/test/resources/ini/AdjustTime.M2c.separate.ini +++ b/src/test/resources/ini/AdjustTime.M2c.separate.ini @@ -13,5 +13,5 @@ GPX.REUSE=false IMG.BASE_FILE=20170529_103146A.jpg IMG.SOURCE_FOLDER=target/test-classes/cameradata/separate -GPX.SOURCE_FOLDER=target/test-classes/cameradata/separate.gpx +GPX.SOURCE_FOLDER=target/test-classes/gpx/separate.gpx IMG.OUTPUT_FOLDER=target/test-classes/output diff --git a/src/test/resources/ini/AdjustTime.M2d.separate.ini b/src/test/resources/ini/AdjustTime.M2d.separate.ini index 36a903e..1feae43 100644 --- a/src/test/resources/ini/AdjustTime.M2d.separate.ini +++ b/src/test/resources/ini/AdjustTime.M2d.separate.ini @@ -13,5 +13,5 @@ GPX.REUSE=false IMG.BASE_FILE=20170529_103146A.jpg IMG.SOURCE_FOLDER=target/test-classes/cameradata/separate -GPX.SOURCE_FOLDER=target/test-classes/cameradata/separate.gpx +GPX.SOURCE_FOLDER=target/test-classes/gpx/separate.gpx IMG.OUTPUT_FOLDER=target/test-classes/output