mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[gui-test] major param suites changes (2)
This commit is contained in:
+8
-9
@@ -15,11 +15,14 @@ import org.junit.runner.notification.RunNotifier
|
||||
import org.junit.runners.Suite
|
||||
import org.junit.runners.model.RunnerBuilder
|
||||
|
||||
open class GuiTestSuiteRunner(private val suiteClass: Class<*>, private val builder: RunnerBuilder, val optionalName: String? = null) : Suite(suiteClass, builder) {
|
||||
open class GuiTestSuiteRunner(private val suiteClass: Class<*>, private val builder: RunnerBuilder) : Suite(suiteClass, builder) {
|
||||
|
||||
//IDE type to run suite tests with
|
||||
var isFirstStart: Boolean = true
|
||||
|
||||
@Volatile
|
||||
var customName: String? = null
|
||||
|
||||
protected val myIde: Ide = getIdeFromAnnotation(suiteClass)
|
||||
protected val UNDEFINED_FIRST_CLASS = "undefined"
|
||||
protected val myFirstStartClassName: String by lazy {
|
||||
@@ -30,14 +33,14 @@ open class GuiTestSuiteRunner(private val suiteClass: Class<*>, private val buil
|
||||
private val LOG: Logger = org.apache.log4j.Logger.getLogger("#com.intellij.testGuiFramework.framework.GuiTestSuiteRunner")!!
|
||||
|
||||
private val testsFilter by lazy {
|
||||
object: Filter() {
|
||||
object : Filter() {
|
||||
|
||||
val filteredClassNameSet: Set<String> by lazy {
|
||||
GuiTestOptions.filteredListOfTests.split(",").toSet()
|
||||
}
|
||||
|
||||
override fun shouldRun(description: Description?): Boolean {
|
||||
description?: return true
|
||||
description ?: return true
|
||||
return filteredClassNameSet.contains(description.testClass.simpleName)
|
||||
}
|
||||
|
||||
@@ -57,16 +60,12 @@ open class GuiTestSuiteRunner(private val suiteClass: Class<*>, private val buil
|
||||
}
|
||||
}
|
||||
|
||||
protected open fun createGuiTestLocalRunner(testClass:Class<*>, suiteClass:Class<*>, myIde: Ide): GuiTestLocalRunner {
|
||||
protected open fun createGuiTestLocalRunner(testClass: Class<*>, suiteClass: Class<*>, myIde: Ide): GuiTestLocalRunner {
|
||||
return GuiTestLocalRunner(testClass, suiteClass, myIde)
|
||||
}
|
||||
|
||||
override fun getName(): String {
|
||||
if (optionalName == null) {
|
||||
return super.getName()
|
||||
} else {
|
||||
return optionalName
|
||||
}
|
||||
return customName ?: super.getName()
|
||||
}
|
||||
|
||||
override fun runChild(runner: Runner, notifier: RunNotifier?) {
|
||||
|
||||
-1
@@ -2,7 +2,6 @@
|
||||
package com.intellij.testGuiFramework.framework.param
|
||||
|
||||
import com.intellij.testGuiFramework.framework.FirstStartWith
|
||||
import com.intellij.testGuiFramework.framework.GuiTestLocalRunner
|
||||
import com.intellij.testGuiFramework.framework.getIdeFromAnnotation
|
||||
import com.intellij.testGuiFramework.launcher.GuiTestLocalLauncher
|
||||
import com.intellij.testGuiFramework.launcher.GuiTestOptions
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ class GuiTestsParametersRunnerFactory : ParametersRunnerFactory {
|
||||
|
||||
override fun createRunnerForTestWithParameters(test: TestWithParameters?): Runner {
|
||||
test ?: throw Exception("Unable to build runner for a NULL test")
|
||||
return GuiTestSuiteRunner(test.testClass.javaClass, createRunnerBuilder(test), "parameters: [${test.parameters[0]}]")
|
||||
return GuiTestSuiteRunner(test.testClass.javaClass, createRunnerBuilder(test)).apply { customName = "parameters: [${test.parameters[0]}]" }
|
||||
}
|
||||
|
||||
private fun createRunnerBuilder(test: TestWithParameters): CustomRunnerBuilder {
|
||||
|
||||
@@ -73,12 +73,7 @@ open class GuiTestCase {
|
||||
|
||||
@Rule
|
||||
@JvmField
|
||||
val guiTestRule = GuiTestRule(projectsFolder.root.canonicalFile)
|
||||
|
||||
@get:Rule
|
||||
val testRootPath: TemporaryFolder by lazy {
|
||||
TemporaryFolder()
|
||||
}
|
||||
val guiTestRule = GuiTestRule(projectsFolder.apply{ create() }.root.canonicalFile)
|
||||
|
||||
val settingsTitle: String = if (isMac()) "Preferences" else "Settings"
|
||||
// val defaultSettingsTitle: String = if (isMac()) "Default Preferences" else "Default Settings"
|
||||
|
||||
Reference in New Issue
Block a user