- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在制作一个 java 项目的框架; gradle 构建文件有一个烦人的问题:测试运行了两次,一次由任务“JUnitPlatformTest”运行,第二次由任务“test”运行。
第一个似乎触发了第二个,所以我不能禁用它,我想保留第二个,因为它们之间有一点不同:第一个在控制台(intelliJ)中,第二种使用集成的 intelliJ 窗口。
这里是gradle.build
buildscript {
repositories {
mavenCentral()
mavenLocal()
}
dependencies {
classpath 'org.junit.platform:junit-platform-gradle-plugin:1.0.3'
classpath group: 'de.dynamicfiles.projects.gradle.plugins', name: 'javafx-gradle-plugin', version: '8.8.2'
classpath 'eu.appsatori:gradle-fatjar-plugin:0.3'
}
}
plugins {
id 'java'
id 'edu.sc.seis.launch4j' version '2.4.4'
}
apply plugin: 'org.junit.platform.gradle.plugin'
apply plugin: 'javafx-gradle-plugin'
apply plugin: 'eu.appsatori.fatjar'
junitPlatform {
platformVersion '1.0.3'
reportsDir file('build/test-results/junit-platform')
enableStandardTestTask true
//show results summary even on success.
details details.SUMMARY
filters {
tags {
// Framework tests need to be run only when required to verify that this framework is still working.
exclude "Framework"
}
includeClassNamePatterns '.*Test', '.*Tests'
}
}
group 'lorry'
version '1'
sourceCompatibility = 1.8
//mainClassName="imports.ColorfulCircles"
repositories {
mavenCentral()
mavenLocal()
}
dependencies {
def final junitVersion = "5.2.0"
compile group: 'com.google.inject', name: 'guice', version: '4.1.0'
compile group: 'com.google.code.gson', name: 'gson', version: '2.8.2'
compile group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: junitVersion
//compile group: 'org.seleniumhq.selenium', name: 'selenium-java', version: '3.11.0'
compile group: 'org.assertj', name: 'assertj-core', version: '3.9.0'
compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.7'
testCompile group: 'org.junit.jupiter', name: 'junit-jupiter-params', version: junitVersion
testCompile group: 'org.mockito', name: 'mockito-core', version: '2.7.22'
testRuntime group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: junitVersion
compile 'org.hamcrest:hamcrest-all:1.3'
testCompile "org.testfx:testfx-core:4.0.13-alpha"
testCompile 'org.testfx:testfx-junit5:4.0.13-alpha'
testRuntime 'org.testfx:openjfx-monocle:8u60-b27'
}
test {
useJUnitPlatform()
jvmArgs = [
"-Dtestfx.robot=glass",
"-Dtestfx.headless=true",
"-Dprism.order=sw",
"-Dprism.text=t2k",
"-Dheadless.geometry=1920x1200-32"
]
}
test.dependsOn 'clean'
jfx {
// minimal requirement for jfxJar-task
mainClass = 'imports.ColorfulCircles'
// minimal requirement for jfxNative-task
vendor = 'lolveley'
}
jar {
baseName = 'executable3'
version = ''
manifest {
attributes(
'Class-Path': configurations.compile.collect { it.getName() }.join(' '),
'Main-Class': 'imports.ColorfulCircles'
)
}
}
launch4j {
outfile='bibliotek-v3.exe'
mainClassName = 'imports.ColorfulCircles'
icon = "${projectDir}\\icons\\hands2.ico"
copyConfigurable = project.tasks.fatJar.outputs.files
jar = "lib/${project.tasks.fatJar.archiveName}"
//headerType = "console"
//jar = "${buildDir}\\productFatJar\\fat.jar"
}
junitPlatformTest {
jvmArgs = [
"-Dtestfx.robot=glass",
"-Dtestfx.headless=true",
"-Dprism.order=sw",
"-Dprism.text=t2k",
"-Dheadless.geometry=1920x1200-32"
]
}
结果如下:
Testing started at 19:25 ...
19:25:01: Executing task 'test'...
> Task :compileJava
> Task :processResources NO-SOURCE
> Task :classes
> Task :clean
> Task :compileTestJava
> Task :processTestResources NO-SOURCE
> Task :testClasses
> Task :junitPlatformTest
constructeur appelé
Before all
Before each
my test 1
Before each
my test 2
This test method should be run
Test run finished after 3630 ms
[ 4 containers found ]
[ 0 containers skipped ]
[ 4 containers started ]
[ 0 containers aborted ]
[ 4 containers successful ]
[ 0 containers failed ]
[ 7 tests found ]
[ 0 tests skipped ]
[ 7 tests started ]
[ 0 tests aborted ]
[ 7 tests successful ]
[ 0 tests failed ]
> Task :test
constructeur appelé
Before all
Before each
my test 1
Before each
my test 2
This test method should be run
BUILD SUCCESSFUL in 13s
5 actionable tasks: 5 executed
19:25:15: Task execution finished 'test'.
最佳答案
根据 this official website , ...
The JUnit Platform Gradle Plugin is deprecated
The very basic
junit-platform-gradle-plugin
developed by the JUnit team was deprecated in JUnit Platform 1.2 and will be discontinued in 1.3. Please switch to Gradle’s standard test task.
所以你应该从你的构建文件中删除这个插件,如果有必要,尝试将剩余的设置移植到 java
插件的 test
任务。
关于testing - 渐变 : java tests ran twice,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52102536/
我不知道该在标题中添加什么内容,但我有以下代码: @Controller public class WorkdayAddController { @Autowired private WorkdayR
已编辑:我需要用户按其全局进度 [order by avg(progression) DESC] 以及按进度排序的详细信息行进行排序。 示例: USER 1 campaign 1 progressio
我知道这是一个更“沉重”的问题,但我认为它也很有趣。它是 of my previous questions about compiler functions 的一部分, 但回过头来我解释得非常糟糕,许
我有一个函数(表单中的事件处理程序)结构如下: Dim errMsg as String = "" CheckIfValidUser(..., errMsg) If errMsg.Length > 0
我正在为客户正在举办的事件创建注册表。基本的用户详细信息被提交到第三方系统(即姓名、电子邮件等),但其余字段需要通过电子邮件发送给客户。 我需要这样的事情发生: 列出项目 用户填写表单 jquery
我有一个ClassLoader,它从源文件加载由JavaCompiler编译的类。但是当我更改源文件、保存它并重新编译它时,ClassLoader 仍然加载该类的第一个版本。 ClassLoad
我有一个使用 Kotlin 编写的 RecognitionListener 的项目。语音转文本功能一直很成功,从未出现任何问题。 从上周开始,它的 onResult 函数开始被调用两次。该项目没有进行
大家好(和圣诞快乐) 希望有人能回答我的问题,那将是一个美好的圣诞节 礼物。 我的 UIViewController 一个表,在表部分区域中有一个分段控件。看起来像这样 每次用户单击分段控件时,我都会
我正在制作一个程序,输入三个数字,然后计算一些不同的东西(每个东西都必须有自己的函数)。该程序首先告诉用户他们的选择并等待他们的输入。执行任何情况后,程序将再次打印菜单,除非它将使用默认情况,然后它将
我的 Android 应用程序有一个自定义接收器,如下所示: public class CustomReceiver extends BroadcastReceiver{ String URL; St
我有一系列带日期的事件,如下所示: 事件 1,2014 年 1 月 1 日 事件 2,2014 年 1 月 2 日 事件 3,2014 年 1 月 3 日 假设我想要按时间顺序排列的最近两个事件。如果
我对 jQuery“切换”方法有一个神秘的问题。我单击它一次,但它会设置两次动画。你自己去看看吧! Demo 页面源码贴在下面,(解决后链接会消失) html: About us S
我对Python完全陌生,当我遇到这个问题时,我正在尝试线程模块:-线程由于某种原因运行两次,我不知道为什么。我到处寻找,但没有找到任何答案。希望我能在这里得到一些帮助 import time fro
先决条件:无障碍对讲开启。 问题:当从软键盘向编辑文本输入字符时,字符被读出两次。(我想一次是通过键盘,一次是通过编辑文本)。 最佳答案 问题:视力正常的用户不能很好地理解/理解盲人用户需要的信息类型
我的问题是,当我再次对相同的值进行评分时,它不会响应第二次..这意味着当我第一次评分为“4”时,我不能将其评分为“4”第二次..只有当我评价其他值而不是'4'时它才会响应。 这是我尝试过的(我的代码中
我必须设计一个问卷系统。我们一直在讨论很多事情,包括如何持有答案,以及如何持有可能的答案。现在,尽管我不同意,但我还是屈服于我的同事。我只想知道您对此的看法以及原因。对我来说,两次保存相同的信息是一个
我将 Angular2 与路由一起使用,我的页面在初始加载时显示重复内容。单击任何链接(Page1 或 Page2)后,一切正常(不再有重复内容)。为什么我在初始加载时得到重复的内容以及我需要什么才能
我用KTX。。我有以下代码:。为什么它显示了两次?我该如何解决这个问题呢?。。预计“点击开始游戏”的标签只会显示一次。。我试着删除了代码。但它还是发生了。。然后,我尝试删除Add(LoadingSta
现象说明 maven的java项目,测试用例和main所在的源码文件均符合缺省写法和格式,但是在使用mvn clean sonar:sonar进行编译时提示can't be indexed twi
我使用 React 创建了一个简单的 Meteor 应用程序。它使用名为 client 的文件夹中的三个文件(没有其他文件)。在控制台中,应用程序打印出: withTracker rendering
我是一名优秀的程序员,十分优秀!