<commit_before>package org.qamatic.mintleaf;

import org.junit.Test;
import org.qamatic.mintleaf.configuration.ArgPatternHandler;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertTrue;

/**
 * Created by QAmatic Team on 3/30/17.
 */
public class ParameterTests {

    @Test
    public void substitueAntVar(){
        ArgPatternHandler argPatternHandler = new ArgPatternHandler("select ${col_name},${col_name} from ${table_name}");
        argPatternHandler.getUserProperties().put("col_name", "mycol");
        argPatternHandler.getUserProperties().put("table_name", "mytable");
        assertEquals("select mycol,mycol from mytable",argPatternHandler.getText());
    }


    @Test
    public void substitueAntVarSysVar(){
        ArgPatternHandler argPatternHandler = new ArgPatternHandler("select ${JAVA_HOME}");

        assertTrue(!argPatternHandler.getText().contains("JAVA_HOME"));
    }
}<commit_msg>antarg tests<commit_after>package org.qamatic.mintleaf;

import org.junit.Test;
import org.qamatic.mintleaf.configuration.ArgPatternHandler;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertTrue;

/**
 * Created by QAmatic Team on 3/30/17.
 */
public class ParameterTests {

    @Test
    public void substitueAntVar(){
        ArgPatternHandler argPatternHandler = new ArgPatternHandler("select ${col_name},${col_name} from ${table_name}");
        argPatternHandler.getUserProperties().put("col_name", "mycol");
        argPatternHandler.getUserProperties().put("table_name", "mytable");
        assertEquals("select mycol,mycol from mytable",argPatternHandler.getText());
    }


    @Test
    public void substitueAntVarSysVar(){
        ArgPatternHandler argPatternHandler = new ArgPatternHandler("select ${JAVA_HOME}");
        assertTrue(!argPatternHandler.getText().contains("JAVA_HOME"));
    }

    @Test
    public void substitueAntVarSysVarOverUser(){
        ArgPatternHandler argPatternHandler = new ArgPatternHandler("select ${JAVA_HOME}");
        argPatternHandler.getUserProperties().put("JAVA_HOME", "mytable");
        assertEquals("select mytable",argPatternHandler.getText());
    }
}
{'fraction_non_alphanumeric': 0.11907810499359796, 'fraction_numerical': 0.004268032437046522, 'mean_word_length': 4.745098039215686, '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': '1215713', 'n_tokens_mistral': 675, 'n_tokens_neox': 655, 'n_words': 122}