@Override public void removeMdc(String key) { ThreadContext.remove(key); }
@Override public void remove(final String key) { ThreadContext.remove(key); }
@Override protected void remove(String key) { ThreadContext.remove(key); }
private void closeMap() { for (final Iterator<Map.Entry<String, String>> it = originalValues.entrySet().iterator(); it.hasNext(); ) { final Map.Entry<String, String> entry = it.next(); final String key = entry.getKey(); final String originalValue = entry.getValue(); if (null == originalValue) { ThreadContext.remove(key); } else { ThreadContext.put(key, originalValue); } it.remove(); } }
private void prepareThreadContext(boolean isThreadContextMapInheritable) { System.setProperty("log4j2.isThreadContextMapInheritable", Boolean.toString(isThreadContextMapInheritable)); PropertiesUtil.getProperties().reload(); ThreadContextTest.reinitThreadContext(); ThreadContext.remove("baz"); ThreadContext.put("foo", "bar"); }
ThreadContext.put("count", String.valueOf(i)); } else { ThreadContext.remove("count");
ThreadContext.remove("loginId");
ThreadContext.remove("loginId");
@Test public void testContainsKey() { ThreadContext.clearMap(); assertFalse(ThreadContext.containsKey("testKey")); ThreadContext.put("testKey", "testValue"); assertTrue(ThreadContext.containsKey("testKey")); ThreadContext.remove("testKey"); assertFalse(ThreadContext.containsKey("testKey")); }
@Test public void testContainsKey() { ThreadContext.clearMap(); assertFalse(ThreadContext.containsKey("testKey")); ThreadContext.put("testKey", "testValue"); assertTrue(ThreadContext.containsKey("testKey")); ThreadContext.remove("testKey"); assertFalse(ThreadContext.containsKey("testKey")); }
@Test public void testRemove() { ThreadContext.clearMap(); assertNull(ThreadContext.get("testKey")); ThreadContext.put("testKey", "testValue"); assertEquals("testValue", ThreadContext.get("testKey")); ThreadContext.remove("testKey"); assertNull(ThreadContext.get("testKey")); assertTrue(ThreadContext.isEmpty()); }
@Test public void testRemove() { ThreadContext.clearMap(); assertNull(ThreadContext.get("testKey")); ThreadContext.put("testKey", "testValue"); assertEquals("testValue", ThreadContext.get("testKey")); ThreadContext.remove("testKey"); assertNull(ThreadContext.get("testKey")); assertTrue(ThreadContext.isEmpty()); }
logger.debug("This is another test message"); } finally { ThreadContext.remove(tcKey); ThreadContext.pop();
assertTrue(filter.isStarted()); assertSame(Filter.Result.DENY, filter.filter(null, Level.DEBUG, null, (Object) null, (Throwable) null)); ThreadContext.remove("userid"); assertSame(Filter.Result.DENY, filter.filter(null, Level.DEBUG, null, (Object) null, (Throwable) null)); ThreadContext.put("userid", "JohnDoe"); ThreadContext.put("organization", "ASF"); assertSame(Filter.Result.DENY, filter.filter(null, Level.DEBUG, null, (Object) null, (Throwable) null)); ThreadContext.remove("organization"); assertSame(Filter.Result.DENY, filter.filter(null, Level.DEBUG, null, (Object) null, (Throwable) null)); final KeyValuePair[] single = new KeyValuePair[] {new KeyValuePair("userid", "testuser")};