001package org.slf4j.log4j12; 002 003import static org.junit.Assert.assertFalse; 004import static org.junit.Assert.assertTrue; 005 006import org.junit.Test; 007import org.slf4j.helpers.MDCAdapterTestBase; 008import org.slf4j.spi.MDCAdapter; 009 010public class Log4jMDCAdapterTest extends MDCAdapterTestBase { 011 012 protected MDCAdapter instantiateMDC() { 013 return new Log4jMDCAdapter(); 014 } 015 016 017 @Test 018 public void testClearingMDC() { 019 mdc.put("testKey", "testValue"); 020 assertFalse(mdc.getCopyOfContextMap().isEmpty()); 021 mdc.clear(); 022 assertTrue(mdc.getCopyOfContextMap().isEmpty()); 023 } 024 025 026 027}