集成 jacoco

This commit is contained in:
click33 2022-08-31 14:11:14 +08:00
parent 1f398c7a17
commit 3cc3efcc6f
25 changed files with 90 additions and 103 deletions

View File

@ -21,7 +21,7 @@
<module>sa-token-core</module>
<module>sa-token-starter</module>
<module>sa-token-plugin</module>
<!-- <module>sa-token-test</module> -->
<module>sa-token-test</module>
<!-- <module>sa-token-demo/sa-token-demo-solon</module> -->
</modules>

View File

@ -20,9 +20,9 @@
<!-- 所有子模块 -->
<modules>
<module>sa-token-core-test</module>
<!-- <module>sa-token-core-test</module> -->
<module>sa-token-springboot-test</module>
<module>sa-token-springboot-integrate-test</module>
<!-- <module>sa-token-springboot-integrate-test</module> -->
<module>sa-token-jwt-test</module>
</modules>
@ -43,4 +43,40 @@
</dependency>
</dependencies>
<build>
<plugins>
<!-- 单元测试报告生成 -->
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.6</version>
<executions>
<execution>
<id>prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report-aggregate</id>
<phase>test</phase>
<goals>
<goal>report-aggregate</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
<configuration>
<argLine>${argLine} -Xms256m -Xmx2048m</argLine>
<forkCount>1</forkCount>
<runOrder>random</runOrder>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@ -1,12 +0,0 @@
target/
node_modules/
bin/
.settings/
unpackage/
.classpath
.project
.factorypath
.idea/

View File

@ -1,29 +0,0 @@
<?xml version='1.0' encoding='utf-8'?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>cn.dev33</groupId>
<artifactId>sa-token-test</artifactId>
<version>${revision}</version>
<relativePath>../pom.xml</relativePath>
</parent>
<packaging>jar</packaging>
<name>sa-token-core-test</name>
<artifactId>sa-token-core-test</artifactId>
<description>sa-token-core-test</description>
<dependencies>
<dependency>
<groupId>cn.dev33</groupId>
<artifactId>sa-token-core</artifactId>
<version>${revision}</version>
</dependency>
</dependencies>
</project>

View File

@ -1,12 +0,0 @@
target/
node_modules/
bin/
.settings/
unpackage/
.classpath
.project
.factorypath
.idea/

View File

@ -1,29 +0,0 @@
<?xml version='1.0' encoding='utf-8'?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>cn.dev33</groupId>
<artifactId>sa-token-test</artifactId>
<version>${revision}</version>
<relativePath>../pom.xml</relativePath>
</parent>
<packaging>jar</packaging>
<name>sa-token-springboot-integrate-test</name>
<artifactId>sa-token-springboot-integrate-test</artifactId>
<description>sa-token-springboot-integrate-test</description>
<dependencies>
<dependency>
<groupId>cn.dev33</groupId>
<artifactId>sa-token-spring-boot-starter</artifactId>
<version>${revision}</version>
</dependency>
</dependencies>
</project>

View File

@ -22,6 +22,17 @@
<artifactId>sa-token-spring-boot-starter</artifactId>
<version>${revision}</version>
</dependency>
<!-- 冗余(生成单元测试报告) -->
<dependency>
<groupId>cn.dev33</groupId>
<artifactId>sa-token-servlet</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>cn.dev33</groupId>
<artifactId>sa-token-core</artifactId>
<version>${revision}</version>
</dependency>
</dependencies>
</project>

View File

@ -1,8 +1,10 @@
package cn.dev33.satoken.context.model;
package cn.dev33.satoken.core.context.model;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import cn.dev33.satoken.context.model.SaCookie;
/**
* SaFoxUtil 工具类测试
*

View File

@ -1,8 +1,10 @@
package cn.dev33.satoken.dao;
package cn.dev33.satoken.core.dao;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import cn.dev33.satoken.dao.SaTokenDao;
import cn.dev33.satoken.dao.SaTokenDaoDefaultImpl;
import cn.dev33.satoken.session.SaSession;
/**

View File

@ -1,8 +1,10 @@
package cn.dev33.satoken.fun;
package cn.dev33.satoken.core.fun;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import cn.dev33.satoken.fun.IsRunFunction;
/**
* IsRunFunction 测试
*

View File

@ -0,0 +1,4 @@
/**
* 核心包测试
*/
package cn.dev33.satoken.core;

View File

@ -1,8 +1,10 @@
package cn.dev33.satoken.secure;
package cn.dev33.satoken.core.secure;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import cn.dev33.satoken.secure.BCrypt;
/**
* BCrypt 加密测试
*

View File

@ -1,8 +1,10 @@
package cn.dev33.satoken.secure;
package cn.dev33.satoken.core.secure;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import cn.dev33.satoken.secure.SaBase64Util;
/**
* SaBase64Util 测试
*

View File

@ -1,8 +1,10 @@
package cn.dev33.satoken.secure;
package cn.dev33.satoken.core.secure;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import cn.dev33.satoken.secure.SaSecureUtil;
/**
* SaSecureUtil 加密工具类 测试
*

View File

@ -1,8 +1,10 @@
package cn.dev33.satoken.session;
package cn.dev33.satoken.core.session;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import cn.dev33.satoken.session.SaSession;
/**
* SaSession 测试
*

View File

@ -1,4 +1,4 @@
package cn.dev33.satoken.util;
package cn.dev33.satoken.core.util;
import java.util.Arrays;
import java.util.Date;
@ -7,6 +7,8 @@ import java.util.List;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import cn.dev33.satoken.util.SaFoxUtil;
/**
* SaFoxUtil 工具类测试
*

View File

@ -1,8 +1,10 @@
package cn.dev33.satoken.util;
package cn.dev33.satoken.core.util;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import cn.dev33.satoken.util.SaResult;
/**
* SaResult 结果集 测试
*

View File

@ -1,4 +1,4 @@
package com.pj.test;
package cn.dev33.satoken.integrate;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

View File

@ -1,4 +1,4 @@
package com.pj.test;
package cn.dev33.satoken.integrate;
import java.util.Map;
@ -15,7 +15,7 @@ import org.springframework.test.web.servlet.result.MockMvcResultMatchers;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import org.springframework.web.context.WebApplicationContext;
import com.pj.test.util.SoMap;
import cn.dev33.satoken.integrate.util.SoMap;
/**
* Sa-Token 登录API测试

View File

@ -1,4 +1,4 @@
package com.pj.test;
package cn.dev33.satoken.integrate;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

View File

@ -1,4 +1,4 @@
package com.pj.test.util;
package cn.dev33.satoken.integrate.util;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;

View File

@ -1,4 +1,4 @@
package com.pj.test;
package cn.dev33.satoken.springboot;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

View File

@ -1,4 +1,4 @@
package com.pj.test.satoken;
package cn.dev33.satoken.springboot.satoken;
import java.util.Arrays;
import java.util.List;