mock-httpserver:一个模拟 Http 服务器

上传者: 42128315 | 上传时间: 2022-11-29 16:32:18 | 文件大小: 44KB | 文件类型: ZIP
模拟 httpserver 一个 Mock Http Server,您可以在其中根据请求必须满足的谓词来定义请求中收到的答案。 它的主要目的是在 JUnit-Tests 中使用。 启动和停止模拟 httpserver 假设我们在setUp方法中启动模拟 httpserver 并在tearDown方法中停止它,代码将是: @Before public void setUp() { mockHttpServer = new MockHttpServer ( 8888 ); mockHttpServer . start(); } 这会在端口 8888 上启动一个 mock-httpserver。要关闭它,请调用 mock-httpserver 的stop方法。 @After public void tearDown() { mockHttpServer . stop()

文件下载

资源详情

[{"title":"( 35 个子文件 44KB ) mock-httpserver:一个模拟 Http 服务器","children":[{"title":"mock-httpserver-master","children":[{"title":"LICENSE.txt <span style='color:#111;'> 9.93KB </span>","children":null,"spread":false},{"title":"src","children":[{"title":"test","children":[{"title":"java","children":[{"title":"de","children":[{"title":"hanbei","children":[{"title":"httpserver","children":[{"title":"MockHttpServerTest.java <span style='color:#111;'> 9.21KB </span>","children":null,"spread":false},{"title":"common","children":[{"title":"ContentTest.java <span style='color:#111;'> 929B </span>","children":null,"spread":false},{"title":"CookieTest.java <span style='color:#111;'> 1.61KB </span>","children":null,"spread":false},{"title":"MultiValuedMapTest.java <span style='color:#111;'> 1.44KB </span>","children":null,"spread":false},{"title":"HTTPVersionTest.java <span style='color:#111;'> 1.19KB </span>","children":null,"spread":false}],"spread":true},{"title":"URITest.java <span style='color:#111;'> 479B </span>","children":null,"spread":false},{"title":"URLURITest.java <span style='color:#111;'> 1012B </span>","children":null,"spread":false},{"title":"CharOutStreamTest.java <span style='color:#111;'> 809B </span>","children":null,"spread":false},{"title":"request","children":[{"title":"HeaderTest.java <span style='color:#111;'> 2.59KB </span>","children":null,"spread":false},{"title":"RequestTest.java <span style='color:#111;'> 1.05KB </span>","children":null,"spread":false}],"spread":true},{"title":"response","children":[{"title":"ResponseBuilderTest.java <span style='color:#111;'> 2.17KB </span>","children":null,"spread":false}],"spread":false}],"spread":true}],"spread":true}],"spread":true}],"spread":true}],"spread":true},{"title":"main","children":[{"title":"resources","children":[{"title":"log4j.properties <span style='color:#111;'> 1.23KB </span>","children":null,"spread":false}],"spread":true},{"title":"java","children":[{"title":"de","children":[{"title":"hanbei","children":[{"title":"httpserver","children":[{"title":"common","children":[{"title":"Content.java <span style='color:#111;'> 5.41KB </span>","children":null,"spread":false},{"title":"HTTPVersion.java <span style='color:#111;'> 1.15KB </span>","children":null,"spread":false},{"title":"MultiValuedMap.java <span style='color:#111;'> 1.99KB </span>","children":null,"spread":false},{"title":"Method.java <span style='color:#111;'> 830B </span>","children":null,"spread":false},{"title":"Cookie.java <span style='color:#111;'> 2.24KB </span>","children":null,"spread":false},{"title":"Status.java <span style='color:#111;'> 5.30KB </span>","children":null,"spread":false},{"title":"Header.java <span style='color:#111;'> 7.13KB </span>","children":null,"spread":false}],"spread":true},{"title":"exceptions","children":[{"title":"ServerErrorException.java <span style='color:#111;'> 928B </span>","children":null,"spread":false},{"title":"ContentException.java <span style='color:#111;'> 746B </span>","children":null,"spread":false}],"spread":true},{"title":"Mapping.java <span style='color:#111;'> 1.50KB </span>","children":null,"spread":false},{"title":"RequestProcessor.java <span style='color:#111;'> 915B </span>","children":null,"spread":false},{"title":"MockHttpServer.java <span style='color:#111;'> 4.66KB </span>","children":null,"spread":false},{"title":"request","children":[{"title":"Request.java <span style='color:#111;'> 3.31KB </span>","children":null,"spread":false},{"title":"QueryParameter.java <span style='color:#111;'> 1.72KB </span>","children":null,"spread":false}],"spread":false},{"title":"response","children":[{"title":"ResponseBuilder.java <span style='color:#111;'> 6.32KB </span>","children":null,"spread":false},{"title":"Response.java <span style='color:#111;'> 4.24KB </span>","children":null,"spread":false},{"title":"ResponseWriter.java <span style='color:#111;'> 5.12KB </span>","children":null,"spread":false}],"spread":false},{"title":"MockHttpHandler.java <span style='color:#111;'> 8.21KB </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true}],"spread":true}],"spread":true}],"spread":true},{"title":".travis.yml <span style='color:#111;'> 152B </span>","children":null,"spread":false},{"title":"README.md <span style='color:#111;'> 3.73KB </span>","children":null,"spread":false},{"title":"pom.xml <span style='color:#111;'> 6.31KB </span>","children":null,"spread":false},{"title":".gitignore <span style='color:#111;'> 32B </span>","children":null,"spread":false}],"spread":true}],"spread":true}]

评论信息

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明