<commit_before>package com.github.cstroe.spendhawk.report;

import com.github.cstroe.spendhawk.report.impl.AllExpensesReport;
import com.github.cstroe.spendhawk.util.BaseIT;
import org.junit.Test;

import java.util.HashMap;
import java.util.Map;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.is;

public class AllExpensesReportIT extends BaseIT {

    @Test
    public void testReport() throws Exception {
        startTransaction();
        ReportRunner runner = new AllExpensesReport();

        runner.getParameters().stream().forEach(p -> {
            switch(p.getId()) {
                case "startDate":
                    p.setValue("1/1/2015");
                    return;
                case "endDate":
                    p.setValue("1/31/2015");
            }
        });

        runner.runReport();
        ReportResult result = runner.getResult();

        Map<String,String> values = new HashMap<>();
        for(int i = 0; i < result.getNumRows(); i++) {
            values.put(result.getCell(i, 0), result.getCell(i, 1));
        }

        assertThat(values.keySet().size(), is(2));
        assertThat(values.get("Groceries"), is(equalTo("(91.09)")));
        assertThat(values.get("Eating Out"), is(equalTo("(14.98)")));<commit_msg>Run this test inside the container.<commit_after>package com.github.cstroe.spendhawk.report;

import com.github.cstroe.spendhawk.report.impl.AllExpensesReport;
import com.github.cstroe.spendhawk.util.BaseIT;
import org.jboss.arquillian.junit.Arquillian;
import org.junit.Test;
import org.junit.runner.RunWith;

import java.util.HashMap;
import java.util.Map;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.is;

@RunWith(Arquillian.class)
public class AllExpensesReportIT extends BaseIT {

    @Test
    public void testReport() throws Exception {
        startTransaction();
        ReportRunner runner = new AllExpensesReport();

        runner.getParameters().stream().forEach(p -> {
            switch(p.getId()) {
                case "startDate":
                    p.setValue("1/1/2015");
                    return;
                case "endDate":
                    p.setValue("1/31/2015");
            }
        });

        runner.runReport();
        ReportResult result = runner.getResult();

        Map<String,String> values = new HashMap<>();
        for(int i = 0; i < result.getNumRows(); i++) {
            values.put(result.getCell(i, 0), result.getCell(i, 1));
        }

        assertThat(values.keySet().size(), is(2));
        assertThat(values.get("Groceries"), is(equalTo("(91.09)")));
        assertThat(values.get("Eating Out"), is(equalTo("(14.98)")));
{'fraction_non_alphanumeric': 0.14001421464108033, 'fraction_numerical': 0.017768301350390904, 'mean_word_length': 2.627577319587629, 'pattern_counts': {'":': 4, '<': 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': '1794973', 'n_tokens_mistral': 885, 'n_tokens_neox': 844, 'n_words': 151}