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
.bundles
.ConfigBundle
;
9 import be
.nikiroo
.utils
.IOUtils
;
10 import be
.nikiroo
.utils
.resources
.Bundles
;
11 import be
.nikiroo
.utils
.test
.TestLauncher
;
18 public class Test
extends TestLauncher
{
19 public Test(String
[] args
) {
20 super("Fanfix", args
);
21 addSeries(new BasicSupportTest(args
));
22 addSeries(new LibraryTest(args
));
26 * Main entry point of the program.
29 * the arguments passed to the {@link TestLauncher}s.
32 static public void main(String
[] args
) throws IOException
{
33 File tmpConfig
= File
.createTempFile("fanfix-config_", ".test");
34 File tmpCache
= File
.createTempFile("fanfix-cache_", ".test");
40 FileOutputStream out
= new FileOutputStream(new File(tmpConfig
,
41 "config.properties"));
42 Properties props
= new Properties();
43 props
.setProperty("CACHE_DIR", tmpCache
.getAbsolutePath());
44 props
.store(out
, null);
47 ConfigBundle config
= new ConfigBundle();
48 Bundles
.setDirectory(tmpConfig
.getAbsolutePath());
49 config
.updateFile(tmpConfig
.getPath());
51 System
.setProperty("CONFIG_DIR", tmpConfig
.getAbsolutePath());
53 int result
= new Test(args
).launch();
55 IOUtils
.deltree(tmpConfig
);
56 IOUtils
.deltree(tmpCache
);