<commit_before>package fr.adrienbrault.idea.symfony2plugin.tests;

import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.vfs.VfsUtil;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.testFramework.UsefulTestCase;
import com.intellij.testFramework.fixtures.IdeaProjectTestFixture;
import com.intellij.testFramework.fixtures.IdeaTestFixtureFactory;
import fr.adrienbrault.idea.symfony2plugin.Settings;
import org.apache.commons.lang.RandomStringUtils;
import org.apache.commons.lang.StringUtils;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * @author <NAME> <<EMAIL>>
 */
abstract public class SymfonyTempCodeInsightFixtureTestCase extends UsefulTestCase {
    private Project project;

    private IdeaProjectTestFixture myFixture;

    @Override
    public void setUp() throws Exception {
        super.setUp();

        myFixture = IdeaTestFixtureFactory.getFixtureFactory()
            .createFixtureBuilder(RandomStringUtils.randomAlphanumeric(20))
            .getFixture();

        myFixture.setUp();

        project = myFixture.getProject();
        Settings.getInstance(project).pluginEnabled = true;
    }

    protected void tearDown() throws Exception {
        try {
            this.myFixture.tearDown();<commit_msg>prevent memory leaks<commit_after>package fr.adrienbrault.idea.symfony2plugin.tests;

import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.vfs.VfsUtil;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.testFramework.UsefulTestCase;
import com.intellij.testFramework.fixtures.IdeaProjectTestFixture;
import com.intellij.testFramework.fixtures.IdeaTestFixtureFactory;
import fr.adrienbrault.idea.symfony2plugin.Settings;
import org.apache.commons.lang.RandomStringUtils;
import org.apache.commons.lang.StringUtils;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * @author <NAME> <<EMAIL>>
 */
abstract public class SymfonyTempCodeInsightFixtureTestCase extends UsefulTestCase {
    private Project project;

    private IdeaProjectTestFixture myFixture;

    @Override
    public void setUp() throws Exception {
        super.setUp();

        myFixture = IdeaTestFixtureFactory.getFixtureFactory()
            .createFixtureBuilder(RandomStringUtils.randomAlphanumeric(20))
            .getFixture();

        myFixture.setUp();

        project = myFixture.getProject();
        Settings.getInstance(project).pluginEnabled = true;
    }

    protected void tearDown() throws Exception {
        this.project = null;

        try {
            this.myFixture.tearDown();
{'fraction_non_alphanumeric': 0.09468049514887922, 'fraction_numerical': 0.0026764804282368685, 'mean_word_length': 4.358422939068101, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '1699435', 'n_tokens_mistral': 893, 'n_tokens_neox': 872, 'n_words': 147}