<commit_before>package org.opentosca.toscana.core;

import java.io.File;
import java.io.IOException;

import org.opentosca.toscana.core.testutils.CategoryAwareJUnitRunner;

import org.apache.commons.io.FileUtils;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.Rule;
import org.junit.rules.TemporaryFolder;
import org.junit.runner.RunWith;

/**
 If files need to get written on disk during tests, use {@link #temporaryFolder}
 */
@RunWith(CategoryAwareJUnitRunner.class)
public abstract class BaseJUnitTest extends BaseTest {

    public static final File PROJECT_ROOT = new File(System.getProperty("user.dir"));

    /**
     Grants disk access. Is reset before every test method.
     */
    @Rule
    public final TemporaryFolder temporaryFolder = new TemporaryFolder(PROJECT_ROOT);
    // "user.dir" is module root
    public File tmpdir;

    @Before
    public final void initTmpdir() {
        tmpdir = temporaryFolder.getRoot();
        tmpdir.mkdir();
        tmpdir.deleteOnExit();
    }

    @AfterClass
    public static void cleanUpDisk() throws IOException, InterruptedException {
        File[] files = PROJECT_ROOT.listFiles((file1, s) -> s.matches("junit[0-9]+"));
        for (File file : files) {
            FileUtils.deleteDirectory(file);
        }
    }<commit_msg>Fix BaseJUnitTest<commit_after>package org.opentosca.toscana.core;

import java.io.File;
import java.io.IOException;

import org.opentosca.toscana.core.testutils.CategoryAwareJUnitRunner;

import org.apache.commons.io.FileUtils;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.Rule;
import org.junit.rules.TemporaryFolder;
import org.junit.runner.RunWith;

/**
 If files need to get written on disk during tests, use {@link #temporaryFolder}
 */
@RunWith(CategoryAwareJUnitRunner.class)
public abstract class BaseJUnitTest extends BaseTest {

    public static final File PROJECT_ROOT = new File(System.getProperty("user.dir"));

    /**
     Grants disk access. Is reset before every test method.
     */
    @Rule
    public final TemporaryFolder temporaryFolder = new TemporaryFolder(PROJECT_ROOT);
    // "user.dir" is module root
    public File tmpdir;

    @Before
    public final void initTmpdir() throws IOException {
        tmpdir = temporaryFolder.newFolder();
    }

    @AfterClass
    public static void cleanUpDisk() throws IOException, InterruptedException {
        File[] files = PROJECT_ROOT.listFiles((file1, s) -> s.matches("junit[0-9]+"));
        for (File file : files) {
            FileUtils.deleteDirectory(file);
        }
    }
{'fraction_non_alphanumeric': 0.10339506172839506, 'fraction_numerical': 0.0023148148148148147, 'mean_word_length': 3.597517730496454, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '6540550', 'n_tokens_mistral': 770, 'n_tokens_neox': 761, 'n_words': 195}