<commit_before>package com.enioka.jqm.tools;

import java.io.File;

import org.apache.commons.io.FileUtils;
import org.junit.Assert;
import org.junit.Assume;
import org.junit.Before;
import org.junit.Test;

import com.enioka.jqm.api.JobRequest;
import com.enioka.jqm.test.helpers.CreationTools;
import com.enioka.jqm.test.helpers.TestHelpers;

public class SpringTest extends JqmBaseTest
{
    @Before
    public void prepare()
    {
        FileUtils.deleteQuietly(new File("./target/TEST.db"));
    }

    /**
     * No specific CL - isolated launch, using normal runners. Still, all launches work on the same database.
     */
    @Test
    public void testSimpleSingleLaunch()
    {
        CreationTools.createDatabaseProp("jdbc/spring_ds", "org.h2.Driver", "jdbc:h2:./target/TEST.db;DB_CLOSE_ON_EXIT=FALSE", "sa", "sa",
                cnx, "SELECT 1", null, true);
        CreationTools.createJobDef(null, true, "com.enioka.jqm.test.spring1.Application", null,<commit_msg>Hopefully, last Java 9+ commit.<commit_after>package com.enioka.jqm.tools;

import java.io.File;

import org.apache.commons.io.FileUtils;
import org.junit.Assert;
import org.junit.Assume;
import org.junit.Before;
import org.junit.Test;

import com.enioka.jqm.api.JobRequest;
import com.enioka.jqm.test.helpers.CreationTools;
import com.enioka.jqm.test.helpers.TestHelpers;

public class SpringTest extends JqmBaseTest
{
    @Before
    public void prepare()
    {
        FileUtils.deleteQuietly(new File("./target/TEST.db"));
    }

    /**
     * No specific CL - isolated launch, using normal runners. Still, all launches work on the same database.
     */
    @Test
    public void testSimpleSingleLaunch()
    {
        String ver = System.getProperty("java.version");
        double javaVersion = Double.parseDouble(ver.substring(0, ver.indexOf('.') + 2));
        Assume.assumeTrue(javaVersion < 1.9); // The tested version of Spring is not really compatible with Java 9+.
        
        CreationTools.createDatabaseProp("jdbc/spring_ds", "org.h2.Driver", "jdbc:h2:./target/TEST.db;DB_CLOSE_ON_EXIT=FALSE", "sa", "sa",
                cnx, "SELECT 1", null, true);
        CreationTools.createJobDef(null, true, "com.enioka.jqm.test.spring1.Application", null,
{'fraction_non_alphanumeric': 0.12766903914590746, 'fraction_numerical': 0.006227758007117438, 'mean_word_length': 3.4534653465346534, 'pattern_counts': {'":': 0, '<': 4, '<?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': '379326', 'n_tokens_mistral': 747, 'n_tokens_neox': 720, 'n_words': 155}