测试URL接口的Thread
来源:互联网 发布:淘宝认证考试 编辑:程序博客网 时间:2024/04/30 21:03
package com.bochy.test;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
public class Test {
public static int i = 47;
public static void main(String[] args) throws Exception {
new Thread(new Runnable() {
@Override
public void run() {
// TODO Auto-generated method stub
URL yahoo;
try {
yahoo = new URL(
"http://133.128.27.150:8080/eom/mt/MTCon/getDepartByStaffArea.json?areaCode=80307");
BufferedReader in = new BufferedReader(
new InputStreamReader(yahoo.openStream()));
String inputLine;
while ((inputLine = in.readLine()) != null)
System.out.println(inputLine);
in.close();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}).start();
new Thread(new Runnable() {
@Override
public void run() {
// TODO Auto-generated method stub
URL yahoo;
try {
yahoo = new URL(
"http://localhost:8888/eom/pages/WorkTaskCon/weixin/chkin.json?orderNum=ZC20693854.20693855&staffId=10010&workInstId=20350488&jsonpCallback=?");
BufferedReader in = new BufferedReader(
new InputStreamReader(yahoo.openStream()));
String inputLine;
while ((inputLine = in.readLine()) != null)
System.out.println(inputLine);
in.close();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}).start();
// TODO Auto-generated method stub
/*
* SimpleDateFormat formatter = new
* SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS"); String formatStr
* =formatter.format(new Date()); Date dt= new Date(); Long time=
* dt.getTime();//这就是距离1970年1月1日0点0分0秒的毫秒数
* System.out.println(System.currentTimeMillis
* ()+":"+formatStr+":"+time);//与上面的相同
*/
}
}
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
public class Test {
public static int i = 47;
public static void main(String[] args) throws Exception {
new Thread(new Runnable() {
@Override
public void run() {
// TODO Auto-generated method stub
URL yahoo;
try {
yahoo = new URL(
"http://133.128.27.150:8080/eom/mt/MTCon/getDepartByStaffArea.json?areaCode=80307");
BufferedReader in = new BufferedReader(
new InputStreamReader(yahoo.openStream()));
String inputLine;
while ((inputLine = in.readLine()) != null)
System.out.println(inputLine);
in.close();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}).start();
new Thread(new Runnable() {
@Override
public void run() {
// TODO Auto-generated method stub
URL yahoo;
try {
yahoo = new URL(
"http://localhost:8888/eom/pages/WorkTaskCon/weixin/chkin.json?orderNum=ZC20693854.20693855&staffId=10010&workInstId=20350488&jsonpCallback=?");
BufferedReader in = new BufferedReader(
new InputStreamReader(yahoo.openStream()));
String inputLine;
while ((inputLine = in.readLine()) != null)
System.out.println(inputLine);
in.close();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}).start();
// TODO Auto-generated method stub
/*
* SimpleDateFormat formatter = new
* SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS"); String formatStr
* =formatter.format(new Date()); Date dt= new Date(); Long time=
* dt.getTime();//这就是距离1970年1月1日0点0分0秒的毫秒数
* System.out.println(System.currentTimeMillis
* ()+":"+formatStr+":"+time);//与上面的相同
*/
}
}
0 0
- 测试URL接口的Thread
- 初步了解URL(接口测试必备)
- Url接口测试:HttpClient模拟登录效果
- URL联网的测试
- (基于nodejs)微信测试号(接口配置信息)验证服务器的URL
- 【接口测试】接口测试的自我修养
- Runnable接口与Thread类的区别
- Runnable接口与Thread类的区别
- Runnable接口与Thread类的区别
- Thread类和Runnable接口的区别
- Runnable接口与Thread类的区别
- Thread类与Runnable接口的区别
- Runnable接口与Thread类的区别
- Runnable接口与Thread类的区别
- thread类与Runnable接口的区别
- Thread类和Runnable接口的区别
- 接口测试的应用
- 接口测试的应用
- Yii2.0中不同业务之间的表导入工作(批量查询, 批量插入)
- 在Mac OS X 中如何查看keychain中已经保存的密码记录
- theano学习初步(二) 基础Tensor函数
- NOIP2008(2)排座椅
- 广播机制
- 测试URL接口的Thread
- 【caffe-Windows】训练自己数据——数据集格式转换
- Python调用已训练好的caffe模型进行分类
- Android设备连接Unity Profiler性能分析器
- 算法学习之素数
- redis的linux下的单机安装、集群安装及测试
- 写操作系统只能用汇编和C语言吗
- git本地仓库连接多远程
- 12.【链表】Linked List Cycle--Accepted code