<commit_before>/*
 * SportChef – Sports Competition Management Software
 * Copyright (C) 2016 <NAME>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package ch.sportchef.business;

import org.junit.Test;

import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.net.URISyntaxException;

import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;

public class ImageResizerTest {

    private static final String[] IMAGE_NAMES = {
            "test-350x200.png", //NON-NLS
            "test-350x550.png", //NON-NLS
            "test-525x300.png", //NON-NLS
            "test-550x200.png" }; //NON-NLS

    private static final int IMAGE_WIDTH = 350;
    private static final int IMAGE_HEIGHT = 200;

    @Test
    public void testResizeAndCrop() throws IOException, URISyntaxException {
        for (int i = 0; i < IMAGE_NAMES.length; i++) {
            // arrange
            final File file = new File(Thread.currentThread()
                    .getContextClassLoader().getResource(IMAGE_NAMES[i]).toURI());
            final BufferedImage inputImage = ImageIO.read(file);

            // act
            final BufferedImage outputImage = ImageResizer.resizeAndCrop(inputImage, IMAGE_WIDTH, IMAGE_HEIGHT);<commit_msg>#114 Make method final<commit_after>/*
 * SportChef – Sports Competition Management Software
 * Copyright (C) 2016 <NAME>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package ch.sportchef.business;

import org.junit.Test;

import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.net.URISyntaxException;

import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;

public class ImageResizerTest {

    private static final String[] IMAGE_NAMES = {
            "test-350x200.png", //NON-NLS
            "test-350x550.png", //NON-NLS
            "test-525x300.png", //NON-NLS
            "test-550x200.png" }; //NON-NLS

    private static final int IMAGE_WIDTH = 350;
    private static final int IMAGE_HEIGHT = 200;

    @Test
    public final void testResizeAndCrop() throws IOException, URISyntaxException {
        for (int i = 0; i < IMAGE_NAMES.length; i++) {
            // arrange
            final File file = new File(Thread.currentThread()
                    .getContextClassLoader().getResource(IMAGE_NAMES[i]).toURI());
            final BufferedImage inputImage = ImageIO.read(file);

            // act
            final BufferedImage outputImage = ImageResizer.resizeAndCrop(inputImage, IMAGE_WIDTH, IMAGE_HEIGHT);
{'fraction_non_alphanumeric': 0.08747768426421831, 'fraction_numerical': 0.019127773527161437, 'mean_word_length': 3.1414994720168954, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '6984628', 'n_tokens_mistral': 1160, 'n_tokens_neox': 1089, 'n_words': 389}