Newer
Older
restamp / src / test / java / osm / surveyor / matchtime / RestampTest.java
@haya4 haya4 on 16 May 2020 1 KB sss
  1. package osm.surveyor.matchtime;
  2.  
  3. import static org.junit.Assert.*;
  4.  
  5. import java.nio.file.Files;
  6. import java.nio.file.Path;
  7. import java.nio.file.Paths;
  8.  
  9. import org.junit.experimental.theories.DataPoints;
  10. import org.junit.experimental.theories.Theories;
  11. import org.junit.experimental.theories.Theory;
  12. import org.junit.runner.RunWith;
  13.  
  14. import haya4.tools.files.compless.UnZip;
  15.  
  16. @RunWith(Theories.class)
  17. public class RestampTest {
  18. String dirPath;
  19. String outPath;
  20.  
  21. @DataPoints
  22. public static Fixture[] datas = Fixture.datas;
  23.  
  24. @Theory
  25. public void パラメータテスト(Fixture dataset) {
  26. try {
  27. // カメラディレクトリを作成する
  28. Path tgz = Paths.get("target/test-classes/images.tar.gz");
  29. if (Files.exists(tgz)) {
  30. UnZip.uncompress(Paths.get("target/test-classes/images.tar.gz"), Paths.get("target/test-classes/"));
  31.  
  32. // OUTディレクトリを作成する
  33. Files.createDirectories(Paths.get("target/test-classes/out"));
  34.  
  35. dataset.setUp();
  36. Restamp.main(dataset.args);
  37. dataset.check();
  38. dataset.checkUnchanged();
  39. // IMGディレクトリを削除する
  40. UnZip.delete(Paths.get("target/test-classes/images"));
  41. // OUTディレクトリを削除する
  42. UnZip.delete(Paths.get("target/test-classes/out"));
  43. }
  44. }
  45. catch(Exception e) {
  46. fail(e.toString());
  47. }
  48. }
  49. }