1 package be
.nikiroo
.fanfix
.test
;
4 import java
.io
.FileOutputStream
;
5 import java
.io
.IOException
;
6 import java
.util
.Properties
;
8 import be
.nikiroo
.fanfix
.Instance
;
9 import be
.nikiroo
.fanfix
.bundles
.ConfigBundle
;
10 import be
.nikiroo
.utils
.IOUtils
;
11 import be
.nikiroo
.utils
.TempFiles
;
12 import be
.nikiroo
.utils
.resources
.Bundles
;
13 import be
.nikiroo
.utils
.test
.TestLauncher
;
20 public class Test
extends TestLauncher
{
22 * The temporary files handler.
24 static TempFiles tempFiles
;
27 * Create the Fanfix {@link TestLauncher}.
30 * the arguments to configure the number of columns and the ok/ko
33 public Test(String
[] args
) {
34 super("Fanfix", args
);
35 Instance
.setTraceHandler(null);
36 addSeries(new BasicSupportUtilitiesTest(args
));
37 addSeries(new BasicSupportDeprecatedTest(args
));
38 addSeries(new LibraryTest(args
));
39 addSeries(new ConversionTest(args
));
43 * Main entry point of the program.
46 * the arguments passed to the {@link TestLauncher}s.
48 * in case of I/O error
50 static public void main(String
[] args
) throws IOException
{
52 //Instance.getCache().setOffline(true);
55 tempFiles
= new TempFiles("fanfix-test");
57 File tmpConfig
= tempFiles
.createTempDir("fanfix-config");
58 File tmpCache
= tempFiles
.createTempDir("fanfix-cache");
60 FileOutputStream out
= null;
62 out
= new FileOutputStream(new File(tmpConfig
,
63 "config.properties"));
64 Properties props
= new Properties();
65 props
.setProperty("CACHE_DIR", tmpCache
.getAbsolutePath());
66 props
.store(out
, null);
73 ConfigBundle config
= new ConfigBundle();
74 Bundles
.setDirectory(tmpConfig
.getAbsolutePath());
75 config
.updateFile(tmpConfig
.getPath());
77 System
.setProperty("CONFIG_DIR", tmpConfig
.getAbsolutePath());
79 result
= new Test(args
).launch();
81 IOUtils
.deltree(tmpConfig
);
82 IOUtils
.deltree(tmpCache
);
87 // This is usually done in Fanfix.Main:
88 Instance
.getTempFiles().close();