20200511记录

0、spring      lombok       json    gson    java         commons-lang3

<dependency>

    <groupId>org.apache.commons</groupId>

    <artifactId>commons-lang3</artifactId>

    <version>3.9</version>

</dependency>

<dependency>

    <groupId>org.projectlombok</groupId>

    <artifactId>lombok</artifactId>

    <version> 1.16.22</version>

</dependency>

<dependency>

    <groupId>org.json</groupId>

    <artifactId>json</artifactId>

    <version> 20190722</version>

</dependency>

 

 

 

 

 

 

 

 

 

1、httpclient  cookiestore

 

<dependency>

    <groupId>org.apache.httpcomponents</groupId>

    <artifactId>httpclient</artifactId>

    <version>4.5.12</version>

</dependency>

 

CookieStore cookieStore= new BasicCookieStore();

 

CloseableHttpClient  httpClient =HttpClientBuilder.create().setDefaultCookieStore(TestConfig.cookieStore).build();

HttpPost post =new HttpPost(url);

 

Gson().toJson(userReq));  object >>>String

JSONObject param = new JSONObject(); param.toString();   JSONObject>>>String

 

StringEntity entity =new StringEntity(param.toString(),"utf-8");

post.setEntity(entity);

 

HttpResponse response =httpClient.execute(post);

 

 

result = EntityUtils.toString(response.getEntity(),”utf-8");   ResponseEntityProxy>>String

List resultList = Arrays.asList(result);  Sring>>ArrayList

JSONArray array =new JSONArray(resultList);  ArrayList >>>JSONArray

 

 

 

cookieStore.getCookies().get(0).getValue()

 

 

 

 

 

 

2、mybatis datasource

<dependency>

    <groupId>mysql</groupId>

    <artifactId>mysql-connector-java</artifactId>

    <version> 8.0.19</version>

</dependency>

<dependency>

    <groupId>org.mybatis.spring.boot</groupId>

    <artifactId>mybatis-spring-boot-starter</artifactId>

    <version> 2.1.2</version>

</dependency>

 

 

 

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN"

        "http://mybatis.org/dtd/mybatis-3-config.dtd">

<configuration>

   <environments default="development">

        <environment id="development">

            <transactionManager type="JDBC"/>

            <dataSource type="POOLED">

               <property name="driver" value="com.mysql.jdbc.Driver"/>

               <property name="url" value="jdbc:mysql://localhost:3306/autotest"/>

               <property name="username" value="spring"/>

               <property name="password" value="spring"/>

            </dataSource>

        </environment>

    </environments>

   <mappers>

        <mapper resource="mapper/SQLMapper.xml"/>

    </mappers>

</configuration>

 

 

 

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"

        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">

<mapper namespace="com.tanzi.model">

    <select id="loginCase" parameterType="Integer"  resultType="com.tanzi.model.LoginCase">

 

        select * from loginCase

        where id = #{id};</select>

 

 

Reader reader= Resources.getResourceAsReader("databaseConfig.xml");

SqlSessionFactory factory=new SqlSessionFactoryBuilder().build(reader);

SqlSession sqlSession =factory.openSession(true);

return sqlSession;

 

 

3 、testng      extentreports

 

<dependency>

    <groupId>org.testng</groupId>

    <artifactId>testng</artifactId>

    <version>7.1.0</version>

</dependency>

 

 

<dependency>

    <groupId>com.relevantcodes</groupId>

    <artifactId>extentreports</artifactId>

    <version> 2.41.1</version>

</dependency>

<dependency>

    <groupId>com.vimalselvam</groupId>

    <artifactId>testng-extentsreport</artifactId>

    <version> 1.3.1</version>

</dependency>

 

<dependency>

    <groupId>com.aventstack</groupId>

    <artifactId>extentreports</artifactId>

    <version>3.0.6</version>

</dependency>

 

<listeners>

    <listener class-name="com.tanzi.config.ExtentTestNGReportListener" />

</listeners>

 

 

 

 

 

 

 

 

 

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值