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

顺义做网站公司阜阳市住房和城乡建设部网站

顺义做网站公司,阜阳市住房和城乡建设部网站,做网站赚钱吗 谁教教我,重庆网站建站我为Maven创建了一个示例Groovy项目#xff0c;该项目在一个项目中混合了Spock测试和JUnit 5测试。 在下一节中#xff0c;我将描述如何设置这种Maven项目。 在项目中启用Groovy 首先#xff0c;您必须在项目中启用Groovy。 一种可能性是将GMavenPlus插件添加到您的项目中。… 我为Maven创建了一个示例Groovy项目该项目在一个项目中混合了Spock测试和JUnit 5测试。 在下一节中我将描述如何设置这种Maven项目。 在项目中启用Groovy 首先您必须在项目中启用Groovy。 一种可能性是将GMavenPlus插件添加到您的项目中。 build plugins plugin groupId org.codehaus.gmavenplus/ groupId artifactId gmavenplus-plugin/ artifactId version 1.6.2/ version executions execution goals goal addSources/ goal goal addTestSources/ goal goal compile/ goal goal compileTests/ goal / goals / execution / executions / plugin / plugins / build 目标addSources和addTestSources将Groovy测试源添加到Maven的主要测试源。 默认位置是src / main / groovy 对于主源和src / test / groovy 对于测试源。 目标编译和compileTests编译Groovy测试代码。 如果您没有Groovy主代码则可以省略addSource和compile 。 上面的配置始终使用最新发布的Groovy版本。 如果要确保使用特定的Groovy版本则必须将特定的Groovy依赖项添加到类路径中。 dependencies dependency groupId org.codehaus.groovy/ groupId artifactId groovy/ artifactId version 2.5.6/ version / dependency / dependencies 在项目中启用JUnit 5 在项目中使用JUnit 5的最简单设置是在测试类路径中添加JUnit Jupiter依赖关系并配置正确版本的Maven Surefire插件至少为2.22.0版。 dependencies !--... maybe more dependencies -- dependency groupId org.junit.jupiter/ groupId artifactId junit-jupiter/ artifactId scope test/ scope / dependency / dependencies dependencyManagement dependencies dependency groupId org.junit/ groupId artifactId junit-bom/ artifactId version ${junit.jupiter.version}/ version scope import/ scope type pom/ type / dependency / dependencies / dependencyManagement build plugins !-- other plugins -- plugin artifactId maven-surefire-plugin/ artifactId version 2.22.1/ version / plugin / plugins / build 在项目中启用Spock 选择正确的Spock依赖项取决于您在项目中使用的Groovy版本。 在我们的例子中是Groovy 2.5版。 因此我们在测试类路径中需要版本1.x-groovy-2.5的Spock。 dependencies !-- more dependencies -- dependency groupId org.spockframework/ groupId artifactId spock-core/ artifactId version 1.3-groovy-2.5/ version scope test/ scope / dependency / dependencies 现在期望Spock测试和JUnit5测试在Maven构建中执行。 但是Maven只执行JUnit5测试。 所以发生了什么事 我开始将Maven Surefire插件版本更改为2.21.0。 然后执行了Spock测试但没有执行JUnit5测试。 原因是在Maven Surefire插件的2.22.0版本中默认情况下JUnit Platform Provider替换了JUnit4 provider。 但是版本1.x中的Spock基于JUnit4。 这将在Spock版本2中进行更改。此版本将基于JUnit5平台。 因此对于Spock 1.x我们必须将JUnit Vintage依赖项添加到测试类路径中。 dependencies !-- more dependencies -- dependency !--Only necessary for surefire to run spock tests during the maven build -- groupId org.junit.vintage/ groupId artifactId junit-vintage-engine/ artifactId scope test/ scope / dependency / dependencies 这允许在JUnit平台上运行较早的JUnit3/4测试。 使用此配置Spock和JUnit 5测试都在Maven构建中执行。 链接 Groovy的示例Maven设置包括Github上的JUnit 5和Spock Maven GMaven Plus插件 Maven Surefire插件–使用JUnit 5平台 JUnit 5用户指南 Spock框架 翻译自: https://www.javacodegeeks.com/2019/03/maven-project-setup-mixing-spock-junit-5-tests.html
http://www.yutouwan.com/news/502282/

相关文章:

  • 东莞公司网站制作网络整合营销策划书
  • 宜春住房和城乡建设部网站798艺术区
  • 惠州网站制作找哪家it外包公司怎么样
  • 河北住房和城乡建设厅网站首页网站建设需要服务器支持 吗
  • 產品定制网站开发做一个商品网站多少钱
  • 长沙市网站建设公司网婚纱摄影网站设计模板
  • 怎么用记事本做钓鱼网站全国最新实时大数据
  • 如何优化网站内容做网站后台需要什么
  • 建设网游小说沈阳网站建设seo优化
  • 网站建设有哪些模块农村办厂暴利项目
  • 制作视频网站建设wordpress 获取父分类
  • 网站优化沈阳企业网站
  • 企业门户网站免费模板中企动力科技怎么样
  • 惠州营销网站制作免费个人网站源码php
  • 网站建设介绍ppt网站开发常用模板
  • 创可贴网站怎么做图片免费漫画网站
  • 大连seo网站wordpress 数据库名贵
  • 如何用手机做网站吗315网站专题怎么做
  • 如何进行网站关键词优化wordpress删除月份归档
  • 上海市做网站公司海南省建设厅官方网站
  • 源码下载网站cms兰州网页设计
  • 手机做ppt的免费模板下载网站网站开发的职业规划
  • 网站建设平台多少钱免费开网店
  • 外贸网站产品做网站用的hu软件
  • 寿光网站建设推广邯郸市天气预报
  • 兴义城乡建设部网站文化网站前置审批
  • 网站优化网站建设天河区网站公司
  • 图片生成网站如何在百度上做网站
  • 顺义公司建站多少钱网页版微信登录不了怎么解决
  • 网站建设微信软文手机端wordpress怎么用