OSDN Git Service

5.3.5-SNAPSHOT
authorhaya4 <hayashi.yuu@gmail.com>
Tue, 29 Sep 2020 21:01:17 +0000 (06:01 +0900)
committerhaya4 <hayashi.yuu@gmail.com>
Tue, 29 Sep 2020 21:01:17 +0000 (06:01 +0900)
15 files changed:
.gitignore
pom.xml
src/main/java/osm/jp/gpx/GpxFolder.java
src/test/java/osm/jp/gpx/Fixture.java
src/test/java/osm/jp/gpx/ImportPictureTest.java
src/test/resources/ini/AdjustTime.20170518.A2.ini
src/test/resources/ini/AdjustTime.20170518.B2.ini
src/test/resources/ini/AdjustTime.M1a.separate.ini
src/test/resources/ini/AdjustTime.M1b.separate.ini
src/test/resources/ini/AdjustTime.M1c.separate.ini
src/test/resources/ini/AdjustTime.M1d.separate.ini
src/test/resources/ini/AdjustTime.M2a.separate.ini
src/test/resources/ini/AdjustTime.M2b.separate.ini
src/test/resources/ini/AdjustTime.M2c.separate.ini
src/test/resources/ini/AdjustTime.M2d.separate.ini

index 4cfd2c6..8a483e3 100644 (file)
@@ -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 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -1,4 +1,5 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
   <modelVersion>4.0.0</modelVersion>
   <groupId>osm.surveyor</groupId>
   <artifactId>AdjustTime</artifactId>
@@ -7,7 +8,7 @@
     <connection>scm:git:http://surveyor.mydns.jp/gitbucket/git/yuu/AdjustTime.git</connection>
     <url>http://surveyor.mydns.jp/gitbucket/yuu/AdjustTime/wiki</url>
     <developerConnection>scm:git:http://surveyor.mydns.jp/gitbucket/git/yuu/AdjustTime.git</developerConnection>
-    <tag>HEAD</tag>
+    <tag>v5.3.5</tag>
   </scm>
   
   <properties>
 
   <repositories>
     <repository>
+      <id>surveyor.mirror</id>
+      <name>Hayashi Repository</name>
+      <url>http://surveyor.mydns.jp/archiva/repository/mirror/</url>
+      <releases>
+        <enabled>true</enabled>
+      </releases>
+      <snapshots>
+        <enabled>true</enabled>
+      </snapshots>
+    </repository>
+    <repository>
       <id>surveyor.haya4</id>
       <name>Hayashi Repository</name>
       <url>http://surveyor.mydns.jp/archiva/repository/haya4/</url>
         <enabled>true</enabled>
       </snapshots>
     </pluginRepository>
+    
+    <pluginRepository>
+      <id>sonatype-public-repository</id>
+      <url>https://oss.sonatype.org/content/groups/public</url>
+      <snapshots>
+        <enabled>true</enabled>
+      </snapshots>
+      <releases>
+        <enabled>true</enabled>
+      </releases>
+    </pluginRepository>
+    
+    <pluginRepository>
+      <id>com.googlecode.maven-download-plugin</id>
+      <url>https://mvnrepository.com/artifact</url>
+      <snapshots>
+        <enabled>true</enabled>
+      </snapshots>
+      <releases>
+        <enabled>true</enabled>
+      </releases>
+    </pluginRepository>
   </pluginRepositories>
 
   <dependencies>
+    <!-- https://mvnrepository.com/artifact/org.apache.commons/commons-imaging -->
     <dependency>
       <groupId>org.apache.commons</groupId>
       <artifactId>commons-imaging</artifactId>
-      <version>1.0-alpha1</version>
+      <version>1.0-alpha2</version>
+      <type>jar</type>
+    </dependency>
+    
+    <!-- https://mvnrepository.com/artifact/org.codehaus.plexus/plexus-utils -->
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-utils</artifactId>
+      <version>3.0.5</version>
+      <scope>test</scope>
       <type>jar</type>
     </dependency>
     
       <scope>test</scope>
       <type>jar</type>
     </dependency>
+    
+    <!-- https://mvnrepository.com/artifact/com.googlecode.maven-download-plugin/download-maven-plugin -->
+    <dependency>
+      <groupId>com.googlecode.maven-download-plugin</groupId>
+      <artifactId>download-maven-plugin</artifactId>
+      <version>1.6.0</version>
+      <scope>test</scope>
+      <type>jar</type>
+    </dependency>
+
   </dependencies>
   
   <build>
       <plugin>
           <groupId>org.codehaus.plexus</groupId>
           <artifactId>plexus-utils</artifactId>
