package tunejar.test;

import org.junit.BeforeClass;
import org.loadui.testfx.GuiTest;

import javafx.application.Application;
import javafx.scene.Parent;
import tunejar.player.Player;

public abstract class AbstractTest {

	private static boolean initialized = false;
	private static GuiTest controller;

	/**
	 * Starts the TuneJar player.
	 * 
	 * @throws Exception
	 */
	@BeforeClass
	public static void setUpBeforeClass() throws Exception {
		if (!initialized) {
			new Thread(() -> Application.launch(Player.class)).start();
			Player.getInitLatch().await();
			Thread.sleep(2 * 1000);
			controller = new GuiTest() {
				@Override
				protected Parent getRootNode() {
					return Player.getInstance().getScene().getRoot();
				}
			};
			initialized = true;
		}
	}

	/**
	 * Used to manipulate the TuneJar player.
	 * 
	 * @see GuiTest
	 */
	public static GuiTest getController() {
		return controller;
	}

}

@@ -12,24 +12,94 @@
 ejar.test;%0A%0A
+import java.io.File;%0Aimport java.util.HashSet;%0Aimport java.util.Set;%0A%0A
 import org.j
@@ -116,16 +116,16 @@
 eClass;%0A
-
 import o
@@ -218,16 +218,47 @@
 Parent;%0A
+import tunejar.config.Options;%0A
 import t
@@ -482,16 +482,16 @@
 reClass%0A
-
 %09public 
@@ -540,16 +540,168 @@
 ption %7B%0A
+%09%09// To avoid seeing the blocking dialog box%0A%09%09Set%3CFile%3E set = new HashSet%3C%3E();%0A%09%09set.add(new File(%22.%22));%0A%09%09Options.getInstance().setDirectories(set);%0A%0A
 %09%09if (!i

Update AbstractTest.java