All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.aliasi.test.unit.io.LogLevelTest Maven / Gradle / Ivy

Go to download

This is the original Lingpipe: http://alias-i.com/lingpipe/web/download.html There were not made any changes to the source code.

There is a newer version: 4.1.2-JL1.0
Show newest version
package com.aliasi.test.unit.io;

import com.aliasi.io.LogLevel;

import org.junit.Test;
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertTrue;
import static junit.framework.Assert.assertFalse;


public class LogLevelTest {

    @Test
    public void testToString() {
        assertEquals("WARN",LogLevel.WARN.toString());
    }

    @Test
    public void testComparator() {
        LogLevel[] levels
            = new LogLevel[] { LogLevel.ALL, 
                               LogLevel.DEBUG,
                               LogLevel.INFO,
                               LogLevel.WARN,
                               LogLevel.ERROR,
                               LogLevel.FATAL,
                               LogLevel.NONE };
        for (int i = 0; i < levels.length; ++i) {
            assertEquals(0,LogLevel.COMPARATOR.compare(levels[i],levels[i]));
            for (int j = i+1; j < levels.length; ++j) {
                assertEquals(-1,LogLevel.COMPARATOR.compare(levels[i],levels[j]));
                assertEquals(1,LogLevel.COMPARATOR.compare(levels[j],levels[i]));
            }
        }
    }
        
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy