摇曳的蔷薇

package com.ghj.packageofclient;import java.util.Date;import junit.framework.TestCase;import com.ghj.packageoftool.MemcachedUtils;public class Client extends TestCase{/*** 测试MemcachedUtils类的set方法。** @author GaoHuanjie*/public static void testSet1() {MemcachedUtils.set("set1Description", "调用MemcachedUtils类的set方法,没有设置键值对的存在时长");System.out.println(MemcachedUtils.get("set1Description").toString());}/*** 测试MemcachedUtils类的set方法。** @author GaoHuanjie*/public static void testSet2() {MemcachedUtils.set("set2Description", "调用MemcachedUtils类的set方法,设置了键值对的存在时长——存在60秒", new Date(1000*60));System.out.println(MemcachedUtils.get("set2Description").toString());}/*** 测试MemcachedUtils类的add方法。** @author GaoHuanjie*/public static void testAdd1() {MemcachedUtils.add("add1Description", "调用MemcachedUtils类的add方法,没有设置键值对的存在时长");System.out.println(MemcachedUtils.get("add1Description").toString());}/*** 测试MemcachedUtils类的add方法。** @author GaoHuanjie*/public static void testAdd2() {MemcachedUtils.add("add2Description", "调用MemcachedUtils类的add方法,设置了键值对的存在时长——存在60秒", new Date(1000*60));System.out.println(MemcachedUtils.get("add2Description").toString());}/*** 测试MemcachedUtils类的replace方法。** @author GaoHuanjie*/public static void testReplace1() {MemcachedUtils.add("replace1Description", "调用MemcachedUtils类的replace方法,没有设置键值对的存在时长");MemcachedUtils.replace("replace1Description", "值改变了!!!");System.out.println(MemcachedUtils.get("replace1Description").toString());}/*** 测试MemcachedUtils类的replace方法。** @author GaoHuanjie*/public static void testReplace2() {MemcachedUtils.add("replace2Description", "调用MemcachedUtils类的replace方法,设置了键值对的存在时长——存在60秒", new Date(1000*60));MemcachedUtils.replace("replace2Description", "值改变了!!!", new Date(1000*60));System.out.println(MemcachedUtils.get("replace2Description").toString());}/*** 测试MemcachedUtils类的get方法。** @author GaoHuanjie*/public static void testGet() {MemcachedUtils.add("getDescription", "调用MemcachedUtils类的get方法,没有设置键值对的存在时长");System.out.println(MemcachedUtils.get("getDescription").toString());}/*** 测试MemcachedUtils类的delete方法。** @author GaoHuanjie*/public static void testDelete1() {MemcachedUtils.add("delete1Description", "调用MemcachedUtils类的delete方法,没有设置键值对的逾期时长");MemcachedUtils.delete("delete1Description");assertEquals(null, MemcachedUtils.get("delete1Description"));}/*** 测试MemcachedUtils类的delete方法。** @author GaoHuanjie*/public static void testDelete2() {MemcachedUtils.set("delete2Description1", "调用MemcachedUtils类的delete方法,设置键值对的逾期时长", new Date(600*1000));MemcachedUtils.delete("delete2Description1", new Date(1000*600));assertEquals(null, MemcachedUtils.get("delete2Description1"));}/*** 测试MemcachedUtils类的flashAll方法。** @author GaoHuanjie*/public static void testFlashAll() {MemcachedUtils.add("flashAllDescription", "调用MemcachedUtils类的delete方法,没有设置键值对的预期时长");MemcachedUtils.flashAll();assertEquals(null, MemcachedUtils.get("flashAllDescription"));}}

