<commit_before>package com.collective.celos.ci.config.deploy;

import com.collective.celos.ci.config.CelosCiCommandLine;
import com.collective.celos.ci.config.ContextParser;
import junit.framework.Assert;
import org.junit.Test;

import java.io.File;
import java.net.URI;

/**
 * Created by akonopko on 10/1/14.
 */
public class ContextParserTest {

    @Test
    public void testContextParser() throws Exception {
        ContextParser contextParser = new ContextParser();
        String[] clParams = "--target target --mode TEST --deployDir deploydir --workflowName workflow --testDir testDir".split(" ");

        CelosCiCommandLine commandLine = contextParser.parse(clParams);

        Assert.assertEquals(commandLine.getDeployDir(), new File("deploydir"));
        Assert.assertEquals(commandLine.getTestCasesDir(), new File("testDir"));
        Assert.assertEquals(commandLine.getMode(), CelosCiContext.Mode.TEST);
        Assert.assertEquals(commandLine.getTargetUri(), URI.create("target"));
        Assert.assertEquals(commandLine.getUserName(), System.getProperty("user.name"));
        Assert.assertEquals(commandLine.getWorkflowName(), "workflow");
    }
}<commit_msg>more tests<commit_after>package com.collective.celos.ci.config.deploy;

import com.collective.celos.ci.config.CelosCiCommandLine;
import com.collective.celos.ci.config.ContextParser;
import junit.framework.Assert;
import org.junit.Test;

import java.io.File;
import java.net.URI;

/**
 * Created by akonopko on 10/1/14.
 */
public class ContextParserTest {

    @Test
    public void testContextParserTest() throws Exception {
        ContextParser contextParser = new ContextParser();
        String[] clParams = "--target target --mode TEST --deployDir deploydir --workflowName workflow --testDir testDir".split(" ");

        CelosCiCommandLine commandLine = contextParser.parse(clParams);

        Assert.assertEquals(commandLine.getDeployDir(), new File("deploydir"));
        Assert.assertEquals(commandLine.getTestCasesDir(), new File("testDir"));
        Assert.assertEquals(commandLine.getMode(), CelosCiContext.Mode.TEST);
        Assert.assertEquals(commandLine.getTargetUri(), URI.create("target"));
        Assert.assertEquals(commandLine.getUserName(), System.getProperty("user.name"));
        Assert.assertEquals(commandLine.getWorkflowName(), "workflow");
    }

    @Test
    public void testContextParserDeploy() throws Exception {
        ContextParser contextParser = new ContextParser();
        String[] clParams = "--target target --mode DEPLOY --deployDir deploydir --workflowName workflow --testDir testDir".split(" ");

        CelosCiCommandLine commandLine = contextParser.parse(clParams);

        Assert.assertEquals(commandLine.getDeployDir(), new File("deploydir"));
        Assert.assertEquals(commandLine.getTestCasesDir(), new File("testDir"));
        Assert.assertEquals(commandLine.getMode(), CelosCiContext.Mode.DEPLOY);
        Assert.assertEquals(commandLine.getTargetUri(), URI.create("target"));
        Assert.assertEquals(commandLine.getUserName(), System.getProperty("user.name"));
        Assert.assertEquals(commandLine.getWorkflowName(), "workflow");
    }

    @Test
    public void testContextParserUndeploy() throws Exception {
        ContextParser contextParser = new ContextParser();
        String[] clParams = "--target target --mode UNDEPLOY --deployDir deploydir --workflowName workflow --testDir testDir".split(" ");

        CelosCiCommandLine commandLine = contextParser.parse(clParams);

        Assert.assertEquals(commandLine.getDeployDir(), new File("deploydir"));
        Assert.assertEquals(commandLine.getTestCasesDir(), new File("testDir"));
        Assert.assertEquals(commandLine.getMode(), CelosCiContext.Mode.UNDEPLOY);
        Assert.assertEquals(commandLine.getTargetUri(), URI.create("target"));
        Assert.assertEquals(commandLine.getUserName(), System.getProperty("user.name"));
        Assert.assertEquals(commandLine.getWorkflowName(), "workflow");
    }

}
{'fraction_non_alphanumeric': 0.1272998508204873, 'fraction_numerical': 0.002486325211337643, 'mean_word_length': 4.258823529411765, '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': '2501214', 'n_tokens_mistral': 1111, 'n_tokens_neox': 1070, 'n_words': 201}