当前位置: 首页 > news >正文

大型网站开发框架有哪些做app价格

大型网站开发框架有哪些,做app价格,分销系统开发多少钱,网站的版面设计文章目录pom.xml 的配置#xff08;注意事项#xff0c;非常重要#xff09;测试案例执行测试命令surefire 插件配置pom.xml 的配置#xff08;注意事项#xff0c;非常重要#xff09; 1.必须引入 maven-surefire-plugin 插件#xff0c;否则无法使用 Maven 的测试功能… 文章目录pom.xml 的配置注意事项非常重要测试案例执行测试命令surefire 插件配置pom.xml 的配置注意事项非常重要 1.必须引入 maven-surefire-plugin 插件否则无法使用 Maven 的测试功能 2.maven-surefire-plugin 插件只支持 junit-jupiter-api 构件不支持 junit 构件 所以在 pom.xml 文件关于测试的配置内容如下 dependencies!-- 必须使用junit-jupiter-api构件测试注解、断言都源于此构件--dependencygroupIdorg.junit.jupiter/groupIdartifactIdjunit-jupiter-api/artifactIdversion5.8.2/versionscopetest/scope/dependency/dependenciesbuildpluginManagementplugins!-- 必须显式的声明测试插件否则无法执行测试 --plugingroupIdorg.apache.maven.plugins/groupIdartifactIdmaven-surefire-plugin/artifactIdversion3.0.0-M5/version/pluginplugingroupIdorg.apache.maven.plugins/groupIdartifactIdmaven-compiler-plugin/artifactIdconfigurationsource1.9/sourcetarget1.9/targetencodingUTF-8/encoding/configuration/plugin/plugins/pluginManagement/build测试案例 如果要使用 Maven 的批量测试功能只能把测试用例写在 src/test/java 目录下的源代码文件中。 首先在 src/main/java 下创建一个简单的被测试的类类的代码如下 public class HelloMaven {public int add(int a, int b) {return a b;}public int subtract(int a, int b) {return a - b;} }接着在 src/test/java 目录下创建测试用例即用于测试的类代码如下 package com.example.demo02;import org.junit.Assert; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test;/*** description** author liaowenxiong* date 2022/1/28 08:18*/public class HelloMavenTest {private HelloMaven hm;BeforeEachpublic void setUp() {hm new HelloMaven();}Testpublic void testAdd() throws InterruptedException {int a 1;int b 2;int result hm.add(a, b);Assert.assertEquals(a b, result);}Testpublic void testSubtract() throws InterruptedException {int a 1;int b 2;int result hm.subtract(a, b);Assert.assertEquals(a - b, result);}AfterEachpublic void tearDown() throws Exception {System.out.println(测试结束了);} }执行测试命令 测试用例写好之后就要执行测试的命令可以通过以下几种方式执行测试的命令。 第一种命令终端 打开命令终端切换到 pom.xml 所在目录下执行命令 mvn test。执行命令 mvn test表示执行到构件生命周期的 test 阶段之前的阶段都会自动执行。执行 mvn test 命令的过程如下 [~/Documents/IdeaProjects/struts2-demo01]$ mvn test [INFO] Scanning for projects... [INFO] [INFO] ------------------ priv.lwx.struts2:struts2-demo01 ------------------- [INFO] Building struts2-demo01 Maven Webapp 1.0-SNAPSHOT [INFO] --------------------------------[ war ]--------------------------------- [INFO] [INFO] --- maven-resources-plugin:3.0.2:resources (default-resources) struts2-demo01 --- [INFO] Using UTF-8 encoding to copy filtered resources. [INFO] Copying 2 resources [INFO] [INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) struts2-demo01 --- [INFO] Nothing to compile - all classes are up to date [INFO] [INFO] --- maven-resources-plugin:3.0.2:testResources (default-testResources) struts2-demo01 --- [INFO] Using UTF-8 encoding to copy filtered resources. [INFO] skip non existing resourceDirectory /Users/liaowenxiong/Documents/IdeaProjects/struts2-demo01/src/test/resources [INFO] [INFO] --- maven-compiler-plugin:3.8.0:testCompile (default-testCompile) struts2-demo01 --- [INFO] Nothing to compile - all classes are up to date [INFO] [INFO] --- maven-surefire-plugin:2.22.1:test (default-test) struts2-demo01 --- [INFO] [INFO] ------------------------------------------------------- [INFO] T E S T S [INFO] ------------------------------------------------------- [INFO] Running priv.lwx.struts2.util.ConnectionUtilsTest 配置文件路径/Users/liaowenxiong/Documents/IdeaProjects/struts2-demo01/target/classes/db_config.properties Loading class com.mysql.jdbc.Driver. This is deprecated. The new driver class is com.mysql.cj.jdbc.Driver. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary. com.mysql.cj.jdbc.ConnectionImpl221a3fa4 [INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.954 s - in priv.lwx.struts2.util.ConnectionUtilsTest [INFO] [INFO] Results: [INFO] [INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0 [INFO] [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 4.345 s [INFO] Finished at: 2022-02-07T13:00:5008:00 [I;NFO] ------------------------------------------------------------------------第二种Maven 操作窗口 选择生命周期的 test 阶段点击上面的绿色三角图标。 第三种Maven Goal 的窗口中执行 第四种IDEA内置的命令终端窗口 这里要特别注意如果只是执行命令 mvn surefire:test那么之前的生命周期阶段是不会自动执行的也就是说主代码不会被构建测试代码也不会被构建而是执行测试的指令因为执行命令 mvn surefire:test 表示只执行 surefire 插件的 test 目标而已执行命令过程如下 [~/Documents/IdeaProjects/struts2-demo01]$ mvn surefire:test [INFO] Scanning for projects... [INFO] [INFO] ------------------ priv.lwx.struts2:struts2-demo01 ------------------- [INFO] Building struts2-demo01 Maven Webapp 1.0-SNAPSHOT [INFO] --------------------------------[ war ]--------------------------------- [INFO] [INFO] --- maven-surefire-plugin:2.22.1:test (default-cli) struts2-demo01 --- [INFO] [INFO] ------------------------------------------------------- [INFO] T E S T S [INFO] ------------------------------------------------------- [INFO] Running priv.lwx.struts2.util.ConnectionUtilsTest 配置文件路径/Users/liaowenxiong/Documents/IdeaProjects/struts2-demo01/target/classes/db_config.properties Loading class com.mysql.jdbc.Driver. This is deprecated. The new driver class is com.mysql.cj.jdbc.Driver. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary. com.mysql.cj.jdbc.ConnectionImpl221a3fa4 [INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.855 s - in priv.lwx.struts2.util.ConnectionUtilsTest [INFO] [INFO] Results: [INFO] [INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0 [INFO] [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 3.477 s [INFO] Finished at: 2022-02-07T12:54:5408:00 [INFO] ------------------------------------------------------------------------surefire 插件配置 plugingroupIdorg.apache.maven.plugins/groupIdartifactIdmaven-surefire-plugin/artifactIdversion3.0.0-M5/versionconfigurationexcludes!-- 测试时排除指定的文件 --exclude**/TestConstants.java/exclude/excludes!-- Maven运行测试用例时是通过调用maven的surefire插件并fork一个子进程来执行用例的。forkmode属性中指明是要为每个测试创建一个进程还是所有测试在同一个进程中完成。 forkMode 可设置值有 “never” “once” “always” 和 “pertest”。 never不创建子进程once在一个进程中进行所有测试。once为默认设置在Hudson上持续回归时建议使用默认设置。 pretest 每一个测试(测试用例/测试类)创建一个新进程为每个测试创建新的JVM是单独测试的最彻底方式但也是最慢的不适合hudson上持续回归 always在一个进程中并行的运行脚本即测试方法Junit4.7以上版本才可以使用surefire的版本要在2.6以上提供这个功能其中 threadCount执行时指定可分配的线程数量。只和参数parallel配合使用有效。默认5。 --forkModealways/forkModeparallelmethods/parallelthreadCount4/threadCount/configuration /plugin补充 The parameter forkMode is deprecated since version 2.14. Use forkCount and reuseForks instead. 在 2.14 版本之后forkMode 不再使用改成 forkCount 或者 reuseForks。 forkCount选项指定并行分叉以执行测试的VM数量。当以“C”终止时数字部分乘以CPU核数。浮点值只能与“C”一起接受。如果设置为“0”则不会分叉任何VM所有测试都在主进程内执行。 forkCount4/forkCount forkCount1.5C/forkCountreuseForks指示是否可以重用分叉的VM。如果设置为“false”则为每个要执行的测试类派生一个新的VM。如果设置为“true”则最多会对forkCount虚拟机进行分叉然后重新使用以执行所有测试。 reuseForkstrue/reuseForks plugingroupIdorg.apache.maven.plugins/groupIdartifactIdmaven-surefire-plugin/artifactIdversion3.0.0-M5/versionconfigurationreuseForkstrue/reuseForksforkCount4/forkCount/configuration /plugin参见https://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#forkCount
http://www.pierceye.com/news/930947/

