diff --git a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/listener/adapter/ContainerXmlSetupTest.java b/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/listener/adapter/ContainerXmlSetupTest.java new file mode 100644 index 000000000..8b180ea3e --- /dev/null +++ b/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/listener/adapter/ContainerXmlSetupTest.java @@ -0,0 +1,36 @@ +/* + * Copyright 2011 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.springframework.data.keyvalue.redis.listener.adapter; + +import static org.junit.Assert.*; + +import org.junit.Test; +import org.springframework.context.support.GenericXmlApplicationContext; +import org.springframework.data.keyvalue.redis.listener.RedisMessageListenerContainer; + +/** + * @author Costin Leau + */ +public class ContainerXmlSetupTest { + + @Test + public void testContainerSetup() throws Exception { + GenericXmlApplicationContext ctx = new GenericXmlApplicationContext( + "/org/springframework/data/keyvalue/redis/listener/container.xml"); + RedisMessageListenerContainer container = ctx.getBean("redisContainer", RedisMessageListenerContainer.class); + assertTrue(container.isRunning()); + } +} diff --git a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/listener/adapter/RedisMDP.java b/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/listener/adapter/RedisMDP.java new file mode 100644 index 000000000..6f5327c8c --- /dev/null +++ b/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/listener/adapter/RedisMDP.java @@ -0,0 +1,26 @@ +/* + * Copyright 2011 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.springframework.data.keyvalue.redis.listener.adapter; + +/** + * @author Costin Leau + */ +public class RedisMDP { + + public void handle(String message) { + System.out.println("Received message " + message); + } +} diff --git a/spring-data-redis/src/test/resources/org/springframework/data/keyvalue/redis/listener/container.xml b/spring-data-redis/src/test/resources/org/springframework/data/keyvalue/redis/listener/container.xml new file mode 100644 index 000000000..f5f3d67ed --- /dev/null +++ b/spring-data-redis/src/test/resources/org/springframework/data/keyvalue/redis/listener/container.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + +