- File file1 = new File(png1);
- File file2 = new File(png2);
- Assert.assertTrue(file1.exists(),
- "Did not make file " + png1 + " from argfile");
- Assert.assertTrue(file2.exists(),
- "Did not make file " + png2 + " from argfile");
- long size1 = Files.size(file1.toPath());
- long size2 = Files.size(file2.toPath());
- Assert.assertTrue(file1.isFile() && size1 > 0);
- Assert.assertTrue(file2.isFile() && size2 > 0);
- Assert.assertTrue(size2 > size1); // png2 has three sequences, png1 has 2
- cleanupArgfilesImages();
+ Assert.assertNotNull(cmds);
+ File lastFile = null;
+ for (String filename : filenames)
+ {
+ File file = new File(filename);
+ Assert.assertTrue(file.exists(), "File '" + filename
+ + "' was not created by '" + cmdLine + "'");
+ Assert.assertTrue(file.isFile(), "File '" + filename
+ + "' is not a file from '" + cmdLine + "'");
+ Assert.assertTrue(Files.size(file.toPath()) > 0, "File '" + filename
+ + "' has no content from '" + cmdLine + "'");
+ // make sure the successive output files get bigger!
+ if (lastFile != null)
+ Assert.assertTrue(
+ Files.size(file.toPath()) > Files.size(lastFile.toPath()));
+ }
+ cleanupFiles(filenames);
+ tearDown();
+ }
+
+ @DataProvider(name = "argfileOutputFiles")
+ public Object[][] argfileOutputFiles()
+ {
+ return new Object[][] {
+ { "--argfile=" + testfiles + "/**/*.txt", new String[]
+ { testfiles + "/dir1/test1.png", testfiles + "/dir2/test1.png",
+ testfiles + "/dir3/subdir/test0.png" } },
+ { "--argfile=" + testfiles + "/**/argfile.txt", new String[]
+ { testfiles + "/dir1/test1.png", testfiles + "/dir2/test1.png" } },
+ { "--argfile=" + testfiles + "/dir*/argfile.txt", new String[]
+ { testfiles + "/dir1/test1.png", testfiles + "/dir2/test1.png" } },
+ { "--initsubstitutions --open examples/uniref50.fa --image "
+ + testfiles + "/{basename}.png",
+ new String[]
+ { testfiles + "/uniref50.png" } },
+ { "--open examples/uniref50.fa --image " + testfiles
+ + "/{basename}.png",
+ new String[]
+ { testfiles + "/{basename}.png" } } };