System { public static ComponentManager initialize(ClassLoader classLoader) { return initialize(null, null, null, classLoader); } private  System(); static ComponentManager initialize(ClassLoader classLoader); static ComponentManager initialize(); static ComponentManager initialize(File permanentDirectory); static ComponentManager initialize(File permanentDirectory, File resourceDirectory); static ComponentManager initialize(File permanentDirectory, File resourceDirectory, File temporaryDirectory); static ComponentManager initialize(File permanentDirectory, File resourceDirectory, File temporaryDirectory,
        ClassLoader classLoader); static void dispose(ComponentManager componentManager);  }
@Test void initializeWithNoParameter() throws Exception { ComponentManager componentManager = System.initialize(); assertNotNull(componentManager); Environment environment = componentManager.getInstance(Environment.class); ReflectionUtils.setFieldValue(environment, "logger", NOPLogger.NOP_LOGGER); assertEquals(TMPDIR, environment.getTemporaryDirectory()); assertEquals(new File(java.lang.System.getProperty("java.io.tmpdir")), environment.getPermanentDirectory()); }
@Test void initializeWithAllDirectoriesSet() throws Exception { File permanentDirectory = new File("/permanent"); File temporaryDirectory = new File("/temporary"); File resourceDirectory = new File("/resource"); ComponentManager componentManager = System.initialize(permanentDirectory, resourceDirectory, temporaryDirectory); assertNotNull(componentManager); Environment environment = componentManager.getInstance(Environment.class); assertEquals(temporaryDirectory, environment.getTemporaryDirectory()); assertEquals(permanentDirectory, environment.getPermanentDirectory()); }