<commit_before>package be.ibridge.kettle.trans.step.excelinput;

import be.ibridge.kettle.core.Const;
import be.ibridge.kettle.trans.Trans;
import be.ibridge.kettle.trans.TransMeta;
import be.ibridge.kettle.trans.step.KettleStepUseCase;
import be.ibridge.kettle.trans.step.errorhandling.FileErrorHandlerMissingFiles;

public class ExcelInputReplayTest extends KettleStepUseCase {

	public void testInputOKIgnoreErrorsTrueStrictFalse() throws Exception {
		directory = "test/useCases/replay/excelInputReplayGoodIgnoreTrueStrictFalse/";
		expectFiles(directory, 2);
		meta = new TransMeta(directory + "transform.ktr");
		trans = new Trans(log, meta);
		boolean ok = trans.execute(null);
		assertTrue(ok);
		trans.waitUntilFinished();
		trans.endProcessing("end"); //$NON-NLS-1$
		assertEquals(0, trans.getErrors());
		expectFiles(directory, 2);
	}

	public void testInputOKIgnoreErrorsTrue() throws Exception {
		directory = "test/useCases/replay/excelInputReplayGoodIgnoreTrue/";
		expectFiles(directory, 2);
		meta = new TransMeta(directory + "transform.ktr");
		trans = new Trans(log, meta);
		boolean ok = trans.execute(null);
		assertTrue(ok);
		trans.waitUntilFinished();
		trans.endProcessing("end"); //$NON-NLS-1$
		assertEquals(0, trans.getErrors());
		expectFiles(directory, 2);<commit_msg>Number of expected files changed from 2 to 4: if you don't want to have the .line files, you don't specify them.   So, ignore=true will create the .line files, one per sheet: 2 extra files = 4 files.<commit_after>package be.ibridge.kettle.trans.step.excelinput;

import be.ibridge.kettle.core.Const;
import be.ibridge.kettle.trans.Trans;
import be.ibridge.kettle.trans.TransMeta;
import be.ibridge.kettle.trans.step.KettleStepUseCase;
import be.ibridge.kettle.trans.step.errorhandling.FileErrorHandlerMissingFiles;

public class ExcelInputReplayTest extends KettleStepUseCase {

	public void testInputOKIgnoreErrorsTrueStrictFalse() throws Exception {
		directory = "test/useCases/replay/excelInputReplayGoodIgnoreTrueStrictFalse/";
		expectFiles(directory, 2);
		meta = new TransMeta(directory + "transform.ktr");
		trans = new Trans(log, meta);
		boolean ok = trans.execute(null);
		assertTrue(ok);
		trans.waitUntilFinished();
		trans.endProcessing("end"); //$NON-NLS-1$
		assertEquals(0, trans.getErrors());
        
		// Changed from 2 to 4: if you don't want to have the .line files, you don't specify them.  
        // So, ignore=true will create the .line files, one per sheet: 2 extra files = 4 files.
        // 
		expectFiles(directory, 4);   
	}

	public void testInputOKIgnoreErrorsTrue() throws Exception {
		directory = "test/useCases/replay/excelInputReplayGoodIgnoreTrue/";
		expectFiles(directory, 2);
		meta = new TransMeta(directory + "transform.ktr");
		trans = new Trans(log, meta);
		boolean ok = trans.execute(null);
		assertTrue(ok);
		trans.waitUntilFinished();
		trans.endProcessing("end"); //$NON-NLS-1$
		assertEquals(0, trans.getErrors());
		expectFiles(directory, 2);
{'fraction_non_alphanumeric': 0.12078745412078745, 'fraction_numerical': 0.008008008008008008, 'mean_word_length': 5.020080321285141, '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': '1895188', 'n_tokens_mistral': 1020, 'n_tokens_neox': 941, 'n_words': 214}