+ //
+ // 3 files can control the test:
+ // - test/VERBOSE: enable verbose mode
+ // - test/OFFLINE: to forbid any downloading
+ // - test/FORCE_REFRESH: to force a clear of the cache
+ //
+ // The test files will be:
+ // - test/*.url: URL to download in text format, content = URL
+ // - test/*.story: text mode story, content = story
+ //
+
+ /**
+ * The temporary files handler.
+ */
+ static TempFiles tempFiles;
+
+ /**
+ * Create the Fanfix {@link TestLauncher}.
+ *
+ * @param args
+ * the arguments to configure the number of columns and the ok/ko
+ * {@link String}s
+ *
+ * @throws IOException
+ */
+ public Test(String[] args) throws IOException {
+ super("Fanfix", args);
+ Instance.setTraceHandler(null);
+ addSeries(new BasicSupportUtilitiesTest(args));
+ addSeries(new BasicSupportDeprecatedTest(args));
+ addSeries(new LibraryTest(args));
+
+ File sources = new File("test/");
+ if (sources.isDirectory()) {
+ for (File file : sources.listFiles()) {
+ if (file.isDirectory()) {
+ continue;
+ }
+
+ String expectedDir = new File(file.getParentFile(), "expected_"
+ + file.getName()).getAbsolutePath();
+ String resultDir = new File(file.getParentFile(), "result_"
+ + file.getName()).getAbsolutePath();
+
+ String uri;
+ if (file.getName().endsWith(".url")) {
+ uri = IOUtils.readSmallFile(file).trim();
+ } else if (file.getName().endsWith(".story")) {
+ uri = file.getAbsolutePath();
+ } else {
+ continue;
+ }
+
+ addSeries(new ConversionTest(uri, expectedDir, resultDir, args));
+ }
+ }