<commit_before>package com.github.snowdream.android.util;

import com.github.snowdream.android.util.log.FilePathGenerator;
import com.github.snowdream.android.util.log.Log;
import com.github.snowdream.android.util.log.LogFilter;
import com.github.snowdream.android.util.log.LogFormatter;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricGradleTestRunner;
import org.robolectric.RuntimeEnvironment;
import org.robolectric.annotation.Config;

import static junit.framework.Assert.assertEquals;

/**
 * Created by snowdream on 4/8/14.
 */
@RunWith(RobolectricGradleTestRunner.class)
//@Config(constants = BuildConfig.class)
public class LogTest{
    private final static String TAG = "ANDROID_LOG";
    private final static String CUSTOM_TAG = "CUSTOM_TAG";

    @Before
    protected void setUp() throws Exception {
        Log.setEnabled(true);
        Log.setLog2ConsoleEnabled(true);
        Log.setLog2FileEnabled(true);
        Log.setGlobalTag(TAG);
        Log.clearLogFilters();

        assertEquals(Log.isLog2ConsoleEnabled(), true);
        assertEquals(Log.isLog2FileEnabled(), true);
        assertEquals(Log.getGlobalTag(), TAG);

    }

    @After
    protected void tearDown() throws Exception {
    }

    @Test
    public void testEnableOrDisableLog() {
        assertEquals(Log.isEnabled(), true);

        Log.setEnabled(false);

        assertEquals(Log.isEnabled(), false);

        Log.setEnabled(true);

        assertEquals(Log.isEnabled(), true);
    }

    @Test
    public void testEnableOrDisableLog2Console() {
        assertEquals(Log.isLog2ConsoleEnabled(), true);

        Log.setLog2ConsoleEnabled(false);

        assertEquals(Log.isLog2ConsoleEnabled(), false);

        Log.setLog2ConsoleEnabled(true);

        assertEquals(Log.isLog2ConsoleEnabled(), true);
    }

    @Test
    public void testEnableOrDisableLog2File() {
        assertEquals(Log.isLog2FileEnabled(), true);<commit_msg>Fix: java.lang.Exception: Method setUp() should be public java.lang.Exception: Method tearDown() should be public<commit_after>package com.github.snowdream.android.util;

import com.github.snowdream.android.util.log.FilePathGenerator;
import com.github.snowdream.android.util.log.Log;
import com.github.snowdream.android.util.log.LogFilter;
import com.github.snowdream.android.util.log.LogFormatter;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricGradleTestRunner;
import org.robolectric.RuntimeEnvironment;
import org.robolectric.annotation.Config;

import static junit.framework.Assert.assertEquals;

/**
 * Created by snowdream on 4/8/14.
 */
@RunWith(RobolectricGradleTestRunner.class)
//@Config(constants = BuildConfig.class)
public class LogTest{
    private final static String TAG = "ANDROID_LOG";
    private final static String CUSTOM_TAG = "CUSTOM_TAG";

    @Before
    public void setUp() throws Exception {
        Log.setEnabled(true);
        Log.setLog2ConsoleEnabled(true);
        Log.setLog2FileEnabled(true);
        Log.setGlobalTag(TAG);
        Log.clearLogFilters();

        assertEquals(Log.isLog2ConsoleEnabled(), true);
        assertEquals(Log.isLog2FileEnabled(), true);
        assertEquals(Log.getGlobalTag(), TAG);

    }

    @After
    public void tearDown() throws Exception {
    }

    @Test
    public void testEnableOrDisableLog() {
        assertEquals(Log.isEnabled(), true);

        Log.setEnabled(false);

        assertEquals(Log.isEnabled(), false);

        Log.setEnabled(true);

        assertEquals(Log.isEnabled(), true);
    }

    @Test
    public void testEnableOrDisableLog2Console() {
        assertEquals(Log.isLog2ConsoleEnabled(), true);

        Log.setLog2ConsoleEnabled(false);

        assertEquals(Log.isLog2ConsoleEnabled(), false);

        Log.setLog2ConsoleEnabled(true);

        assertEquals(Log.isLog2ConsoleEnabled(), true);
    }

    @Test
    public void testEnableOrDisableLog2File() {
        assertEquals(Log.isLog2FileEnabled(), true);
{'fraction_non_alphanumeric': 0.11032977691561591, 'fraction_numerical': 0.007759456838021339, 'mean_word_length': 3.7142857142857144, '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': '7591610', 'n_tokens_mistral': 1250, 'n_tokens_neox': 1193, 'n_words': 217}