<commit_before>/*******************************************************************************
 *                                                                              
 *  Copyright FUJITSU LIMITED 2016                                              
 *                                                                                                                                 
 *  Creation Date: 2015年4月30日                                                      
 *                                                                              
 *******************************************************************************/

package org.oscm.headers;

import static org.junit.Assert.assertEquals;

import java.io.File;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import org.junit.After;
import org.junit.Test;

/**
 * @author lixiangjun
 * 
 */
public class HeadersTest {

    public static boolean failed = false;
    public static ArrayList<String> failedFilesCollection = new ArrayList<String>();
    public static final List<String> EXCLUDE_PATHS = Arrays.asList(
            "oscm-integrationtests-setup" + java.io.File.separator
                    + "resources" + java.io.File.separator + "work",
            "oscm-integrationtests-setup" + java.io.File.separator
                    + "resources" + java.io.File.separator + "workapp",
            "oscm-portal-webtests" + java.io.File.separator + "results",
            "oscm-build" + java.io.File.separator + "result",
            java.io.File.separator + "bin");

    @Test
    public void testIsContainCopyrightHeader() {

        ArrayList<String> projectCollection = new ArrayList<String>();
        File dir = new File(System.getProperty("user.dir") + "/..");
        File[] files = dir.listFiles();
        for (int i = 0; i < files.length; i++) {
            if (files[i].isDirectory()
                    && files[i].getName().startsWith("oscm-")) {
                projectCollection.add(files[i].getAbsolutePath());
            }
        }

        for (int i = 0; i < projectCollection.size(); i++) {
            checkFiles(projectCollection.get(i));
        }
        assertEquals("", Boolean.FALSE, Boolean.valueOf(failed));
    }

    private static boolean containExcludePath(String filePath) {
        for (String excludePath : EXCLUDE_PATHS) {
            if (filePath.endsWith(excludePath)) {
                return true;
            }
        }
        return false;
    }

    @After
    public void after() {<commit_msg>Coorect the copyright header test and the wrong headers - Suzana<commit_after>/*******************************************************************************
 *                                                                              
 *  Copyright FUJITSU LIMITED 2016                                              
 *                                                                                                                                 
 *  Creation Date: 2015年4月30日                                                      
 *                                                                              
 *******************************************************************************/

package org.oscm.headers;

import static org.junit.Assert.assertEquals;

import java.io.File;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import org.junit.After;
import org.junit.Test;

/**
 * @author lixiangjun
 * 
 */
public class HeadersTest {

    public static boolean failed = false;
    public static ArrayList<String> failedFilesCollection = new ArrayList<String>();
    public static final List<String> EXCLUDE_PATHS = Arrays.asList(
            "oscm-integrationtests-setup" + java.io.File.separator
                    + "resources" + java.io.File.separator + "work",
            "oscm-integrationtests-setup" + java.io.File.separator
                    + "resources" + java.io.File.separator + "workapp",
            "oscm-portal-webtests" + java.io.File.separator + "results",
            "oscm-build" + java.io.File.separator + "result",
            java.io.File.separator + "bin");

    @Test
    public void testIsContainCopyrightHeader() {

        ArrayList<String> projectCollection = new ArrayList<String>();
        File dir = new File(System.getProperty("user.dir") + "/..");
        File[] files = dir.listFiles();
        for (int i = 0; i < files.length; i++) {
            if (files[i].isDirectory()
                    && (files[i].getName().startsWith("oscm-") || files[i]
                            .getName().startsWith("ess-oscm-"))) {
                projectCollection.add(files[i].getAbsolutePath());
            }
        }

        for (int i = 0; i < projectCollection.size(); i++) {
            checkFiles(projectCollection.get(i));
        }
        assertEquals("", Boolean.FALSE, Boolean.valueOf(failed));
    }

    private static boolean containExcludePath(String filePath) {
        for (String excludePath : EXCLUDE_PATHS) {
            if (filePath.endsWith(excludePath)) {
                return true;
            }
        }
        return false;
    }

    @After
    public void after() {
{'fraction_non_alphanumeric': 0.16161048689138577, 'fraction_numerical': 0.0048689138576779025, 'mean_word_length': 1.6168544830965212, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 30, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2403400', 'n_tokens_mistral': 1310, 'n_tokens_neox': 1218, 'n_words': 261}