<commit_before>package org.cqframework.cql.execution;

import java.io.File;

import org.testng.annotations.Test;

import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;
import static org.testng.Assert.fail;

public class EngineTest {

    @Test
    public void testEngineWithAgeFile() {
        // Configure the engine with test data
        Engine.setPatientSource(new TestPatientSource());

        // Run the sample age script
        File file = new File(EngineTest.class.getResource("age.cql").getFile());
        Results results = null;
        try {
            results = Engine.executeCql(file);
        } catch (Exception e) {<commit_msg>Added code to Decode File path<commit_after>package org.cqframework.cql.execution;

import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.testng.annotations.Test;

import java.io.File;
import java.io.UnsupportedEncodingException;
import java.net.URL;
import java.net.URLDecoder;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.notNullValue;
import static org.testng.Assert.assertTrue;
import static org.testng.Assert.fail;

public class EngineTest {

    @Test
    public void testEngineWithAgeFile() {
        // Configure the engine with test data
        Engine.setPatientSource(new TestPatientSource());

        // Run the sample age script
        URL fileUrl = EngineTest.class.getResource("age.cql");
        File file = null;
        try {
            String fileLocation = URLDecoder.decode(fileUrl.getFile(),"UTF-8");
            file = new File(fileLocation);
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }

        assertTrue(file.exists(), "age.cql must exist for test to run correctly. ("+ file.toString() + ")");

        Results results = null;
        try {
            results = Engine.executeCql(file);
        } catch (Exception e) {
{'fraction_non_alphanumeric': 0.1011764705882353, 'fraction_numerical': 0.00047058823529411766, 'mean_word_length': 3.20990099009901, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, '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': '1569220', 'n_tokens_mistral': 619, 'n_tokens_neox': 590, 'n_words': 144}