<commit_before><commit_msg>Unit test for beast.core.Logger #563<commit_after>package test.beast.core;

import beast.core.Logger;
import beast.core.parameter.RealParameter;
import org.junit.*;

import static org.junit.Assert.*;

/**
 * junit 4
 * http://www.asjava.com/junit/junit-3-vs-junit-4-comparison/
 * http://stackoverflow.com/questions/2469911/how-do-i-assert-my-exception-message-with-junit-test-annotation
 *
 * @author <NAME>
 */
public class LoggerTest {
    Logger logger;

    @Before
    public void setUp() throws Exception {
        logger = new Logger();
    }

    @After
    public void tearDown() throws Exception {

    }

    @Test
    public void initAndValidate() throws Exception {

    }

    @Test
    public void isLoggingToStdout() throws Exception {
        logger = new Logger();
        logger.initByName("fileName", null, "log", new RealParameter());
        assertTrue("fileName == null", logger.isLoggingToStdout());

        logger = new Logger();
        logger.initByName("fileName", "", "log", new RealParameter());
        assertTrue("fileName.length() == 0", logger.isLoggingToStdout());

        logger = new Logger();
        logger.initByName("fileName", "beast.log", "log", new RealParameter());
        assertFalse("fileName = \"beast.log\"", logger.isLoggingToStdout());
    }

    @Test
    public void init() throws Exception {

    }

    @Test
    public void openLogFile() throws Exception {

    }

    @Test
    public void log() throws Exception {
        logger.log(-1);
//        assertEquals("", , );

    }

    @Test
    public void close() throws Exception {

    }

    @Test
    public void getSampleOffset() throws Exception {

    }

}
{'fraction_non_alphanumeric': 0.13705882352941176, 'fraction_numerical': 0.008823529411764706, 'mean_word_length': 2.7884187082405347, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 1, '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': '5307064', 'n_tokens_mistral': 509, 'n_tokens_neox': 492, 'n_words': 117}