<commit_before>/*
 * Copyright (c) 2013, <NAME>
 * All rights reserved.
 *
 * This software is distributable under the BSD license.
 * See the terms of the BSD license in the documentation provided with this software.
 */

package org.aeonbits.owner;

import org.junit.Test;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.lang.reflect.Array;
import java.util.Arrays;
import java.util.Properties;

import static org.aeonbits.owner.Util.ignore;
import static org.aeonbits.owner.Util.unreachable;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

/**
 * This class contains tests for the {@link Util} class as well utility methods used for test classes.
 *
 * @author <NAME>
 */
public class UtilTest {
    @Test(expected = UnsupportedOperationException.class)
    public void testConstructor() {
        new Util(){};
    }

    @Test
    public void testReverse() {
        Integer[] i = { 1, 2, 3, 4, 5};
        Integer[] result = Util.reverse(i);
        assertTrue(Arrays.equals(new Integer[]{1, 2, 3, 4, 5}, i));
        assertTrue(Arrays.equals(new Integer[]{5, 4, 3, 2, 1}, result));
    }

    @Test
    public void testIgnore() {
        ignore();
    }

    @Test
    public void testUnreachable() {
        try {
            unreachable();
        } catch(AssertionError err) {
            assertEquals("this code should never be reached", err.getMessage());
        }
    }

    public static void save(File target, Properties p) throws IOException {
        target.getParentFile().mkdirs();
        p.store(new FileWriter(target), "saved for test");
    }
<commit_msg>minor refactoring; for some strange reason this test keeps failing on jenkins<commit_after>/*
 * Copyright (c) 2013, <NAME>
 * All rights reserved.
 *
 * This software is distributable under the BSD license.
 * See the terms of the BSD license in the documentation provided with this software.
 */

package org.aeonbits.owner;

import org.junit.Test;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.lang.reflect.Array;
import java.util.Arrays;
import java.util.Properties;

import static org.aeonbits.owner.Util.ignore;
import static org.aeonbits.owner.Util.unreachable;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;

/**
 * This class contains tests for the {@link Util} class as well utility methods used for test classes.
 *
 * @author <NAME>
 */
public class UtilTest {
    @Test(expected = UnsupportedOperationException.class)
    public void testConstructor() {
        new Util(){};
    }

    @Test
    public void testReverse() {
        Integer[] i = { 1, 2, 3, 4, 5};
        Integer[] result = Util.reverse(i);
        assertTrue(Arrays.equals(new Integer[]{1, 2, 3, 4, 5}, i));
        assertTrue(Arrays.equals(new Integer[]{5, 4, 3, 2, 1}, result));
    }

    @Test
    public void testIgnore() {
        Object result = ignore();
        assertNull(result);
    }

    @Test
    public void testUnreachable() {
        try {
            unreachable();
        } catch(AssertionError err) {
            assertEquals("this code should never be reached", err.getMessage());
        }
    }

    public static void save(File target, Properties p) throws IOException {
        target.getParentFile().mkdirs();
        p.store(new FileWriter(target), "saved for test");
    }

{'fraction_non_alphanumeric': 0.11603800748632306, 'fraction_numerical': 0.010941549093003168, 'mean_word_length': 3.0489510489510487, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '7479026', 'n_tokens_mistral': 1032, 'n_tokens_neox': 998, 'n_words': 317}