-          <version>3.0.24</version>
+          <version>3.0.5</version>
+      </plugin>
+       
+      <!-- mvn generate-test-resources:get -->
+      <plugin>
+        <groupId>com.googlecode.maven-download-plugin</groupId>
+        <artifactId>download-maven-plugin</artifactId>
+        <version>1.6.0</version>
+        <executions>
+          <execution>
+            <id>install-Sony20170518</id>
+            <phase>generate-test-resources</phase>
+            <goals>
+              <goal>wget</goal>
+            </goals>
+            <configuration>
+              <url>http://surveyor.mydns.jp/data/Sony20170518.tar.gz</url>
+              <unpack>false</unpack>
+              <outputDirectory>${project.build.directory}/test-classes/imgdata</outputDirectory>
+            </configuration>
+          </execution>
+          <execution>
+            <id>install-WiMiUS20170518</id>
+            <phase>generate-test-resources</phase>
+            <goals>
+              <goal>wget</goal>
+            </goals>
+            <configuration>
+              <url>http://surveyor.mydns.jp/data/WiMiUS20170518.tar.gz</url>
+              <unpack>false</unpack>
+              <outputDirectory>${project.build.directory}/test-classes/imgdata</outputDirectory>
+            </configuration>
+          </execution>
+          <execution>
+            <id>install-separate</id>
+            <phase>generate-test-resources</phase>
+            <goals>
+              <goal>wget</goal>
+            </goals>
+            <configuration>
+              <url>http://surveyor.mydns.jp/data/separate.tar.gz</url>
+              <unpack>false</unpack>
+              <outputDirectory>${project.build.directory}/test-classes/imgdata</outputDirectory>
+            </configuration>
+          </execution>
+        </executions>
       </plugin>
       
       <!-- mvn deploy -->
index dd4af8c..9b6bcaa 100644 (file)
@@ -46,7 +46,7 @@ public class GpxFolder extends ArrayList<GpxFile> {
         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())
index 1f8633b..f9215e0 100644 (file)
@@ -112,6 +112,7 @@ public class Fixture {
         ),
         // 2
         new Fixture(
+                       
             "[A2].SONYカメラの場合.FILE_UPDATE時間を基準にして時間外のファイルもコピーする時",
             "target/test-classes/imgdata/Sony20170518.tar.gz", 
             "target/test-classes/cameradata/20170518.gpx",
@@ -153,6 +154,7 @@ public class Fixture {
                 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 @@ public class Fixture {
                 new Expecter("separate/20170529_104119A.jpg", true, "2017:05:29 10:41:19", 35.8339846227D, 138.0625408050D, "345"),
             }
         ),
+        */
     };
        //public static Fixture[] stddatas;
 
index fbec0f1..ebcf388 100644 (file)
@@ -43,13 +43,26 @@ public class ImportPictureTest {
         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);
+            }
+       }
     }
 
     /**
index 41002e3..b2183b6 100644 (file)
@@ -13,5 +13,5 @@ IMG.TIME=2017-05-18T00\:16\:48Z
 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
index bd5e067..b1f5939 100644 (file)
@@ -13,5 +13,5 @@ GPX.OVERWRITE_MAGVAR=false
 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
index 2791866..f55175d 100644 (file)
@@ -13,5 +13,5 @@ GPX.OVERWRITE_MAGVAR=true
 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
index d28903d..b693b63 100644 (file)
@@ -13,5 +13,5 @@ GPX.OVERWRITE_MAGVAR=true
 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
index ef810b3..5022005 100644 (file)
@@ -13,5 +13,5 @@ GPX.OVERWRITE_MAGVAR=true
 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
index 36a903e..1feae43 100644 (file)
@@ -13,5 +13,5 @@ GPX.OVERWRITE_MAGVAR=true
 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
index 2791866..f55175d 100644 (file)
@@ -13,5 +13,5 @@ GPX.OVERWRITE_MAGVAR=true
 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
index d28903d..b693b63 100644 (file)
@@ -13,5 +13,5 @@ GPX.OVERWRITE_MAGVAR=true
 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
index ef810b3..5022005 100644 (file)
@@ -13,5 +13,5 @@ GPX.OVERWRITE_MAGVAR=true
 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
index 36a903e..1feae43 100644 (file)
@@ -13,5 +13,5 @@ GPX.OVERWRITE_MAGVAR=true
 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