File Cleanup - Event to JMX

This commit is contained in:
Gary Russell
2016-06-04 11:39:43 -04:00
parent e16f084628
commit 8e3622757d
55 changed files with 202 additions and 152 deletions

View File

@@ -44,14 +44,14 @@ import org.springframework.http.HttpMethod;
import org.springframework.http.client.ClientHttpRequestFactory;
import org.springframework.http.client.ClientHttpResponse;
import org.springframework.http.client.SimpleClientHttpRequestFactory;
import org.springframework.integration.endpoint.PollingConsumer;
import org.springframework.messaging.Message;
import org.springframework.messaging.MessageHandler;
import org.springframework.integration.endpoint.AbstractEndpoint;
import org.springframework.integration.endpoint.PollingConsumer;
import org.springframework.integration.handler.advice.AbstractRequestHandlerAdvice;
import org.springframework.integration.http.outbound.HttpRequestExecutingMessageHandler;
import org.springframework.messaging.support.GenericMessage;
import org.springframework.integration.test.util.TestUtils;
import org.springframework.messaging.Message;
import org.springframework.messaging.MessageHandler;
import org.springframework.messaging.support.GenericMessage;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.util.ObjectUtils;
@@ -172,7 +172,8 @@ public class HttpOutboundChannelAdapterParserTests {
@Test(expected = BeanDefinitionParsingException.class)
public void failWithRestTemplateAndRestAttributes() {
new ClassPathXmlApplicationContext("HttpOutboundChannelAdapterParserTests-fail-context.xml", this.getClass());
new ClassPathXmlApplicationContext("HttpOutboundChannelAdapterParserTests-fail-context.xml", this.getClass())
.close();
}
@Test
@@ -265,7 +266,8 @@ public class HttpOutboundChannelAdapterParserTests {
@Test(expected = BeanDefinitionParsingException.class)
public void failWithUrlAndExpression() {
new ClassPathXmlApplicationContext("HttpOutboundChannelAdapterParserTests-url-fail-context.xml", this.getClass());
new ClassPathXmlApplicationContext("HttpOutboundChannelAdapterParserTests-url-fail-context.xml",
this.getClass()).close();
}
public static class StubErrorHandler implements ResponseErrorHandler {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -30,6 +30,7 @@ import java.util.Map;
import org.hamcrest.Matchers;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.BeansException;
import org.springframework.beans.DirectFieldAccessor;
import org.springframework.beans.factory.annotation.Autowired;
@@ -43,14 +44,14 @@ import org.springframework.http.HttpMethod;
import org.springframework.http.client.ClientHttpRequestFactory;
import org.springframework.http.client.ClientHttpResponse;
import org.springframework.http.client.SimpleClientHttpRequestFactory;
import org.springframework.integration.endpoint.PollingConsumer;
import org.springframework.messaging.Message;
import org.springframework.messaging.MessageChannel;
import org.springframework.integration.endpoint.AbstractEndpoint;
import org.springframework.integration.endpoint.PollingConsumer;
import org.springframework.integration.handler.advice.AbstractRequestHandlerAdvice;
import org.springframework.integration.http.outbound.HttpRequestExecutingMessageHandler;
import org.springframework.messaging.support.GenericMessage;
import org.springframework.integration.test.util.TestUtils;
import org.springframework.messaging.Message;
import org.springframework.messaging.MessageChannel;
import org.springframework.messaging.support.GenericMessage;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.util.ObjectUtils;
@@ -199,7 +200,8 @@ public class HttpOutboundGatewayParserTests {
@Test
public void testInt2718FailForGatewayRequestChannelAttribute() {
try {
new ClassPathXmlApplicationContext("HttpOutboundGatewayWithinChainTests-fail-context.xml", this.getClass());
new ClassPathXmlApplicationContext("HttpOutboundGatewayWithinChainTests-fail-context.xml", this.getClass())
.close();
fail("Expected BeanDefinitionParsingException");
}
catch (BeansException e) {
@@ -217,10 +219,12 @@ public class HttpOutboundGatewayParserTests {
public static class StubErrorHandler implements ResponseErrorHandler {
@Override
public boolean hasError(ClientHttpResponse response) throws IOException {
return false;
}
@Override
public void handleError(ClientHttpResponse response) throws IOException {
}
}

View File

@@ -204,7 +204,7 @@ public class OutboundResponseTypeTests {
@Test
public void testMutuallyExclusivityInMethodAndMethodExpression() throws Exception {
try {
new ClassPathXmlApplicationContext("OutboundResponseTypeTests-context-fail.xml", this.getClass());
new ClassPathXmlApplicationContext("OutboundResponseTypeTests-context-fail.xml", this.getClass()).close();
fail("Expected BeansException");
}
catch (BeansException e) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013 the original author or authors.
* Copyright 2013-2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -56,6 +56,7 @@ import org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter;
/**
* @author Artem Bilan
* @author Gary Russell
* @since 3.0
*/
//INT-2312
@@ -131,10 +132,10 @@ public class Int2312RequestMappingIntegrationTests extends AbstractHttpInboundTe
Object matrixVariables = headers.get("matrixVariables");
assertThat(matrixVariables, Matchers.instanceOf(Map.class));
Object value = ((Map) matrixVariables).get("value");
Object value = ((Map<?, ?>) matrixVariables).get("value");
assertThat(value, Matchers.instanceOf(MultiValueMap.class));
assertEquals("1", ((MultiValueMap) value).getFirst("q1"));
assertEquals("2", ((MultiValueMap) value).getFirst("q2"));
assertEquals("1", ((MultiValueMap<String, ?>) value).getFirst("q1"));
assertEquals("2", ((MultiValueMap<String, ?>) value).getFirst("q2"));
Object requestHeaders = headers.get("requestHeaders");
assertNotNull(requestParams);