DATAKV-25
+ add another integration test
This commit is contained in:
@@ -17,12 +17,11 @@ package org.springframework.data.keyvalue.redis.config;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.springframework.context.support.GenericXmlApplicationContext;
|
||||
import org.springframework.data.keyvalue.redis.core.StringRedisTemplate;
|
||||
import org.springframework.data.keyvalue.redis.listener.RedisMessageListenerContainer;
|
||||
|
||||
/**
|
||||
@@ -47,6 +46,14 @@ public class NamespaceTest {
|
||||
public void testSanityTest() throws Exception {
|
||||
RedisMessageListenerContainer container = ctx.getBean(RedisMessageListenerContainer.class);
|
||||
assertTrue(container.isRunning());
|
||||
Thread.sleep(TimeUnit.SECONDS.toMillis(1));
|
||||
//Thread.sleep(TimeUnit.SECONDS.toMillis(1));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testWithMessages() throws Exception {
|
||||
StringRedisTemplate template = ctx.getBean(StringRedisTemplate.class);
|
||||
template.convertAndSend("x1", "[X]test");
|
||||
template.convertAndSend("z1", "[Z]test");
|
||||
//Thread.sleep(TimeUnit.SECONDS.toMillis(5));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
<task:executor id="testTaskExecutor" />
|
||||
|
||||
<redis:listener-container task-executor="testTaskExecutor">
|
||||
<redis:listener-container>
|
||||
<!-- default handle method -->
|
||||
<redis:listener ref="testBean1" channel="z1 z2" pattern="x*"/>
|
||||
<!-- channel subscription only -->
|
||||
@@ -23,4 +23,8 @@
|
||||
|
||||
<bean id="serializer" class="org.springframework.data.keyvalue.redis.serializer.StringRedisSerializer"/>
|
||||
|
||||
<bean id="redisTemplate" class="org.springframework.data.keyvalue.redis.core.StringRedisTemplate">
|
||||
<property name="connectionFactory" ref="redisConnectionFactory"/>
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
Reference in New Issue
Block a user