Tag - restful

JMeter HTTP 测试 restful    2017-07-19 22:08:18    5
1、创建项目
2、创建线程组:项目右键,添加,Threads(Users),Threads Group
3、创建HTTP请求:线程组右键,添加,Sampler,HTTP请求
4、添加监听器
    1)添加查看结果树:线程组右键,添加,监听器,察看结果树
    2)添加聚合报告:线程组右键,添加,监听器,聚合报告


 

by 刘迎光@萤火虫工作室 
OpenBI交流群:495266201 
MicroService 微服务交流群:217722918 
mail: liuyg#liuyingguang.cn 
博主首页(==防止爬虫==):http://blog.liuyingguang.cn

jenkins docker tomcat java restful shell    2017-07-19 21:50:48    8

前提:jenkins是装在CentOS6.7中,同时,我的这台linux上面安装有docker


一、项目代码:

项目主要是jersey 1.x 版本的maven项目,重点在与我在项目中放置了tomcat,以及使用maven对tomcat进行解压,并将项目打包的文件放置到项目中,那么项目信息就不多写了,把maven配置信息重点写出来吧:

    <build>
        <finalName>testjersey</finalName>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
                <version>1.2</version>
                <executions>
                    <execution>
                        <id>copy-package</id>
                        <phase>package</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <tasks>

                                <unzip dest="target/apache/">
                                    <fileset dir="${basedir}">
                                        <include name="apache-tomcat-7.0.68.zip" />
                               
java xwiki restful    2017-07-19 21:22:41    8

xwiki测试流程

  1. 测试页面
  1. public void normalTest()throws Exception, IOException{
  2. CloseableHttpClient httpclient = HttpClients.createDefault();
  3. JAXBContext context = JAXBContext.newInstance("org.xwiki.rest.model.jaxb");
  4. Unmarshaller unmarshaller = context.createUnmarshaller();
  5. HttpUriRequest httpPost = RequestBuilder.get()
  6. .setUri(new URI("http://172.16.200.220:8082/xwiki/rest/wikis/xwiki/spaces/Main/pages/WebHome"))
  7. .setHeader("Accept", "application/xml").build();
  8. CloseableHttpResponse response = httpclient.execute(httpPost);
  9. System.out.println(response.getEntity());
  10. HttpEntity responseEntity=response.getEntity();
  11. Page page = (Page) unmarshaller.unmarshal(responseEntity.getContent());
  12. System.out.println(new Gson().toJson(page));
  13. }
  1. 登录并获取session
  1. public void testLogin() throws Exception{
  2. CloseableHttpClient httpclient =
GateWay restful TYK    2017-07-19 20:58:01    4

源文件:https://github.com/TykTechnologies/tyk-swagger-definitions/blob/master/tyk_gateway_api.yml


 

swagger: '2.0'

info:
  version: "1.9"
  title: Gateway REST API

paths:
  /tyk/keys/:
    get:
      description: |
        Gets a list of *key* IDs (will only work with non-hashed installations)
      parameters:
        -
          name: api_id
          in: query
          description: Back-end to target
          required: true
          type: string
          format: string
        -
          name: x-tyk-authorization
          in: header
          description: tyk gateway shared secret
          required: true
          type: string
          format: string

      responses:
        200:
          description: Successful response
          schema:
            type: object
            properties:
              keys: 
                type: array
                items: 
                  type: string
                  
  /tyk/keys/create:
    post:
      description: |
        Create a n
elasticsearch restful    2017-07-19 20:41:59    2
为了学习elasticsearch,跟着官方文档及网上例子操作了一些,整理记录下来,以供大家参考。
本文所用测试工具:火狐插件HttpRequester。
elasticsearch:2.3

----------------------------------------创建文章---------------------------------------------
Content-Type: application/json
{
    "first_name" : "John",
    "last_name" :  "Smith",
    "age" :        25,
    "about" :      "I love to go rock climbing",
    "interests": [ "sports", "music" ]
}
 -- response --
200 OK
Content-Type:  application/json; charset=UTF-8
Content-Length:  127

{"_index":"megacorp","_type":"employee","_id":"1","_version":6,"_shards":{"total":2,"successful":1,"failed":0},"created":false}
----------------------------------------查询文章---------------------------------------------


 -- response --
200 OK
Content-Type:  application/json; charset=UTF-8
Content-Length:  278

{
  "_index" : "megacorp",
  "_type" : "employee",
  "_id" : "1",
  "_version" : 6,
  "found" : true,
  "_source" : {
    "first_name
1/2