Stop failing when there's no CIDR classes during running tests

This commit is contained in:
Nikolay Krasko
2019-02-14 14:53:09 +03:00
parent d1a1594f26
commit e495bfc570
4 changed files with 10 additions and 2 deletions
@@ -5,5 +5,7 @@
package org.jetbrains.kotlin.idea
// Remove the function, when there's no dependency to cidr during running Kotlin tests.
// BUNCH: as33
fun registerAdditionalResourceBundleInTests() {
}
@@ -14,6 +14,8 @@ import java.lang.IllegalStateException
private const val CIDR_FEATURE_STATISTICS_PROVIDER_FQNAME = "com.jetbrains.cidr.lang.OCFeatureStatisticsBundleProvider"
// Remove the function, when there's no dependency to cidr during running Kotlin tests.
// BUNCH: as33
fun registerAdditionalResourceBundleInTests() {
if (!ApplicationManager.getApplication().isUnitTestMode) {
return
@@ -14,6 +14,8 @@ import java.lang.IllegalStateException
private const val CIDR_FEATURE_STATISTICS_PROVIDER_FQNAME = "com.jetbrains.cidr.lang.OCFeatureStatisticsBundleProvider"
// Remove the function, when there's no dependency to cidr during running Kotlin tests.
// BUNCH: as33
fun registerAdditionalResourceBundleInTests() {
if (!ApplicationManager.getApplication().isUnitTestMode) {
return
@@ -29,7 +31,7 @@ fun registerAdditionalResourceBundleInTests() {
val cidrFSBundleProviderClass = try {
Class.forName(CIDR_FEATURE_STATISTICS_PROVIDER_FQNAME)
} catch (_: ClassNotFoundException) {
throw IllegalStateException("Remove this registration for the current platform: class wasn't found.")
return
}
val cidrFSBundleProvider = cidrFSBundleProviderClass.newInstance() as FeatureStatisticsBundleProvider
@@ -14,6 +14,8 @@ import java.lang.IllegalStateException
private const val CIDR_FEATURE_STATISTICS_PROVIDER_FQNAME = "com.jetbrains.cidr.lang.OCFeatureStatisticsBundleProvider"
// Remove the function, when there's no dependency to cidr during running Kotlin tests.
// BUNCH: as33
fun registerAdditionalResourceBundleInTests() {
if (!ApplicationManager.getApplication().isUnitTestMode) {
return
@@ -29,7 +31,7 @@ fun registerAdditionalResourceBundleInTests() {
val cidrFSBundleProviderClass = try {
Class.forName(CIDR_FEATURE_STATISTICS_PROVIDER_FQNAME)
} catch (_: ClassNotFoundException) {
throw IllegalStateException("Remove this registration for the current platform: class wasn't found.")
return
}
val cidrFSBundleProvider = cidrFSBundleProviderClass.newInstance() as FeatureStatisticsBundleProvider