FileDocCategorySizeDatePackage
PriorityTest.javaAPI DocApache log4j 1.2.154717Sat Aug 25 00:09:34 BST 2007org.apache.log4j

PriorityTest

public class PriorityTest extends TestCase
Tests of Priority.
author
Curt Arnold
since
1.2.14

Fields Summary
Constructors Summary
public PriorityTest(String name)
Constructs new instance of test.

param
name test name.

    super(name);
  
Methods Summary
public voidtestAllInt()
Tests Priority.ALL_INT.

    assertEquals(Integer.MIN_VALUE, Priority.ALL_INT);
  
public voidtestDEBUG()
Tests Priority.DEBUG.

deprecated

    assertTrue(Priority.DEBUG instanceof Level);
  
public voidtestDebugInt()
Tests Priority.DEBUG_INT.

    assertEquals(10000, Priority.DEBUG_INT);
  
public voidtestDotlessLowerI()
Test that dotless lower I + "nfo" is recognized as INFO.

deprecated

      Priority level = Priority.toPriority("\u0131nfo");
      assertEquals("INFO", level.toString());
  
public voidtestDottedLowerI()
Test that dotted lower I + "nfo" is recognized as INFO even in Turkish locale.

deprecated

      Locale defaultLocale = Locale.getDefault();
      Locale turkey = new Locale("tr", "TR");
      Locale.setDefault(turkey);
      Priority level = Priority.toPriority("info");
      Locale.setDefault(defaultLocale);
      assertEquals("INFO", level.toString());
  
public voidtestERROR()
Tests Priority.ERROR.

deprecated

    assertTrue(Priority.ERROR instanceof Level);
  
public voidtestEqualsLevel()
Tests Priority.equals(Level.DEBUG).

deprecated

    //
    //   this behavior violates the equals contract.
    //
    assertTrue(Priority.DEBUG.equals(Level.DEBUG));
  
public voidtestEqualsNull()
Tests Priority.equals(null).

deprecated

    assertFalse(Priority.DEBUG.equals(null));
  
public voidtestErrorInt()
Tests Priority.ERROR_INT.

    assertEquals(40000, Priority.ERROR_INT);
  
public voidtestFatal()
Tests Priority.FATAL.

deprecated

    assertTrue(Priority.FATAL instanceof Level);
  
public voidtestFatalInt()
Tests Priority.FATAL_INT.

    assertEquals(50000, Priority.FATAL_INT);
  
public voidtestGetAllPossiblePriorities()
Tests getAllPossiblePriorities().

deprecated

    Priority[] priorities = Priority.getAllPossiblePriorities();
    assertEquals(5, priorities.length);
  
public voidtestINFO()
Tests Priority.INFO.

deprecated

    assertTrue(Priority.INFO instanceof Level);
  
public voidtestInfoInt()
Tests Priority.INFO_INT.

    assertEquals(20000, Priority.INFO_INT);
  
public voidtestOffInt()
Tests Priority.OFF_INT.

    assertEquals(Integer.MAX_VALUE, Priority.OFF_INT);
  
public voidtestToPriorityInt()
Tests toPriority(int).

deprecated

    assertTrue(Priority.toPriority(Priority.DEBUG_INT) == Level.DEBUG);
  
public voidtestToPriorityIntPriority()
Tests toPriority(int, Priority).

deprecated

    assertTrue(Priority.toPriority(17, Priority.DEBUG) == Priority.DEBUG);
  
public voidtestToPriorityString()
Tests toPriority(String).

deprecated

    assertTrue(Priority.toPriority("DEBUG") == Level.DEBUG);
  
public voidtestToPriorityStringPriority()
Tests toPriority(String, Priority).

deprecated

    assertTrue(Priority.toPriority("foo", Priority.DEBUG) == Priority.DEBUG);
  
public voidtestWARN()
Tests Priority.WARN.

deprecated

    assertTrue(Priority.WARN instanceof Level);
  
public voidtestWarnInt()
Tests Priority.WARN_INT.

    assertEquals(30000, Priority.WARN_INT);