相关文章:

  • 电脑十大免费游戏网站万能搜索引擎入口
  • 菏泽网站建设公司排名有没有专做推广小说的网站
  • 东莞网站建设搭建因酷网站建设
  • 连云港百度推广网站建设ph域名网站
  • 网站建设营销模板网站开发招聘职位
  • 如何做网站的教程网站怎么建设以及维护
  • 信息港发布信息怎么做网站优化
  • 网页广告怎么关闭网站seo的主要优化内容
  • server2012做网站免费的图片做视频在线观看网站
  • 石狮网站建设折扣网站模板
  • 大连商城网站制作公司深圳网站改版公司
  • 网站备案需要的资料网站+做内容分发资格
  • 青岛模板自助建站百度怎么搜索图片
  • 国外做动运服装的网站安徽海通建设集团网站
  • 手机网站加百度商桥装修公司加盟免费
  • 网站开发背景知识wordpress第二步500
  • 114百事通做网站600郑州建站时间
  • 佛山网站建设科技公司南宁网页设计价格
  • 四字母net做网站怎么样如何开通微信小程序商城
  • 山西免费网站关键词优化排名婚恋网站开发
  • seo查询站长手机app制作网站模板
  • 微网站O2O平台平台开发怎么申请免费的网站
  • 加强网站互动交流平台建设自查p2p网站建设制作
  • 泉州网站建设平台成都百度seo公司
  • php响应式网站模板下载陕西建设集团招聘信息网站
  • 网站品牌推广设计网站建设单页
  • 秦皇岛酒店网站设计wordpress 退出 跳转
  • 网站建设题目以及答案济南建设公司网站
  • 有什么网站做的比较高大上网站首页怎么设计
  • 法治中国建设网站做网站推广 需要ftp