<commit_before>package org.workcraft.plugins.cpog;

import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.workcraft.Framework;
import org.workcraft.exceptions.DeserialisationException;
import org.workcraft.plugins.cpog.tasks.ScencoExternalToolTask;
import org.workcraft.plugins.cpog.tasks.ScencoResultHandler;
import org.workcraft.plugins.cpog.tasks.ScencoSolver;
import org.workcraft.tasks.TaskManager;
import org.workcraft.utils.BackendUtils;
import org.workcraft.utils.PackageUtils;
import org.workcraft.utils.WorkspaceUtils;
import org.workcraft.workspace.WorkspaceEntry;

import java.net.URL;
import java.util.Collection;

public class ScencoCommandTests {

    @BeforeAll
    public static void init() {
        final Framework framework = Framework.getInstance();
        framework.init();
        CpogSettings.setScencoCommand(BackendUtils.getTemplateToolPath("ScEnco", "scenco"));
    }

    @Test
    public void cpogSettingsTest() throws DeserialisationException {
        final Framework framework = Framework.getInstance();
        final ClassLoader classLoader = ClassLoader.getSystemClassLoader();
        String workName = PackageUtils.getPackagePath(getClass(), "instructions-scenario.cpog.work");
        URL url = classLoader.getResource(workName);

        WorkspaceEntry we = framework.loadWork(url.getFile());
        VisualCpog cpog = WorkspaceUtils.getAs(we, VisualCpog.class);

        EncoderSettings settings = new EncoderSettings(10, EncoderSettings.GenerationMode.SEQUENTIAL, false, false);
        settings.setBits(2);
        settings.setGenerationModeInt(5);
        final ScencoSolver solver = new ScencoSolver(settings, we);
        final ScencoExternalToolTask task = new ScencoExternalToolTask(we, solver);
        final ScencoResultHandler monitor = new ScencoResultHandler(task);
        final TaskManager taskManager = framework.getTaskManager();<commit_msg>Update tests for Windows clasp and minisat<commit_after>package org.workcraft.plugins.cpog;

import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Assumptions;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.workcraft.Framework;
import org.workcraft.exceptions.DeserialisationException;
import org.workcraft.plugins.cpog.tasks.ScencoExternalToolTask;
import org.workcraft.plugins.cpog.tasks.ScencoResultHandler;
import org.workcraft.plugins.cpog.tasks.ScencoSolver;
import org.workcraft.tasks.TaskManager;
import org.workcraft.utils.BackendUtils;
import org.workcraft.utils.DesktopApi;
import org.workcraft.utils.PackageUtils;
import org.workcraft.utils.WorkspaceUtils;
import org.workcraft.workspace.WorkspaceEntry;

import java.net.URL;
import java.util.Collection;

public class ScencoCommandTests {

    @BeforeAll
    public static void skipOnMac() {
        Assumptions.assumeFalse(DesktopApi.getOs().isMac());
    }

    @BeforeAll
    public static void init() {
        final Framework framework = Framework.getInstance();
        framework.init();
        CpogSettings.setScencoCommand(BackendUtils.getTemplateToolPath("ScEnco", "scenco"));
    }

    @Test
    public void cpogSettingsTest() throws DeserialisationException {
        final Framework framework = Framework.getInstance();
        final ClassLoader classLoader = ClassLoader.getSystemClassLoader();
        String workName = PackageUtils.getPackagePath(getClass(), "instructions-scenario.cpog.work");
        URL url = classLoader.getResource(workName);

        WorkspaceEntry we = framework.loadWork(url.getFile());
        VisualCpog cpog = WorkspaceUtils.getAs(we, VisualCpog.class);

        EncoderSettings settings = new EncoderSettings(10, EncoderSettings.GenerationMode.SEQUENTIAL, false, false);
        settings.setBits(2);
        settings.setGenerationModeInt(5);
        final ScencoSolver solver = new ScencoSolver(settings, we);
        final ScencoExternalToolTask task = new ScencoExternalToolTask(we, solver);
        final ScencoResultHandler monitor = new ScencoResultHandler(task);
        final TaskManager taskManager = framework.getTaskManager();
{'fraction_non_alphanumeric': 0.09352517985611511, 'fraction_numerical': 0.0019184652278177458, 'mean_word_length': 4.57620320855615, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6443398', 'n_tokens_mistral': 1197, 'n_tokens_neox': 1176, 'n_words': 225}