INT-2267
removed test compile warnings INT-2267 removed test compile warnings(2)
This commit is contained in:
@@ -55,22 +55,22 @@ public class StoredProcOutboundGatewayWithNamespaceIntegrationTests {
|
||||
@Autowired
|
||||
CreateUser createUser;
|
||||
|
||||
@Test
|
||||
@Test
|
||||
public void test() throws Exception {
|
||||
|
||||
createUser.createUser(new User("myUsername", "myPassword", "myEmail"));
|
||||
|
||||
List<Message<?>> received = new ArrayList<Message<?>>();
|
||||
List<Message<Collection<User>>> received = new ArrayList<Message<Collection<User>>>();
|
||||
|
||||
received.add(consumer.poll(2000));
|
||||
|
||||
Message<?> message = received.get(0);
|
||||
Message<Collection<User>> message = received.get(0);
|
||||
context.stop();
|
||||
assertNotNull(message);
|
||||
assertNotNull(message.getPayload());
|
||||
assertNotNull(message.getPayload() instanceof Collection<?>);
|
||||
|
||||
Collection<User> allUsers = (Collection<User>) message.getPayload();
|
||||
Collection<User> allUsers = message.getPayload();
|
||||
|
||||
assertTrue(allUsers.size() == 1);
|
||||
|
||||
@@ -98,14 +98,14 @@ public class StoredProcOutboundGatewayWithNamespaceIntegrationTests {
|
||||
|
||||
static class Consumer {
|
||||
|
||||
private final BlockingQueue<Message<?>> messages = new LinkedBlockingQueue<Message<?>>();
|
||||
private final BlockingQueue<Message<Collection<User>>> messages = new LinkedBlockingQueue<Message<Collection<User>>>();
|
||||
|
||||
@ServiceActivator
|
||||
public void receive(Message<?>message) {
|
||||
public void receive(Message<Collection<User>> message) {
|
||||
messages.add(message);
|
||||
}
|
||||
|
||||
Message<?> poll(long timeoutInMillis) throws InterruptedException {
|
||||
Message<Collection<User>> poll(long timeoutInMillis) throws InterruptedException {
|
||||
return messages.poll(timeoutInMillis, TimeUnit.MILLISECONDS);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,9 +16,6 @@
|
||||
|
||||
package org.springframework.integration.jdbc;
|
||||
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
@@ -27,11 +24,9 @@ import java.util.concurrent.LinkedBlockingQueue;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.support.AbstractApplicationContext;
|
||||
import org.springframework.integration.Message;
|
||||
@@ -41,6 +36,9 @@ import org.springframework.integration.jdbc.storedproc.User;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
/**
|
||||
* @author Gunnar Hillert
|
||||
*/
|
||||
@@ -48,11 +46,6 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
public class StoredProcOutboundGatewayWithSpringContextIntegrationTests {
|
||||
|
||||
private static Logger logger = Logger.getLogger(StoredProcOutboundGatewayWithSpringContextIntegrationTests.class);
|
||||
|
||||
@Autowired
|
||||
private DataSource datasource;
|
||||
|
||||
@Autowired
|
||||
private AbstractApplicationContext context;
|
||||
|
||||
@@ -62,22 +55,22 @@ public class StoredProcOutboundGatewayWithSpringContextIntegrationTests {
|
||||
@Autowired
|
||||
CreateUser createUser;
|
||||
|
||||
@Test
|
||||
@Test
|
||||
public void test() throws Exception {
|
||||
|
||||
createUser.createUser(new User("myUsername", "myPassword", "myEmail"));
|
||||
|
||||
List<Message<?>> received = new ArrayList<Message<?>>();
|
||||
List<Message<Collection<User>>> received = new ArrayList<Message<Collection<User>>>();
|
||||
|
||||
received.add(consumer.poll(2000));
|
||||
|
||||
Message<?> message = received.get(0);
|
||||
Message<Collection<User>> message = received.get(0);
|
||||
context.stop();
|
||||
assertNotNull(message);
|
||||
assertNotNull(message.getPayload());
|
||||
assertNotNull(message.getPayload() instanceof Collection<?>);
|
||||
|
||||
Collection<User> allUsers = (Collection<User>) message.getPayload();
|
||||
Collection<User> allUsers = message.getPayload();
|
||||
|
||||
assertTrue(allUsers.size() == 1);
|
||||
|
||||
@@ -99,14 +92,14 @@ public class StoredProcOutboundGatewayWithSpringContextIntegrationTests {
|
||||
|
||||
static class Consumer {
|
||||
|
||||
private final BlockingQueue<Message<?>> messages = new LinkedBlockingQueue<Message<?>>();
|
||||
private final BlockingQueue<Message<Collection<User>>> messages = new LinkedBlockingQueue<Message<Collection<User>>>();
|
||||
|
||||
@ServiceActivator
|
||||
public void receive(Message<?>message) {
|
||||
public void receive(Message<Collection<User>> message) {
|
||||
messages.add(message);
|
||||
}
|
||||
|
||||
Message<?> poll(long timeoutInMillis) throws InterruptedException {
|
||||
Message<Collection<User>> poll(long timeoutInMillis) throws InterruptedException {
|
||||
return messages.poll(timeoutInMillis, TimeUnit.MILLISECONDS);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,9 +16,6 @@
|
||||
|
||||
package org.springframework.integration.jdbc;
|
||||
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.BlockingQueue;
|
||||
@@ -26,9 +23,9 @@ import java.util.concurrent.LinkedBlockingQueue;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.support.AbstractApplicationContext;
|
||||
import org.springframework.integration.Message;
|
||||
@@ -36,6 +33,9 @@ import org.springframework.integration.annotation.ServiceActivator;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
/**
|
||||
* @author Gunnar Hillert
|
||||
*/
|
||||
@@ -43,27 +43,26 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
public class StoredProcPollingChannelAdapterWithNamespace2IntegrationTests {
|
||||
|
||||
private static Logger logger = Logger.getLogger(StoredProcPollingChannelAdapterWithNamespace2IntegrationTests.class);
|
||||
|
||||
@Autowired
|
||||
private AbstractApplicationContext context;
|
||||
|
||||
@Autowired
|
||||
private Consumer consumer;
|
||||
|
||||
@Test
|
||||
|
||||
@Test
|
||||
public void pollH2DatabaseUsingStoredProcedureCall() throws Exception {
|
||||
List<Message<?>> received = new ArrayList<Message<?>>();
|
||||
List<Message<List<Integer>>> received = new ArrayList<Message<List<Integer>>>();
|
||||
|
||||
received.add(consumer.poll(60000));
|
||||
|
||||
Message<?> message = received.get(0);
|
||||
Message<List<Integer>> message = received.get(0);
|
||||
context.stop();
|
||||
assertNotNull(message);
|
||||
assertNotNull(message.getPayload());
|
||||
assertTrue(message.getPayload() instanceof List<?>);
|
||||
|
||||
List<Integer> resultList = (List<Integer>) message.getPayload();
|
||||
List<Integer> resultList = message.getPayload();
|
||||
|
||||
assertTrue(resultList.size() == 1);
|
||||
|
||||
@@ -85,14 +84,14 @@ public class StoredProcPollingChannelAdapterWithNamespace2IntegrationTests {
|
||||
|
||||
static class Consumer {
|
||||
|
||||
private final BlockingQueue<Message<?>> messages = new LinkedBlockingQueue<Message<?>>();
|
||||
private final BlockingQueue<Message<List<Integer>>> messages = new LinkedBlockingQueue<Message<List<Integer>>>();
|
||||
|
||||
@ServiceActivator
|
||||
public void receive(Message<?>message) {
|
||||
public void receive(Message<List<Integer>>message) {
|
||||
messages.add(message);
|
||||
}
|
||||
|
||||
Message<?> poll(long timeoutInMillis) throws InterruptedException {
|
||||
Message<List<Integer>> poll(long timeoutInMillis) throws InterruptedException {
|
||||
return messages.poll(timeoutInMillis, TimeUnit.MILLISECONDS);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,9 +16,6 @@
|
||||
|
||||
package org.springframework.integration.jdbc;
|
||||
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
@@ -27,9 +24,9 @@ import java.util.concurrent.LinkedBlockingQueue;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.support.AbstractApplicationContext;
|
||||
import org.springframework.integration.Message;
|
||||
@@ -37,6 +34,9 @@ import org.springframework.integration.annotation.ServiceActivator;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
/**
|
||||
* @author Gunnar Hillert
|
||||
*/
|
||||
@@ -44,15 +44,14 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
public class StoredProcPollingChannelAdapterWithNamespaceIntegrationTests {
|
||||
|
||||
private static Logger logger = Logger.getLogger(StoredProcPollingChannelAdapterWithNamespaceIntegrationTests.class);
|
||||
|
||||
@Autowired
|
||||
private AbstractApplicationContext context;
|
||||
|
||||
@Autowired
|
||||
private Consumer consumer;
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("unchecked")
|
||||
@Test
|
||||
public void pollH2DatabaseUsingStoredProcedureCall() throws Exception {
|
||||
List<Message<?>> received = new ArrayList<Message<?>>();
|
||||
|
||||
|
||||
@@ -16,9 +16,6 @@
|
||||
|
||||
package org.springframework.integration.jdbc;
|
||||
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
@@ -27,11 +24,9 @@ import java.util.concurrent.LinkedBlockingQueue;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.support.AbstractApplicationContext;
|
||||
import org.springframework.integration.Message;
|
||||
@@ -39,6 +34,9 @@ import org.springframework.integration.annotation.ServiceActivator;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
/**
|
||||
* @author Gunnar Hillert
|
||||
*/
|
||||
@@ -46,30 +44,25 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
public class StoredProcPollingChannelAdapterWithSpringContextIntegrationTests {
|
||||
|
||||
private static Logger logger = Logger.getLogger(StoredProcPollingChannelAdapterWithSpringContextIntegrationTests.class);
|
||||
|
||||
@Autowired
|
||||
private DataSource datasource;
|
||||
|
||||
@Autowired
|
||||
private AbstractApplicationContext context;
|
||||
|
||||
@Autowired
|
||||
private Consumer consumer;
|
||||
|
||||
@Test
|
||||
@Test
|
||||
public void test() throws Exception {
|
||||
List<Message<?>> received = new ArrayList<Message<?>>();
|
||||
List<Message<Collection<Integer>>> received = new ArrayList<Message<Collection<Integer>>>();
|
||||
|
||||
received.add(consumer.poll(2000));
|
||||
|
||||
Message<?> message = received.get(0);
|
||||
Message<Collection<Integer>> message = received.get(0);
|
||||
context.stop();
|
||||
assertNotNull(message);
|
||||
assertNotNull(message.getPayload());
|
||||
assertNotNull(message.getPayload() instanceof Collection<?>);
|
||||
|
||||
Collection<Integer> primeNumbers = (Collection<Integer>) message.getPayload();
|
||||
Collection<Integer> primeNumbers = message.getPayload();
|
||||
|
||||
assertTrue(primeNumbers.size() == 4);
|
||||
|
||||
@@ -91,14 +84,14 @@ public class StoredProcPollingChannelAdapterWithSpringContextIntegrationTests {
|
||||
|
||||
static class Consumer {
|
||||
|
||||
private final BlockingQueue<Message<?>> messages = new LinkedBlockingQueue<Message<?>>();
|
||||
private final BlockingQueue<Message<Collection<Integer>>> messages = new LinkedBlockingQueue<Message<Collection<Integer>>>();
|
||||
|
||||
@ServiceActivator
|
||||
public void receive(Message<?>message) {
|
||||
public void receive(Message<Collection<Integer>>message) {
|
||||
messages.add(message);
|
||||
}
|
||||
|
||||
Message<?> poll(long timeoutInMillis) throws InterruptedException {
|
||||
Message<Collection<Integer>> poll(long timeoutInMillis) throws InterruptedException {
|
||||
return messages.poll(timeoutInMillis, TimeUnit.MILLISECONDS);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,7 +58,8 @@ public class StoredProcMessageHandlerParserTests {
|
||||
assertEquals("Resolution Required should be 'testProcedure1' but was " + testProcedure1, "testProcedure1", testProcedure1);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("unchecked")
|
||||
@Test
|
||||
public void testProcedurepParametersAreSet() throws Exception {
|
||||
setUp("basicStoredProcOutboundChannelAdapterTest.xml", getClass());
|
||||
|
||||
@@ -99,7 +100,8 @@ public class StoredProcMessageHandlerParserTests {
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("unchecked")
|
||||
@Test
|
||||
public void testSqlParametersAreSet() throws Exception {
|
||||
setUp("basicStoredProcOutboundChannelAdapterTest.xml", getClass());
|
||||
|
||||
|
||||
@@ -94,7 +94,8 @@ public class StoredProcOutboundGatewayParserTests {
|
||||
assertFalse(skipUndeclaredResults);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("unchecked")
|
||||
@Test
|
||||
public void testProcedurepParametersAreSet() throws Exception {
|
||||
setUp("storedProcOutboundGatewayParserTest.xml", getClass());
|
||||
|
||||
@@ -133,7 +134,8 @@ public class StoredProcOutboundGatewayParserTests {
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("unchecked")
|
||||
@Test
|
||||
public void testReturningResultSetRowMappersAreSet() throws Exception {
|
||||
setUp("storedProcOutboundGatewayParserTest.xml", getClass());
|
||||
|
||||
@@ -158,7 +160,8 @@ public class StoredProcOutboundGatewayParserTests {
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("unchecked")
|
||||
@Test
|
||||
public void testSqlParametersAreSet() throws Exception {
|
||||
setUp("storedProcOutboundGatewayParserTest.xml", getClass());
|
||||
|
||||
|
||||
@@ -13,11 +13,6 @@
|
||||
|
||||
package org.springframework.integration.jdbc.config;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.sql.Types;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -25,6 +20,7 @@ import java.util.Map.Entry;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.beans.DirectFieldAccessor;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||
@@ -36,6 +32,11 @@ import org.springframework.jdbc.core.SqlInOutParameter;
|
||||
import org.springframework.jdbc.core.SqlOutParameter;
|
||||
import org.springframework.jdbc.core.SqlParameter;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
/**
|
||||
* @author Gunnar Hillert
|
||||
* @since 2.1
|
||||
@@ -73,7 +74,8 @@ public class StoredProcPollingChannelAdapterParserTests {
|
||||
assertTrue("skipUndeclaredResults was not set and should default to 'true'", skipUndeclaredResults);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("unchecked")
|
||||
@Test
|
||||
public void testProcedurepParametersAreSet() throws Exception {
|
||||
setUp("storedProcPollingChannelAdapterParserTest.xml", getClass());
|
||||
|
||||
@@ -112,7 +114,8 @@ public class StoredProcPollingChannelAdapterParserTests {
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("unchecked")
|
||||
@Test
|
||||
public void testReturningResultSetRowMappersAreSet() throws Exception {
|
||||
setUp("storedProcPollingChannelAdapterParserTest.xml", getClass());
|
||||
|
||||
@@ -137,7 +140,8 @@ public class StoredProcPollingChannelAdapterParserTests {
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("unchecked")
|
||||
@Test
|
||||
public void testSqlParametersAreSet() throws Exception {
|
||||
setUp("storedProcPollingChannelAdapterParserTest.xml", getClass());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user