<commit_before>package e2e;

import com.github.danielflower.mavenplugins.release.AnnotatedTag;
import org.apache.commons.io.FileUtils;
import org.apache.maven.shared.invoker.MavenInvocationException;
import org.eclipse.jgit.api.Git;
import org.eclipse.jgit.api.errors.GitAPIException;
import org.eclipse.jgit.lib.ObjectId;
import org.junit.BeforeClass;
import org.junit.Test;
import scaffolding.MavenExecutionException;
import scaffolding.MvnRunner;
import scaffolding.TestProject;

import java.io.File;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.List;

import static org.hamcrest.CoreMatchers.containsString;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.not;
import static org.hamcrest.core.IsEqual.equalTo;
import static scaffolding.ExactCountMatcher.oneOf;
import static scaffolding.ExactCountMatcher.twoOf;
import static scaffolding.GitMatchers.hasCleanWorkingDirectory;
import static scaffolding.GitMatchers.hasTag;

public class LocalPluginTest {

    final String buildNumber = String.valueOf(System.currentTimeMillis());
    final String expected = "1.0." + buildNumber;
    final TestProject testProject = TestProject.localPluginProject();

    @BeforeClass
    public static void installPluginToLocalRepo() throws MavenInvocationException {
        MvnRunner.installReleasePluginToLocalRepo();
    }

    @Test
    public void runWithLocalPluginSnapshotDependencyShouldSucceed() throws Exception {
        List<String> outputLines = testProject.mvn("releaser:release", "-P project-version");

        for (String line : outputLines)
            System.out.println(line);

        assertThat(testProject.local, hasTag("local-plugin-1.0.0"));
        assertThat(testProject.local, hasTag("local-maven-plugin-1.0.0"));
        assertThat(testProject.local, hasTag("simple-project-1.0.0"));
    }

    @Test
    public void runWithSnapshotPluginDependencyShouldFail() throws Exception {
        try {
            List<String> output = testProject.mvn("releaser:release", "-P snapshot-version");
        } catch (MavenExecutionException mee) {
             assertThat(mee.output, oneOf(containsString("[ERROR]  * simple-project references plugin commons-io 2.7-SNAPSHOT")));
        }
    }
}<commit_msg>code cleanup<commit_after>package e2e;

import org.junit.BeforeClass;
import org.junit.Test;
import scaffolding.MavenExecutionException;
import scaffolding.MvnRunner;
import scaffolding.TestProject;

import java.util.List;

import static org.hamcrest.CoreMatchers.containsString;
import static org.hamcrest.MatcherAssert.assertThat;
import static scaffolding.ExactCountMatcher.oneOf;
import static scaffolding.GitMatchers.hasTag;

public class LocalPluginTest {

    final TestProject testProject = TestProject.localPluginProject();

    @BeforeClass
    public static void installPluginToLocalRepo() {
        MvnRunner.installReleasePluginToLocalRepo();
    }

    @Test
    public void runWithLocalPluginSnapshotDependencyShouldSucceed() throws Exception {
        List<String> outputLines = testProject.mvn("releaser:release", "-P project-version");

        for (String line : outputLines)
            System.out.println(line);

        assertThat(testProject.local, hasTag("local-plugin-1.0.0"));
        assertThat(testProject.local, hasTag("local-maven-plugin-1.0.0"));
        assertThat(testProject.local, hasTag("simple-project-1.0.0"));
    }

    @Test
    public void runWithSnapshotPluginDependencyShouldFail() throws Exception {
        try {
            testProject.mvn("releaser:release", "-P snapshot-version");
        } catch (MavenExecutionException mee) {
            assertThat(mee.output, oneOf(containsString("[ERROR]  * simple-project references plugin commons-io 2.7-SNAPSHOT")));
        }
    }
}
{'fraction_non_alphanumeric': 0.10240496508921644, 'fraction_numerical': 0.0067235583139384535, 'mean_word_length': 4.349930843706777, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, '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': '5202149', 'n_tokens_mistral': 1131, 'n_tokens_neox': 1105, 'n_words': 209}