<commit_before>package org.apache.cassandra;

import org.testng.annotations.Test;
import org.testng.annotations.BeforeMethod;

import java.io.File;

@Test(groups={"serial"})
public class ServerTest {
    // TODO clean up static structures too (e.g. memtables)
    @BeforeMethod
    public void cleanup() {
        // for convenience, this assumes that you haven't changed the test config away from storing everything
        // under /var/cassandra.
        for (String dirname : new String[] {"bootstrap", "commitlog", "data", "staging", "system"}) {
            File dir = new File("/var/cassandra", dirname);
            for (File f : dir.listFiles()) {
                f.delete();
            }
        }
    }
}
<commit_msg>glean test dirs to cleanup from configuration<commit_after>package org.apache.cassandra;

import org.testng.annotations.Test;
import org.testng.annotations.BeforeMethod;
import org.apache.cassandra.config.DatabaseDescriptor;

import java.io.File;

@Test(groups={"serial"})
public class ServerTest {
    // TODO clean up static structures too (e.g. memtables)
    @BeforeMethod
    public void cleanup()
    {
        String[] directoryNames = {
                DatabaseDescriptor.getBootstrapFileLocation(),
                DatabaseDescriptor.getLogFileLocation(),
                DatabaseDescriptor.getDataFileLocation(),
                DatabaseDescriptor.getMetadataDirectory(),
        };

        for (String dirName : directoryNames)
        {
            File dir = new File(dirName);
            if (!dir.exists())
            {
                throw new RuntimeException("No such directory: " + dir.getAbsolutePath());
            }
        }
    }

{'fraction_non_alphanumeric': 0.1078838174273859, 'fraction_numerical': 0.0, 'mean_word_length': 2.4519427402862988, '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': '3094383', 'n_tokens_mistral': 451, 'n_tokens_neox': 439, 'n_words': 115}