Clean up & suppress warnings in spring-messaging

This commit is contained in:
Sam Brannen
2015-03-17 17:58:17 +01:00
parent 03739c25d3
commit 9930a8715f
9 changed files with 14 additions and 22 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2014 the original author or authors.
* Copyright 2002-2015 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.
@@ -18,8 +18,7 @@ package org.springframework.web.socket;
import java.io.File;
import java.io.IOException;
import java.util.EnumSet;
import javax.servlet.DispatcherType;
import javax.servlet.Filter;
import org.apache.catalina.Context;
@@ -105,10 +104,6 @@ public class TomcatWebSocketTestServer implements WebSocketTestServer {
}
}
private EnumSet<DispatcherType> getDispatcherTypes() {
return EnumSet.of(DispatcherType.REQUEST, DispatcherType.FORWARD, DispatcherType.INCLUDE, DispatcherType.ASYNC);
}
@Override
public void undeployConfig() {
if (this.context != null) {

View File

@@ -29,7 +29,6 @@ import java.util.concurrent.TimeUnit;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@@ -114,6 +113,7 @@ public class WebSocketIntegrationTests extends AbstractWebSocketIntegrationTest
}
@SuppressWarnings("rawtypes")
private static class TestWebSocketHandler extends AbstractWebSocketHandler {
private List<WebSocketMessage> receivedMessages = new ArrayList<>();

View File

@@ -23,7 +23,6 @@ import java.util.List;
import org.hamcrest.Matchers;
import org.junit.Before;
import org.junit.Test;
import org.springframework.beans.DirectFieldAccessor;
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
import org.springframework.beans.factory.config.CustomScopeConfigurer;
@@ -98,6 +97,7 @@ public class MessageBrokerBeanDefinitionParserTests {
@Test
@SuppressWarnings("unchecked")
public void simpleBroker() throws Exception {
loadBeanDefinitions("websocket-config-broker-simple.xml");

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2014 the original author or authors.
* Copyright 2002-2015 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.
@@ -36,9 +36,9 @@ import static org.junit.Assert.*;
*
* @author Rossen Stoyanchev
*/
@SuppressWarnings("resource")
public class ConcurrentWebSocketSessionDecoratorTests {
@Test
public void send() throws IOException {
@@ -218,11 +218,6 @@ public class ConcurrentWebSocketSessionDecoratorTests {
}
}
public void release() {
if (this.releaseLatch.get() != null) {
this.releaseLatch.get().countDown();
}
}
}
// @Test

View File

@@ -23,7 +23,6 @@ import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.springframework.beans.DirectFieldAccessor;
import org.springframework.messaging.MessageChannel;
import org.springframework.messaging.SubscribableChannel;
@@ -145,6 +144,7 @@ public class SubProtocolWebSocketHandlerTests {
}
@Test
@SuppressWarnings("unchecked")
public void checkSession() throws Exception {
TestWebSocketSession session1 = new TestWebSocketSession("id1");
TestWebSocketSession session2 = new TestWebSocketSession("id2");

View File

@@ -21,7 +21,6 @@ import java.util.Arrays;
import java.util.List;
import org.mockito.ArgumentCaptor;
import org.springframework.util.concurrent.ListenableFuture;
import org.springframework.util.concurrent.ListenableFutureCallback;
import org.springframework.web.socket.TextMessage;
@@ -36,6 +35,7 @@ import static org.mockito.Mockito.*;
*
* @author Rossen Stoyanchev
*/
@SuppressWarnings("rawtypes")
class TestTransport implements Transport {
private final String name;

View File

@@ -18,13 +18,14 @@ package org.springframework.web.socket.sockjs.support;
import java.io.IOException;
import java.util.Arrays;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import static org.junit.Assert.assertEquals;
import org.junit.Before;
import org.junit.Test;
import org.springframework.http.HttpStatus;
import org.springframework.http.server.ServerHttpRequest;
import org.springframework.http.server.ServerHttpResponse;
@@ -156,6 +157,7 @@ public class SockJsServiceTests extends AbstractHttpRequestTests {
}
@Test // SPR-11919
@SuppressWarnings("unchecked")
public void handleInfoGetWildflyNPE() throws Exception {
HttpServletResponse mockResponse = mock(HttpServletResponse.class);
ServletOutputStream ous = mock(ServletOutputStream.class);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2013 the original author or authors.
* Copyright 2002-2015 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.
@@ -82,6 +82,7 @@ public class WebSocketServerSockJsSessionTests extends AbstractSockJsSessionTest
}
@Test
@SuppressWarnings("resource")
public void afterSessionInitializedOpenFrameFirst() throws Exception {
TextWebSocketHandler handler = new TextWebSocketHandler() {
@Override