<commit_before>package com.alexrnl.subtitlecorrector;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.when;

import java.io.IOException;
import java.net.URISyntaxException;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Locale;
import java.util.Map;

import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
import org.mockito.Spy;

import com.alexrnl.subtitlecorrector.correctionstrategy.Strategy;
import com.alexrnl.subtitlecorrector.io.SubtitleFormatManager;
import com.alexrnl.subtitlecorrector.io.subrip.SubRip;
import com.alexrnl.subtitlecorrector.service.DictionaryManager;
import com.alexrnl.subtitlecorrector.service.UserPrompt;

/**
 * Test suite for the {@link AbstractApp} class.
 * @author Alex
 */
public class AbstractAppTest {
	/** The abstract application to test */
	@Spy
	private AbstractApp app;
	/** The (mocked) user prompt */
	@Mock
	private UserPrompt userPrompt;
	
	/**
	 * Set up test attributes.
	 * @throws URISyntaxException
	 *         if there is an issue when building the abstract app.
	 * @throws IOException
	 *         if there is an I/O issue.
	 */
	@Before
	public void setUp () throws IOException, URISyntaxException {
		userPrompt = mock(UserPrompt.class);
		app = spy(new AbstractApp(userPrompt) {
			@Override
			public boolean launch () {
				return true;
			}
		});
	}
	
	/**
	 * Test method for {@link AbstractApp#getTranslator()}.
	 */
	@Test
	public void testGetTranslator () {
		assertNotNull(app.getTranslator());
	}
	
	/**
	 * Test method for {@link AbstractApp#getSessionManager()}.<commit_msg>Uses initMocks instead of maunal instanciation<commit_after>package com.alexrnl.subtitlecorrector;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.when;
import static org.mockito.MockitoAnnotations.initMocks;

import java.io.IOException;
import java.net.URISyntaxException;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Locale;
import java.util.Map;

import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;

import com.alexrnl.subtitlecorrector.correctionstrategy.Strategy;
import com.alexrnl.subtitlecorrector.io.SubtitleFormatManager;
import com.alexrnl.subtitlecorrector.io.subrip.SubRip;
import com.alexrnl.subtitlecorrector.service.DictionaryManager;
import com.alexrnl.subtitlecorrector.service.UserPrompt;

/**
 * Test suite for the {@link AbstractApp} class.
 * @author Alex
 */
public class AbstractAppTest {
	/** The abstract application to test */
	private AbstractApp app;
	/** The (mocked) user prompt */
	@Mock
	private UserPrompt userPrompt;
	
	/**
	 * Set up test attributes.
	 * @throws URISyntaxException
	 *         if there is an issue when building the abstract app.
	 * @throws IOException
	 *         if there is an I/O issue.
	 */
	@Before
	public void setUp () throws IOException, URISyntaxException {
		initMocks(this);
		app = spy(new AbstractApp(userPrompt) {
			@Override
			public boolean launch () {
				return true;
			}
		});
	}
	
	/**
	 * Test method for {@link AbstractApp#getTranslator()}.
	 */
	@Test
	public void testGetTranslator () {
		assertNotNull(app.getTranslator());
	}
	
	/**
	 * Test method for {@link AbstractApp#getSessionManager()}.
{'fraction_non_alphanumeric': 0.10526315789473684, 'fraction_numerical': 0.0, 'mean_word_length': 4.418234442836469, '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': '6960555', 'n_tokens_mistral': 1244, 'n_tokens_neox': 1177, 'n_words': 285}