[INFO] Scanning for projects...
[INFO]
......
[INFO]
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running MyJavaFXAppTest
1234567890 is exists
1234567890 is exists
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 16.713 s - in MyJavaFXAppTest
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ StockManagementSystem ---
[INFO] Building jar: D:\soft\src\StockManagementSystem\target\StockManagementSystem-1.0-SNAPSHOT.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 20.300 s
[INFO] Finished at: 2024-05-16T17:22:37+08:00
[INFO] ------------------------------------------------------------------------
生成结果如下:
打开surefire-reports文件夹
2024-05-16T17-22-19_163.dumpstream内容
# Created at 2024-05-16T17:22:19.465
Boot Manifest-JAR contains absolute paths in classpath 'D:\ProgramData\.m2\repository\org\apache\maven\surefire\surefire-booter\3.0.0-M5\surefire-booter-3.0.0-M5.jar'
Hint: <argLine>-Djdk.net.URLClassPath.disableClassPathURLCheck=true</argLine>
MyJavaAppTest.txt
-------------------------------------------------------------------------------
Test set: MyJavaAppTest
-------------------------------------------------------------------------------
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 16.713 s - in MyJavaAppTest
TEST-MyJavaAppTest.xml
<?xml version="1.0" encoding="UTF-8"?>
<testsuite xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://maven.apache.org/surefire/maven-surefire-plugin/xsd/surefire-test-report-3.0.xsd" version="3.0" name="MyJavaAppTest" time="16.713" tests="2" errors="0" skipped="0" failures="0">
<properties>
<property name="sun.desktop" value="windows"/>
<property name="awt.toolkit" value="sun.awt.windows.WToolkit"/>
<property name="file.encoding.pkg" value="sun.io"/>
<property name="java.specification.version" value="1.8"/>
<property name="javafx.runtime.version" value="8.0.131-b11"/>
<property name="sun.cpu.isalist" value="amd64"/>
<property name="sun.jnu.encoding" value="GBK"/>
<property name="java.class.path" value="......"/>
<property name="java.vm.vendor" value="Oracle Corporation"/>
<property name="sun.arch.data.model" value="64"/>
<property name="user.variant" value=""/>
<property name="java.vendor.url" value="http://java.oracle.com/"/>
<property name="user.timezone" value="Asia/Shanghai"/>
<property name="java.vm.specification.version" value="1.8"/>
<property name="os.name" value="Windows 7"/>
<property name="javafx.version" value="8.0.131"/>
<property name="user.country" value="CN"/>
<property name="sun.java.launcher" value="SUN_STANDARD"/>
<property name="sun.boot.library.path" value="D:\soft\jdk1.8.0_131\jre\bin"/>
<property name="sun.java.command" value="......"/>
<property name="surefire.test.class.path" value="......"/>
<property name="sun.cpu.endian" value="little"/>
<property name="user.home" value="C:\Users\Administrator"/>
<property name="user.language" value="zh"/>
<property name="java.specification.vendor" value="Oracle Corporation"/>
<property name="java.home" value="D:\soft\jdk1.8.0_131\jre"/>
<property name="basedir" value="D:\soft\src\LibraryManagementSystem"/>
<property name="style.color" value="always"/>
<property name="file.separator" value="\"/>
<property name="line.separator" value=" "/>
<property name="java.vm.specification.vendor" value="Oracle Corporation"/>
<property name="java.specification.name" value="Java Platform API Specification"/>
<property name="java.awt.graphicsenv" value="sun.awt.Win32GraphicsEnvironment"/>
<property name="surefire.real.class.path" value="......"/>
<property name="sun.boot.class.path" value="......"/>
<property name="user.script" value=""/>
<property name="sun.management.compiler" value="HotSpot 64-Bit Tiered Compilers"/>
<property name="java.runtime.version" value="1.8.0_131-b11"/>
<property name="user.name" value="Administrator"/>
<property name="path.separator" value=";"/>
<property name="os.version" value="6.1"/>
<property name="java.endorsed.dirs" value="D:\soft\jdk1.8.0_131\jre\lib\endorsed"/>
<property name="java.runtime.name" value="Java(TM) SE Runtime Environment"/>
<property name="file.encoding" value="GBK"/>
<property name="java.vm.name" value="Java HotSpot(TM) 64-Bit Server VM"/>
<property name="localRepository" value="D:\ProgramData\.m2\repository"/>
<property name="java.vendor.url.bug" value="http://bugreport.sun.com/bugreport/"/>
<property name="java.io.tmpdir" value="C:\Users\ADMINI~1\AppData\Local\Temp\"/>
<property name="java.version" value="1.8.0_131"/>
<property name="user.dir" value="D:\soft\src\LibraryManagementSystem"/>
<property name="os.arch" value="amd64"/>
<property name="java.vm.specification.name" value="Java Virtual Machine Specification"/>
<property name="java.awt.printerjob" value="sun.awt.windows.WPrinterJob"/>
<property name="sun.os.patch.level" value="Service Pack 1"/>
<property name="java.library.path" value="......"/>
<property name="java.vm.info" value="mixed mode"/>
<property name="java.vendor" value="Oracle Corporation"/>
<property name="java.vm.version" value="25.131-b11"/>
<property name="java.ext.dirs" value="D:\soft\jdk1.8.0_131\jre\lib\ext;C:\Windows\Sun\Java\lib\ext"/>
<property name="sun.io.unicode.encoding" value="UnicodeLittle"/>
<property name="java.class.version" value="52.0"/>
</properties>
<testcase name="BM_Add_001(FxRobot)" classname="MyJavaAppTest" time="9.146">
<system-out><![CDATA[test
1234567890 is exists
]]></system-out>
</testcase>
<testcase name="BM_Add_002(FxRobot)" classname="MyJavaAppTest" time="7.545">
<system-out><![CDATA[test
1234567890 is exists
]]></system-out>
</testcase>
</testsuite>
不过这看起来很不友好,我想应该有方法生成html界面,还真被我找到了。
生成HTML报告:虽然Surefire Plugin本身不直接生成HTML报告,但你可以使用maven-surefire-report-plugin
来生成HTML格式的报告。执行以下Maven命令来生成HTML报告:
mvn surefire-report:report
D:\soft\src\StockManagementSystem>mvn surefire-report:report
[INFO] Scanning for projects...
[INFO]
......
[INFO]
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running MyJavaAppTest
1234567890 is exists
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 16.87 s -
in MyJavaAppTest
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO]
[INFO] <<< maven-surefire-report-plugin:3.2.5:report (default-cli) < [surefire]t
est @ StockManagementSystem <<<
[INFO]
[INFO]
[INFO] --- maven-surefire-report-plugin:3.2.5:report (default-cli) @ StockManagementSystem ---
[INFO] Rendering content with org.apache.maven.skins:maven-default-skin:jar:1.3
skin.
[WARNING] Unable to locate Test Source XRef to link to - DISABLED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 20.002 s
[INFO] Finished at: 2024-05-16T17:41:49+08:00
[INFO] ------------------------------------------------------------------------
这将在target/site/surefire-report.html
生成一个HTML报告,你可以用浏览器打开这个文件来浏览更易读的测试结果。
集成至CI/CD工具:如果你的项目集成到了Jenkins、GitLab CI/CD或其他持续集成工具中,这些工具通常可以直接解析Surefire的XML报告,并提供图形化的测试结果概览。
1. -------------------------------------------------------
2. T E S T S
3. -------------------------------------------------------
4. Running com
<groupId>io.qameta.allure</groupId>
<artifactId>allure-maven</artifactId>
<version>2.9</version>
</plugin>
mvn clean test -运行测试
您可以使用以下命令之一生成报告:
mvn allure:serve
报告将生成到temp文件夹中。 具有结果的Web服务器将启动。
mvn allure:report
报告将在以下目录中生成: target/site/allure-maven/index.html
您可以像以下配置诱人版本:
<plugin>
<groupId>io.qameta.allure</gr
在新建maven包pom文件中引入三个测试报告
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http:/...
自动化测试时,
Maven工程中单元测试
生成测试报告,使用TestNg单元测试框架时,
测试报告默认
生成在target\
surefire-re
ports目录下。例如,pom.xml文件中部分配置:
<dependencies>
<dependency>
<groupId>org.testng</groupId>
本文主要简述了extent-report在maven项目中的使用,以下内容将默认项目是maven项目,项目中已存在可以执行的测试方法,且本文配置xml文件作为执行测试方法的执行入口,主要用于保存记忆,留待日后查阅~~~~~~
-----------------------------------以下是正文-----------------------------
第一步:先在ma...
eclipse项目里javascript总是验证,且出现最多的error是 "Description Resource Path Location Type Syntax error on toke
12926
MySQL Workbench Failed to Connect to MySQL at 127.0.0.1:3306 with user root Bad handshake
12323
解决python -m pip install --upgrade pip更新失败
Python的22个常用模块
CodeWhisperer:
MySQL常用语句
CSDN-Ada助手: