service test去掉ehcache测试

This commit is contained in:
shuzheng 2016-10-18 17:32:46 +08:00
parent 2de8d5e2fd
commit 58e1b05798
1 changed files with 1 additions and 18 deletions

View File

@ -20,8 +20,7 @@ import org.springframework.test.context.transaction.TransactionConfiguration;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration({
"classpath:applicationContext.xml",
"classpath:applicationContext-jdbc.xml",
"classpath:applicationContext-ehcache.xml"
"classpath:applicationContext-jdbc.xml"
})
@TransactionConfiguration(transactionManager = "transactionManager", defaultRollback = true)
public class UserServiceTest {
@ -37,22 +36,6 @@ public class UserServiceTest {
// 自动生成接口调用
User user = userService.getMapper().selectByPrimaryKey(1);
System.out.println(null == user ? "null" :user.getNickname());
// EhCache调用
// Create a cache manager
final CacheManager cacheManager = CacheManager.getInstance();
// create the cache called "hello-world"
final Cache cache = cacheManager.getCache("ehcache_common");
// create a key to map the data to
final String key = "key";
// Create a data element
final Element element = new Element(key, "value");
// Put the element into the data store
cache.put(element);
// Retrieve the data element
final Element cacheElement = cache.get(key);
// Print the value
System.out.println(cacheElement.getObjectValue());
}
}