java memcachedclient_Java memcached client怎样建立长连接相关推荐

  1. html5 长链接,Vue通过WebSocket建立长连接,连接

    Vue通过WebSocket建立长连接,连接 使用场景: 在项目开发中,后端需要处理一连串的逻辑,或者等待第三方的数据返回来进行处理之后在返回给前端,可能时间会很长,而且前端也不知道后端什么时候能处理 ...

  2. Android-经典蓝牙(BT)-建立长连接传输短消息和文件

    参考: https://developer.android.com/guide/topics/connectivity/bluetooth http://bbs.eeworld.com.cn/thre ...

  3. Unity中与WebSocket服务端建立长连接

    笔记记录,由于项目需求需要和用WebSocket编写的服务端建立长连接进行实时同步,因此封装的一个脚本,这边用到了BaseHTTP的插件,因此使用这个脚本时需要导入BaseHTTP插件.脚本可以直接拿 ...

  4. java socket建立长连接_Java Web项目中使用Socket通信多线程、长连接的方法

    很多时候在javaweb项目中我们需要用到Socket通信来实现功能,在web中使用Socket我们需要建立一个监听程序,在程序启动时,启动socket监听.我们的应用场景是在java项目中,需要外接 ...

  5. java comet_用java实现comet,基于 HTTP长连接的实现,用于从服务端实时发送信息到客户端...

    http://homelink.javaeye.com/blog/293328#comments 参考文档 http://www.ibm.com/developerworks/cn/web/wa-lo ...

  6. JAVA网络编程Socket常见问题 【长连接专题】

    一. 网络程序运行过程中的常见异常及处理 第1个异常是 java.net.BindException:Address already in use: JVM_Bind. 该异常发生在服务器端进行new ...

  7. java tcp链接慢_jmeter tcp长连接性能测试

    jmeter除了可以做http测试,还支持tcp长连接 图中的Ramp-Up Period需要注意,它表示启动所有线程花费的时间,如图所示,设置为40秒,jmeter会自动计算每秒应该启动多少个线程. ...

  8. 关于Socket建立长连接遇到的bug信息

    下面是本人在Socket连接的开发中遇到的bug总结 1."远程服务器关闭了Socket长连接'的错误信息 2.关于"kCFStreamNetworkServiceTypeVoIP ...

  9. memcached client for java api,Memcached Client Forjava API

    java_memcached-release 关键类及方法整理说明如下. SockIOPool    这个类用来创建管理客户端和服务器通讯连接池,客户端主要的工作包括数据通讯.服务器定位.hash 码 ...

最新文章

  1. 北大30岁女博导获2019 IEEE青年成就奖,全球仅三人,深耕微纳电子、神经形态计算...
  2. Oracle VM VirtualBox下各种视图切换
  3. 浏览器兼容_查成绩浏览器不兼容怎么办?
  4. c语言输入的成绩由高到低该怎么,输入成绩,按照平均分从高到低输出
  5. elasticsearch常用命令
  6. scheme 学习:红黑树
  7. 基于tcp的应用层协议还原
  8. YUV采样及存储格式
  9. 如何使用Wondershare PDFelement制作PDF文件
  10. 区块链 以太坊 合约 创建、执行 详解
  11. Atitit 软件程序的定义 软件广义定义 程序代码,文档 ,数据 方法,规则, 狭义定义 软件=程序+数据+文档 软件(英文:Software)是一系列按照特定顺序组织的计算机数据和指
  12. 密码货币量化基金突然很热,但你可知道成功有多难?
  13. Python3使用bencode库解析BT种子
  14. 计算机网络技术用古诗文描述,【多媒体技术论文】多媒体技术在古诗文教学的运用(共2828字)...
  15. 什么是PKI 体系(数字证书种类)
  16. 微信小程序毕业设计选题
  17. Hyperledger Fabric定制联盟链网络工程实践
  18. 实例总结C#反射基础知识[原创]
  19. elementui 描述列表Descriptions组件宽度修改
  20. 阿里云之如何使用阿里大鱼给喜欢的人发短信(1)

热门文章

  1. linux 网络状态表 /proc/net/tcp 各项参数说明
  2. Linux自动备份文件(linux计划任务)
  3. linux编程下signal()函数
  4. xampp mysql mac_如何在mac上用终端打开XAMPP自带的MySQL
  5. libsigc++库的使用
  6. mysql5.7.17主从_MySQL 5.7主从不停机添加新从库
  7. 安装版 修改mysql最大连接数_修改MySQL最大连接数
  8. faster rcnn接口_TF-Faster-rcnn宠物狗种类识别之对接自己的数据
  9. 服务器反馈为空,反馈服务器端error的处理
  10. 计算机由那几个基础部分组成,计算机的基本组成由哪些?