diff --git a/spring-integration-gemfire/src/main/resources/org/springframework/integration/gemfire/config/xml/spring-integration-gemfire-4.0.xsd b/spring-integration-gemfire/src/main/resources/org/springframework/integration/gemfire/config/xml/spring-integration-gemfire-4.0.xsd index 5fbc3b26bd..38511a77b7 100644 --- a/spring-integration-gemfire/src/main/resources/org/springframework/integration/gemfire/config/xml/spring-integration-gemfire-4.0.xsd +++ b/spring-integration-gemfire/src/main/resources/org/springframework/integration/gemfire/config/xml/spring-integration-gemfire-4.0.xsd @@ -110,12 +110,15 @@ ]]> - + - + + + + diff --git a/spring-integration-gemfire/src/test/java/org/springframework/integration/gemfire/inbound/CqInboundChannelAdapterTests-context.xml b/spring-integration-gemfire/src/test/java/org/springframework/integration/gemfire/inbound/CqInboundChannelAdapterTests-context.xml index 8c369c1d9b..6fd36bcd98 100644 --- a/spring-integration-gemfire/src/test/java/org/springframework/integration/gemfire/inbound/CqInboundChannelAdapterTests-context.xml +++ b/spring-integration-gemfire/src/test/java/org/springframework/integration/gemfire/inbound/CqInboundChannelAdapterTests-context.xml @@ -1,13 +1,23 @@ + http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd + http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd"> + + + + + true + @@ -22,9 +32,9 @@ - + channel="outputChannel1" durable="${durable}" /> diff --git a/spring-integration-gemfire/src/test/java/org/springframework/integration/gemfire/inbound/CqInboundChannelAdapterTests.java b/spring-integration-gemfire/src/test/java/org/springframework/integration/gemfire/inbound/CqInboundChannelAdapterTests.java index 55cd7bbcfc..222aa8152b 100644 --- a/spring-integration-gemfire/src/test/java/org/springframework/integration/gemfire/inbound/CqInboundChannelAdapterTests.java +++ b/spring-integration-gemfire/src/test/java/org/springframework/integration/gemfire/inbound/CqInboundChannelAdapterTests.java @@ -1,17 +1,21 @@ /* - * Copyright 2002-2011 the original author or authors. - * + * Copyright 2002-2014 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.integration.gemfire.inbound; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + import java.io.IOException; import java.io.OutputStream; @@ -20,54 +24,57 @@ import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ConfigurableApplicationContext; +import org.springframework.integration.gemfire.fork.ForkUtil; +import org.springframework.integration.test.util.TestUtils; import org.springframework.messaging.Message; import org.springframework.messaging.PollableChannel; -import org.springframework.integration.gemfire.fork.ForkUtil; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import com.gemstone.gemfire.cache.query.CqEvent; import com.gemstone.gemfire.internal.cache.LocalRegion; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; - /** * @author David Turanski + * @author Gary Russell * */ @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration public class CqInboundChannelAdapterTests { static ConfigurableApplicationContext staticCtx; - + @Autowired LocalRegion region; - + @Autowired ConfigurableApplicationContext applicationContext; - - @Autowired + + @Autowired PollableChannel outputChannel1; - - @Autowired + + @Autowired PollableChannel outputChannel2; - + + @Autowired + ContinuousQueryMessageProducer withDurable; + static OutputStream os; @BeforeClass public static void startUp() throws Exception { os = ForkUtil.cacheServer(); } - - - @Before + + + @Before public void setUp() { staticCtx = applicationContext; + assertTrue(TestUtils.getPropertyValue(withDurable, "durable", Boolean.class)); } - + @Test public void testCqEvent() throws InterruptedException { region.put("one",1); @@ -75,24 +82,24 @@ public class CqInboundChannelAdapterTests { assertNotNull(msg); assertTrue(msg.getPayload() instanceof CqEvent); } - + @Test public void testPayloadExpression() throws InterruptedException { region.put("one",1); Message msg = outputChannel2.receive(1000); assertNotNull(msg); - assertEquals(1,msg.getPayload()); + assertEquals(1,msg.getPayload()); } - + @AfterClass - public static void cleanUp() { + public static void cleanUp() { /* * Avoid shutdown errors */ staticCtx.close(); sendSignal(); } - + public static void sendSignal() { try { os.write("\n".getBytes());