Methods Summary |
---|
public void | testALL()Tests Level.ALL.
assertTrue(Level.ALL instanceof Level);
|
public void | testCustomLevelSerialization()Tests that a custom level can be serialized and deserialized
and is not resolved to a stock level.
CustomLevel custom = new CustomLevel();
Object obj = SerializationTestHelper.serializeClone(custom);
assertTrue(obj instanceof CustomLevel);
CustomLevel clone = (CustomLevel) obj;
assertEquals(Level.INFO.level, clone.level);
assertEquals(Level.INFO.levelStr, clone.levelStr);
assertEquals(Level.INFO.syslogEquivalent, clone.syslogEquivalent);
|
public void | testDEBUG()Tests Level.DEBUG.
assertTrue(Level.DEBUG instanceof Level);
|
public void | testDeserializeINFO()Deserialize witness and see if resolved to Level.INFO.
Object obj =
SerializationTestHelper.deserializeStream(
"witness/serialization/info.bin");
assertTrue(obj instanceof Level);
Level info = (Level) obj;
assertEquals("INFO", info.toString());
//
// JDK 1.1 doesn't support readResolve necessary for the assertion
if (!System.getProperty("java.version").startsWith("1.1.")) {
assertTrue(obj == Level.INFO);
}
|
public void | testDotlessLowerI()Test that dotless lower I + "nfo" is recognized as INFO.
Level level = Level.toLevel("\u0131nfo");
assertEquals("INFO", level.toString());
|
public void | testDottedLowerI()Test that dotted lower I + "nfo" is recognized as INFO
even in Turkish locale.
Locale defaultLocale = Locale.getDefault();
Locale turkey = new Locale("tr", "TR");
Locale.setDefault(turkey);
Level level = Level.toLevel("info");
Locale.setDefault(defaultLocale);
assertEquals("INFO", level.toString());
|
public void | testERROR()Tests Level.ERROR.
assertTrue(Level.ERROR instanceof Level);
|
public void | testFATAL()Tests Level.FATAL.
assertTrue(Level.FATAL instanceof Level);
|
public void | testINFO()Tests Level.INFO.
assertTrue(Level.INFO instanceof Level);
|
public void | testIntToAll()Tests Level.toLevel(Level.All_INT).
Level level = Level.toLevel(Level.ALL_INT);
assertEquals("ALL", level.toString());
|
public void | testIntToFatal()Tests Level.toLevel(Level.FATAL_INT).
Level level = Level.toLevel(Level.FATAL_INT);
assertEquals("FATAL", level.toString());
|
public void | testIntToOff()Tests Level.toLevel(Level.OFF_INT).
Level level = Level.toLevel(Level.OFF_INT);
assertEquals("OFF", level.toString());
|
public void | testIntToTrace()Tests Level.toLevel(Level.TRACE_INT).
Level trace = Level.toLevel(5000);
assertEquals("TRACE", trace.toString());
|
public void | testLevelExtendsPriority()Tests that Level extends Priority.
assertTrue(Priority.class.isAssignableFrom(Level.class));
|
public void | testOFF()Tests Level.OFF.
assertTrue(Level.OFF instanceof Level);
|
public void | testSerialVersionUID()Tests Level.serialVersionUID.
assertEquals(3491141966387921974L, Level.serialVersionUID);
|
public void | testSerializeINFO()Serialize Level.INFO and check against witness.
int[] skip = new int[] { };
SerializationTestHelper.assertSerializationEquals(
"witness/serialization/info.bin", Level.INFO, skip, Integer.MAX_VALUE);
|
public void | testStringToTrace()Tests Level.toLevel("TRACE");
Level trace = Level.toLevel("TRACE");
assertEquals("TRACE", trace.toString());
|
public void | testTRACE()Tests Level.TRACE.
assertTrue(Level.TRACE instanceof Level);
|
public void | testToLevelNull()Tests Level.toLevel(null, Level.FATAL).
Level level = Level.toLevel(null, Level.FATAL);
assertEquals("FATAL", level.toString());
|
public void | testToLevelUnrecognizedInt()Tests Level.toLevel(17, Level.FATAL).
Level level = Level.toLevel(17, Level.FATAL);
assertEquals("FATAL", level.toString());
|
public void | testTrace()Tests Level.TRACE.
assertEquals("TRACE", Level.TRACE.toString());
assertEquals(5000, Level.TRACE.toInt());
assertEquals(7, Level.TRACE.getSyslogEquivalent());
|
public void | testTraceInt()Tests Level.TRACE_INT.
assertEquals(5000, Level.TRACE_INT);
|
public void | testWARN()Tests Level.WARN.
assertTrue(Level.WARN instanceof Level);
|