Merge pull request #744 from ghillert/INT-2919

This commit is contained in:
Gary Russell
2013-02-12 11:05:53 -05:00
2 changed files with 7 additions and 7 deletions

View File

@@ -50,7 +50,7 @@ subprojects { subproject ->
springAmqpVersion = '1.1.3.RELEASE'
springDataMongoVersion = '1.1.1.RELEASE'
springDataRedisVersion = '1.0.2.RELEASE'
springGemfireVersion = '1.1.1.RELEASE'
springGemfireVersion = '1.2.2.RELEASE'
springSecurityVersion = '3.1.3.RELEASE'
springSocialTwitterVersion = '1.0.1.RELEASE'
springWsVersion = '2.1.1.RELEASE'

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2011 the original author or authors.
* Copyright 2002-2013 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.
@@ -18,6 +18,7 @@ package org.springframework.integration.gemfire.outbound;
import static org.junit.Assert.assertEquals;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
@@ -28,13 +29,13 @@ import org.springframework.data.gemfire.RegionFactoryBean;
import org.springframework.integration.Message;
import org.springframework.integration.support.MessageBuilder;
import com.gemstone.bp.edu.emory.mathcs.backport.java.util.Collections;
import com.gemstone.gemfire.cache.Cache;
import com.gemstone.gemfire.cache.Region;
/**
* @author Mark Fisher
* @author David Turanski
* @author Gunnar Hillert
* @since 2.1
*/
public class CacheWritingMessageHandlerTests {
@@ -58,7 +59,7 @@ public class CacheWritingMessageHandlerTests {
assertEquals(1, region.size());
assertEquals("bar", region.get("foo"));
}
@Test
public void ExpressionsWriteToCache() throws Exception {
CacheFactoryBean cacheFactoryBean = new CacheFactoryBean();
@@ -71,13 +72,12 @@ public class CacheWritingMessageHandlerTests {
Region<String, String> region = regionFactoryBean.getObject();
assertEquals(0, region.size());
CacheWritingMessageHandler handler = new CacheWritingMessageHandler(region);
Map<String, String> expressions = new HashMap<String, String>();
expressions.put("'foo'", "'bar'");
expressions.put("payload.toUpperCase()", "headers['bar'].toUpperCase()");
handler.setCacheEntries(expressions);
@SuppressWarnings("unchecked")
Message<?> message = MessageBuilder.withPayload("foo").copyHeaders(Collections.singletonMap("bar", "bar")).build();
handler.handleMessage(message);
assertEquals(2, region.size());