<commit_before>package cat.nyaa.nyaacore.database;

import cat.nyaa.nyaacore.database.provider.MysqlDatabase;
import cat.nyaa.nyaacore.database.relational.Query;
import cat.nyaa.nyaacore.database.relational.RelationalDB;
import ch.vorburger.exec.ManagedProcessException;
import ch.vorburger.mariadb4j.DB;
import ch.vorburger.mariadb4j.DBConfigurationBuilder;
import org.bukkit.plugin.Plugin;
import org.junit.*;

import java.io.File;
import java.io.IOException;
import java.net.ServerSocket;
import java.sql.SQLException;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.stream.IntStream;

import static org.junit.Assert.*;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

public class MysqlDatabaseTest {
    private static int port;
    private static DB embeddedDB;
    private RelationalDB db;
    private RelationalDB db2;

    @BeforeClass
    public static void prepareEmbeddedDB() throws ManagedProcessException, IOException {
        MysqlDatabase.executor = (p) -> Runnable::run;
        MysqlDatabase.logger = (p) -> Logger.getLogger("NyaaCoreTest");
        DBConfigurationBuilder configBuilder = DBConfigurationBuilder.newBuilder();
        String tmpDir = new File(System.getProperty("java.io.tmpdir")).getCanonicalPath();
        configBuilder.setBaseDir(tmpDir + "MariaDB4j\\base");
        configBuilder.setLibDir(tmpDir + "MariaDB4j\\base\\libs");
        configBuilder.setDataDir(tmpDir + "MariaDB4j\\data");
        ServerSocket s = new ServerSocket(0);
        port = s.getLocalPort();
        configBuilder.setPort(port);
        embeddedDB = DB.newEmbeddedDB(configBuilder.build());
        s.close();
        embeddedDB.start();
        port = embeddedDB.getConfiguration().getPort();
    }


    @AfterClass
    public static void shutdownEmbeddedDB() {<commit_msg>really fix test<commit_after>package cat.nyaa.nyaacore.database;

import cat.nyaa.nyaacore.database.provider.MysqlDatabase;
import cat.nyaa.nyaacore.database.relational.Query;
import cat.nyaa.nyaacore.database.relational.RelationalDB;
import ch.vorburger.exec.ManagedProcessException;
import ch.vorburger.mariadb4j.DB;
import ch.vorburger.mariadb4j.DBConfigurationBuilder;
import org.bukkit.plugin.Plugin;
import org.junit.*;

import java.io.File;
import java.io.IOException;
import java.net.ServerSocket;
import java.sql.SQLException;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.stream.IntStream;

import static org.junit.Assert.*;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

public class MysqlDatabaseTest {
    private static int port;
    private static DB embeddedDB;
    private RelationalDB db;
    private RelationalDB db2;

    @BeforeClass
    public static void prepareEmbeddedDB() throws ManagedProcessException, IOException {
        MysqlDatabase.executor = (p) -> Runnable::run;
        MysqlDatabase.logger = (p) -> Logger.getLogger("NyaaCoreTest");
        DBConfigurationBuilder configBuilder = DBConfigurationBuilder.newBuilder();
        String tmpDir = new File(System.getProperty("java.io.tmpdir")).getCanonicalPath();
        configBuilder.setBaseDir(tmpDir + File.separatorChar + "MariaDB4j" + File.separatorChar + "base");
        configBuilder.setLibDir(tmpDir + File.separatorChar + "MariaDB4j" + File.separatorChar + "base" + File.separatorChar + "libs");
        configBuilder.setDataDir(tmpDir + File.separatorChar + "MariaDB4j" + File.separatorChar + "data");
        ServerSocket s = new ServerSocket(0);
        port = s.getLocalPort();
        configBuilder.setPort(port);
        embeddedDB = DB.newEmbeddedDB(configBuilder.build());
        s.close();
        embeddedDB.start();
        port = embeddedDB.getConfiguration().getPort();
    }


    @AfterClass
    public static void shutdownEmbeddedDB() {
{'fraction_non_alphanumeric': 0.10999263442180211, 'fraction_numerical': 0.003437269825681316, 'mean_word_length': 4.236503856041131, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '1564024', 'n_tokens_mistral': 1258, 'n_tokens_neox': 1219, 'n_words': 235}