INT-3759: Ability to Disable Logging on Main Path

JIRA: https://jira.spring.io/browse/INT-3759

Add `IntegrationManagementConfigurer` to globally set the default.

This will be documented/expanded when JIRAs 3755/3756 are implemented.

Polishing; PR Comments

Test Polishing
This commit is contained in:
Gary Russell
2015-07-02 09:45:41 -04:00
committed by Artem Bilan
parent a480354210
commit 9cc0652b61
16 changed files with 271 additions and 27 deletions

View File

@@ -15,12 +15,16 @@
*/
package org.springframework.integration.jmx;
import static org.hamcrest.Matchers.contains;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.junit.Test;
@@ -105,11 +109,18 @@ public class MBeanAttributeFilterTests {
Map<String, Object> bean = (Map<String, Object>) payload
.get(domain + ":name=in,type=MessageChannel");
assertEquals(8, bean.size());
assertFalse(bean.containsKey("SendCount"));
assertFalse(bean.containsKey("SendErrorCount"));
assertFalse(bean.containsKey("SendCountLong"));
assertFalse(bean.containsKey("SendErrorCountLong"));
List<String> keys = new ArrayList<String>(bean.keySet());
Collections.sort(keys);
System.out.println(keys);
assertThat(keys, contains("LoggingEnabled",
"MaxSendDuration",
"MeanErrorRate",
"MeanErrorRatio",
"MeanSendDuration",
"MeanSendRate",
"MinSendDuration",
"StandardDeviationSendDuration",
"TimeSinceLastSend"));
adapterNot.stop();
}