package _VisualDVM.Passes.All;
import _VisualDVM.Global;
import _VisualDVM.Repository.Server.ServerCode;
import _VisualDVM.TestingSystem.DVM.DVMTasks.DVMRunTask;
public class DownloadTaskTest extends DownloadTest {
    @Override
    public String getIconPath() {
        return "/icons/OpenProject.png";
    }
    @Override
    protected boolean canStart(Object... args) throws Exception {
        target = null;
        if (Global.testingServer.db.dvmRunTasks.getUI().CheckCurrent(Log)) {
            DVMRunTask task = Global.testingServer.db.dvmRunTasks.getUI().getCurrent();
            if (!Global.testingServer.db.tests.containsKey(task.test_id)) {
                Log.Writeln_("Теста с ключом " + task.test_id + " не существует!");
                return false;
            }
            target = Global.testingServer.db.tests.get(task.test_id);
            return SendRequest(ServerCode.DownloadTest, String.valueOf(target.id));
        }
        return false;
    }
}
