Kotlin compatibility (promise *Run and JvmField because now companion object require explicit annotation to be field)

This commit is contained in:
Vladimir Krivosheev
2016-01-26 11:19:46 +01:00
parent 86942235d6
commit 14fe8af614
13 changed files with 15 additions and 3 deletions
@@ -20,6 +20,7 @@ import java.util.concurrent.TimeUnit
// we don't handle String in efficient way - because we want to test readContent/readChars also
internal class BinaryRequestHandlerTest {
companion object {
@JvmField
@ClassRule val projectRule = ProjectRule()
}
@@ -15,6 +15,7 @@ import java.util.concurrent.TimeUnit
internal abstract class BuiltInServerTestCase {
companion object {
@JvmField
@ClassRule val projectRule = ProjectRule()
}
@@ -46,6 +46,7 @@ import kotlin.properties.Delegates
internal class ApplicationStoreTest {
companion object {
@JvmField
@ClassRule val projectRule = ProjectRule()
}
@@ -19,6 +19,7 @@ import java.nio.file.Paths
internal class DefaultProjectStoreTest {
companion object {
@JvmField
@ClassRule val projectRule = ProjectRule()
private const val TEST_COMPONENT_NAME = "Foo"
@@ -55,6 +55,7 @@ internal class TestStateSplitter : MainConfigurationStateSplitter() {
@Bombed(user = "vladimir.krivosheev", year = 2016, month = Calendar.DECEMBER, day = 10)
internal class DirectoryBasedStorageTest {
companion object {
@JvmField
@ClassRule val projectRule = ProjectRule()
}
@@ -28,6 +28,7 @@ import kotlin.properties.Delegates
internal class ModuleStoreRenameTest {
companion object {
@JvmField
@ClassRule val projectRule = ProjectRule()
private val Module.storage: FileBasedStorage
@@ -26,7 +26,8 @@ import java.nio.file.Paths
@RunsInActiveStoreMode
class ModuleStoreTest {
companion object {
@ClassRule val projectRule = ProjectRule()
@JvmField
@ClassRule val projectRule = ProjectRule()
val MODULE_DIR = "\$MODULE_DIR$"
@@ -71,6 +71,7 @@ private fun createOrLoadProject(tempDirManager: TemporaryDirectory, task: (Proje
internal class ProjectStoreTest {
companion object {
@JvmField
@ClassRule val projectRule = ProjectRule()
}
@@ -48,6 +48,7 @@ internal val FILE_SPEC = "REMOTE"
*/
internal class SchemeManagerTest {
companion object {
@JvmField
@ClassRule val projectRule = ProjectRule()
}
@@ -31,6 +31,7 @@ internal class StorageManagerTest {
companion object {
val MACRO = "\$MACRO1$"
@JvmField
@ClassRule val projectRule = ProjectRule()
}
@@ -54,10 +54,10 @@ inline fun Promise<*>.processed(node: Obsolescent, crossinline handler: () -> Un
inline fun Promise<*>.doneRun(crossinline handler: () -> Unit) = (this as Promise<Any?>).done { handler() }
@Suppress("UNCHECKED_CAST")
inline fun <T> Promise<*>.then(crossinline handler: () -> T): Promise<T> = (this as Promise<Any?>).then { handler() }
inline fun <T> Promise<*>.thenRun(crossinline handler: () -> T): Promise<T> = (this as Promise<Any?>).then { handler() }
@Suppress("UNCHECKED_CAST")
inline fun Promise<*>.processed(crossinline handler: () -> Unit): Promise<*> = (this as Promise<Any?>).processed { handler() }
inline fun Promise<*>.processedRun(crossinline handler: () -> Unit): Promise<*> = (this as Promise<Any?>).processed { handler() }
inline fun <T, SUB_RESULT> Promise<T>.thenAsync(node: Obsolescent, crossinline handler: (T) -> Promise<SUB_RESULT>) = thenAsync(object : ValueNodeAsyncFunction<T, SUB_RESULT>(node) {
@@ -17,6 +17,7 @@ import kotlin.properties.Delegates
internal abstract class GitTestCase : IcsTestCase() {
companion object {
@JvmField
@ClassRule val projectRule = ProjectRule()
}
@@ -32,6 +32,7 @@ import java.io.File
class LoadTest : IcsTestCase() {
companion object {
@JvmField
@ClassRule val projectRule = ProjectRule()
}