INT-2008 un-Ignored all tests requiring running instance of Redis, changed to use custom port

This commit is contained in:
Oleg Zhurakousky
2011-07-26 18:14:05 -04:00
parent 21e25ac1f2
commit 68770e2898
9 changed files with 29 additions and 23 deletions

View File

@@ -15,11 +15,6 @@
*/
package org.springframework.integration.redis.channel;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import org.junit.Ignore;
import org.junit.Test;
import org.mockito.Mockito;
import org.springframework.beans.factory.BeanFactory;
@@ -27,13 +22,17 @@ import org.springframework.data.redis.connection.jedis.JedisConnectionFactory;
import org.springframework.integration.Message;
import org.springframework.integration.core.MessageHandler;
import org.springframework.integration.message.GenericMessage;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
/**
* @author Oleg Zhurakousky
* @since 2.0
*/
public class SubscribableRedisChannelTests {
@Test //@Ignore // requires instance of redis-server
@Test
public void pubSubChanneTest() throws Exception{
JedisConnectionFactory connectionFactory = new JedisConnectionFactory();
connectionFactory.setPort(7379);

View File

@@ -12,5 +12,7 @@
<int-redis:publish-subscribe-channel id="redisChannel" topic-name="si.test.topic"/>
<bean id="redisConnectionFactory" class="org.springframework.data.redis.connection.jedis.JedisConnectionFactory"/>
<bean id="redisConnectionFactory" class="org.springframework.data.redis.connection.jedis.JedisConnectionFactory">
<property name="port" value="7379"/>
</bean>
</beans>

View File

@@ -35,7 +35,7 @@ import org.springframework.integration.test.util.TestUtils;
*/
public class RedisChannelParserTests {
@Test @Ignore // requires redis-server instance
@Test
public void testPubSubChannelConfig(){
ApplicationContext context = new ClassPathXmlApplicationContext("RedisChannelParserTests-context.xml", this.getClass());
SubscribableChannel redisChannel = context.getBean("redisChannel", SubscribableChannel.class);

View File

@@ -1,26 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:int="http://www.springframework.org/schema/integration"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:int="http://www.springframework.org/schema/integration"
xmlns:int-redis="http://www.springframework.org/schema/integration/redis"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration-2.0.xsd
http://www.springframework.org/schema/integration/redis http://www.springframework.org/schema/integration/redis/spring-integration-redis-2.0.xsd">
<int-redis:inbound-channel-adapter id="adapter"
topics="foo, bar"
channel="receiveChannel"
error-channel="testErrorChannel"
message-converter="testConverter"/>
<int-redis:inbound-channel-adapter
id="adapter" topics="foo, bar" channel="receiveChannel" error-channel="testErrorChannel"
message-converter="testConverter" />
<int:channel id="receiveChannel">
<int:queue/>
<int:queue />
</int:channel>
<int:channel id="testErrorChannel"/>
<int:channel id="testErrorChannel" />
<bean id="redisConnectionFactory" class="org.springframework.data.redis.connection.jedis.JedisConnectionFactory"/>
<bean id="redisConnectionFactory" class="org.springframework.data.redis.connection.jedis.JedisConnectionFactory">
<property name="port" value="7379" />
</bean>
<bean id="testConverter" class="org.springframework.integration.redis.config.RedisInboundChannelAdapterParserTests$TestMessageConverter"/>
<bean id="testConverter"
class="org.springframework.integration.redis.config.RedisInboundChannelAdapterParserTests$TestMessageConverter" />
</beans>

View File

@@ -54,9 +54,10 @@ public class RedisInboundChannelAdapterParserTests {
assertEquals(converterBean, accessor.getPropertyValue("messageConverter"));
}
@Test @Ignore
@Test
public void testInboundChannelAdapterMessaging() {
JedisConnectionFactory connectionFactory = new JedisConnectionFactory();
connectionFactory.setPort(7379);
connectionFactory.afterPropertiesSet();
connectionFactory.getConnection().publish("foo".getBytes(), "Hello Redis from foo".getBytes());
QueueChannel receiveChannel = context.getBean("receiveChannel", QueueChannel.class);

View File

@@ -20,7 +20,9 @@
<int:queue/>
</int:channel>
<bean id="redisConnectionFactory" class="org.springframework.data.redis.connection.jedis.JedisConnectionFactory"/>
<bean id="redisConnectionFactory" class="org.springframework.data.redis.connection.jedis.JedisConnectionFactory">
<property name="port" value="7379"/>
</bean>
<bean id="testConverter" class="org.springframework.integration.redis.config.RedisOutboundChannelAdapterParserTests$TestMessageConverter"/>

View File

@@ -56,7 +56,7 @@ public class RedisOutboundChannelAdapterParserTests {
assertEquals(converterBean, accessor.getPropertyValue("messageConverter"));
}
@Test @Ignore // requires redis-server instance
@Test
public void testOutboundChannelAdapterMessaging(){
MessageChannel sendChannel = context.getBean("sendChannel", MessageChannel.class);
sendChannel.send(new GenericMessage<String>("Hello Redis"));

View File

@@ -33,13 +33,14 @@ import org.springframework.integration.channel.QueueChannel;
*/
public class RedisInboundChannelAdapterTests {
@Test @Ignore
@Test
public void testRedisInboundChannelAdapter() throws Exception {
int numToTest = 100;
String redisChannelName = "si.test.channel";
QueueChannel channel = new QueueChannel();
JedisConnectionFactory connectionFactory = new JedisConnectionFactory();
connectionFactory.setPort(7379);
connectionFactory.afterPropertiesSet();
RedisInboundChannelAdapter adapter = new RedisInboundChannelAdapter(connectionFactory);

View File

@@ -45,6 +45,7 @@ public class RedisPublishingMessageHandlerTests {
final CountDownLatch latch = new CountDownLatch(numToTest);
JedisConnectionFactory connectionFactory = new JedisConnectionFactory();
connectionFactory.setPort(7379);
connectionFactory.afterPropertiesSet();
MessageListenerAdapter listener = new MessageListenerAdapter();