Get rid of deprecated annotations and modifiers in stdlib (besides JS)
This commit is contained in:
+26
-13
@@ -8,31 +8,44 @@ import java.io.IOException
|
||||
|
||||
public class AnnotationListParseTest {
|
||||
|
||||
Test fun testAnnotatedGettersSetters() = doTest("annotatedGettersSetters")
|
||||
@Test
|
||||
fun testAnnotatedGettersSetters() = doTest("annotatedGettersSetters")
|
||||
|
||||
Test fun testAnnotationInSameFile() = doTest("annotationInSameFile")
|
||||
@Test
|
||||
fun testAnnotationInSameFile() = doTest("annotationInSameFile")
|
||||
|
||||
Test fun testAnonymousClasses() = doTest("anonymousClasses")
|
||||
@Test
|
||||
fun testAnonymousClasses() = doTest("anonymousClasses")
|
||||
|
||||
Test fun testClassAnnotations() = doTest("classAnnotations")
|
||||
@Test
|
||||
fun testClassAnnotations() = doTest("classAnnotations")
|
||||
|
||||
Test fun testConstructors() = doTest("constructors")
|
||||
@Test
|
||||
fun testConstructors() = doTest("constructors")
|
||||
|
||||
Test fun testDefaultPackage() = doTest("defaultPackage")
|
||||
@Test
|
||||
fun testDefaultPackage() = doTest("defaultPackage")
|
||||
|
||||
Test fun testFieldAnnotations() = doTest("fieldAnnotations")
|
||||
@Test
|
||||
fun testFieldAnnotations() = doTest("fieldAnnotations")
|
||||
|
||||
Test fun testLocalClasses() = doTest("localClasses")
|
||||
@Test
|
||||
fun testLocalClasses() = doTest("localClasses")
|
||||
|
||||
Test fun testMethodAnnotations() = doTest("methodAnnotations")
|
||||
@Test
|
||||
fun testMethodAnnotations() = doTest("methodAnnotations")
|
||||
|
||||
Test fun testNestedClasses() = doTest("nestedClasses")
|
||||
@Test
|
||||
fun testNestedClasses() = doTest("nestedClasses")
|
||||
|
||||
Test fun testPlatformStatic() = doTest("platformStatic")
|
||||
@Test
|
||||
fun testPlatformStatic() = doTest("platformStatic")
|
||||
|
||||
Test fun testSimple() = doTest("simple")
|
||||
@Test
|
||||
fun testSimple() = doTest("simple")
|
||||
|
||||
Test fun testDeclarations() = doTest("classDeclarations")
|
||||
@Test
|
||||
fun testDeclarations() = doTest("classDeclarations")
|
||||
|
||||
|
||||
private val resourcesRootFile = File("src/test/resources/parse")
|
||||
|
||||
+2
-2
@@ -286,7 +286,7 @@ public open class Kotlin2JsCompile() : AbstractKotlinCompile<K2JSCompilerArgumen
|
||||
|
||||
private fun <T: Any> ExtraPropertiesExtension.getOrNull(id: String): T? {
|
||||
try {
|
||||
@suppress("UNCHECKED_CAST")
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
return get(id) as? T
|
||||
}
|
||||
catch (e: ExtraPropertiesExtension.UnknownPropertyException) {
|
||||
@@ -295,7 +295,7 @@ private fun <T: Any> ExtraPropertiesExtension.getOrNull(id: String): T? {
|
||||
}
|
||||
|
||||
fun getAnnotations(project: Project, logger: Logger): Collection<File> {
|
||||
@suppress("UNCHECKED_CAST")
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
val annotations = project.getExtensions().getByName(DEFAULT_ANNOTATIONS) as Collection<File>
|
||||
|
||||
if (!annotations.isEmpty()) {
|
||||
|
||||
+4
-2
@@ -19,11 +19,13 @@ abstract class BaseGradleIT {
|
||||
private val resourcesRootFile = File("src/test/resources")
|
||||
private var workingDir = File(".")
|
||||
|
||||
Before fun setUp() {
|
||||
@Before
|
||||
fun setUp() {
|
||||
workingDir = Files.createTempDir()
|
||||
}
|
||||
|
||||
After fun tearDown() {
|
||||
@After
|
||||
fun tearDown() {
|
||||
deleteRecursively(workingDir)
|
||||
}
|
||||
|
||||
|
||||
+18
-9
@@ -7,7 +7,8 @@ import org.junit.Ignore
|
||||
|
||||
class SimpleKotlinGradleIT : BaseGradleIT() {
|
||||
|
||||
Test fun testSimpleCompile() {
|
||||
@Test
|
||||
fun testSimpleCompile() {
|
||||
val project = Project("simpleProject", "1.12")
|
||||
|
||||
project.build("compileDeployKotlin", "build") {
|
||||
@@ -22,7 +23,8 @@ class SimpleKotlinGradleIT : BaseGradleIT() {
|
||||
}
|
||||
}
|
||||
|
||||
Test fun testSuppressWarningsAndVersionInVerboseMode() {
|
||||
@Test
|
||||
fun testSuppressWarningsAndVersionInVerboseMode() {
|
||||
val project = Project("suppressWarningsAndVersion", "1.6")
|
||||
|
||||
project.build("build") {
|
||||
@@ -38,7 +40,8 @@ class SimpleKotlinGradleIT : BaseGradleIT() {
|
||||
}
|
||||
}
|
||||
|
||||
Test fun testSuppressWarningsAndVersionInNonVerboseMode() {
|
||||
@Test
|
||||
fun testSuppressWarningsAndVersionInNonVerboseMode() {
|
||||
val project = Project("suppressWarningsAndVersion", "1.6", minLogLevel = LogLevel.INFO)
|
||||
|
||||
project.build("build") {
|
||||
@@ -54,39 +57,45 @@ class SimpleKotlinGradleIT : BaseGradleIT() {
|
||||
}
|
||||
}
|
||||
|
||||
Test fun testKotlinCustomDirectory() {
|
||||
@Test
|
||||
fun testKotlinCustomDirectory() {
|
||||
Project("customSrcDir", "1.6").build("build") {
|
||||
assertSuccessful()
|
||||
}
|
||||
}
|
||||
|
||||
Test fun testKotlinCustomModuleName() {
|
||||
@Test
|
||||
fun testKotlinCustomModuleName() {
|
||||
Project("moduleNameCustom", "1.6").build("build") {
|
||||
assertSuccessful()
|
||||
assertContains("args.moduleName = myTestName")
|
||||
}
|
||||
}
|
||||
|
||||
Test fun testKotlinDefaultModuleName() {
|
||||
@Test
|
||||
fun testKotlinDefaultModuleName() {
|
||||
Project("moduleNameDefault", "1.6").build("build") {
|
||||
assertSuccessful()
|
||||
assertContains("args.moduleName = moduleNameDefault-compileKotlin")
|
||||
}
|
||||
}
|
||||
|
||||
Test fun testAdvancedOptions() {
|
||||
@Test
|
||||
fun testAdvancedOptions() {
|
||||
Project("advancedOptions", "1.6").build("build") {
|
||||
assertSuccessful()
|
||||
}
|
||||
}
|
||||
|
||||
Test fun testKotlinExtraJavaSrc() {
|
||||
@Test
|
||||
fun testKotlinExtraJavaSrc() {
|
||||
Project("additionalJavaSrc", "1.6").build("build") {
|
||||
assertSuccessful()
|
||||
}
|
||||
}
|
||||
|
||||
Test fun testGradleSubplugin() {
|
||||
@Test
|
||||
fun testGradleSubplugin() {
|
||||
val project = Project("kotlinGradleSubplugin", "1.6")
|
||||
|
||||
project.build("compileKotlin", "build") {
|
||||
|
||||
+4
-2
@@ -5,7 +5,8 @@ import org.jetbrains.kotlin.gradle.BaseGradleIT.Project
|
||||
|
||||
|
||||
class Kotlin2JsGradlePluginIT : BaseGradleIT() {
|
||||
Test fun testBuildAndClean() {
|
||||
@Test
|
||||
fun testBuildAndClean() {
|
||||
val project = Project("kotlin2JsProject", "1.6")
|
||||
|
||||
project.build("build", "-Pkotlin.gradle.noThreadTest=true") {
|
||||
@@ -62,7 +63,8 @@ class Kotlin2JsGradlePluginIT : BaseGradleIT() {
|
||||
}
|
||||
}
|
||||
|
||||
Test fun testNoOutputFileFails() {
|
||||
@Test
|
||||
fun testNoOutputFileFails() {
|
||||
val project = Project("kotlin2JsNoOutputFileProject", "1.6")
|
||||
project.build("build") {
|
||||
assertFailed()
|
||||
|
||||
+5
-3
@@ -4,10 +4,11 @@ import org.junit.Test
|
||||
import org.junit.Ignore
|
||||
import org.jetbrains.kotlin.gradle.BaseGradleIT.Project
|
||||
|
||||
Ignore("Requires Android SDK")
|
||||
@Ignore("Requires Android SDK")
|
||||
class KotlinAndroidGradleIT: BaseGradleIT() {
|
||||
|
||||
Test fun testSimpleCompile() {
|
||||
@Test
|
||||
fun testSimpleCompile() {
|
||||
val project = Project("AndroidProject", "2.3")
|
||||
|
||||
project.build("build") {
|
||||
@@ -53,7 +54,8 @@ class KotlinAndroidGradleIT: BaseGradleIT() {
|
||||
}
|
||||
}
|
||||
|
||||
Test fun testModuleNameAndroid() {
|
||||
@Test
|
||||
fun testModuleNameAndroid() {
|
||||
val project = Project("AndroidProject", "2.3")
|
||||
|
||||
project.build("build") {
|
||||
|
||||
+22
-11
@@ -5,7 +5,8 @@ import org.junit.Test
|
||||
|
||||
class KotlinGradleIT: BaseGradleIT() {
|
||||
|
||||
Test fun testCrossCompile() {
|
||||
@Test
|
||||
fun testCrossCompile() {
|
||||
val project = Project("kotlinJavaProject", "1.6")
|
||||
|
||||
project.build("compileDeployKotlin", "build") {
|
||||
@@ -20,7 +21,8 @@ class KotlinGradleIT: BaseGradleIT() {
|
||||
}
|
||||
}
|
||||
|
||||
Test fun testKotlinOnlyCompile() {
|
||||
@Test
|
||||
fun testKotlinOnlyCompile() {
|
||||
val project = Project("kotlinProject", "1.6")
|
||||
|
||||
project.build("build") {
|
||||
@@ -38,7 +40,8 @@ class KotlinGradleIT: BaseGradleIT() {
|
||||
// For corresponding documentation, see https://docs.gradle.org/current/userguide/gradle_daemon.html
|
||||
// Setting user.variant to different value implies a new daemon process will be created.
|
||||
// In order to stop daemon process, special exit task is used ( System.exit(0) ).
|
||||
Test fun testKotlinOnlyDaemonMemory() {
|
||||
@Test
|
||||
fun testKotlinOnlyDaemonMemory() {
|
||||
val project = Project("kotlinProject", "2.4")
|
||||
val VARIANT_CONSTANT = "ForTest"
|
||||
val userVariantArg = "-Duser.variant=$VARIANT_CONSTANT"
|
||||
@@ -74,7 +77,8 @@ class KotlinGradleIT: BaseGradleIT() {
|
||||
}
|
||||
}
|
||||
|
||||
Test fun testKotlinClasspath() {
|
||||
@Test
|
||||
fun testKotlinClasspath() {
|
||||
Project("classpathTest", "1.6").build("build") {
|
||||
assertSuccessful()
|
||||
assertReportExists()
|
||||
@@ -82,7 +86,8 @@ class KotlinGradleIT: BaseGradleIT() {
|
||||
}
|
||||
}
|
||||
|
||||
Test fun testMultiprojectPluginClasspath() {
|
||||
@Test
|
||||
fun testMultiprojectPluginClasspath() {
|
||||
Project("multiprojectClassPathTest", "1.6").build("build") {
|
||||
assertSuccessful()
|
||||
assertReportExists("subproject")
|
||||
@@ -90,7 +95,8 @@ class KotlinGradleIT: BaseGradleIT() {
|
||||
}
|
||||
}
|
||||
|
||||
Test fun testKotlinInJavaRoot() {
|
||||
@Test
|
||||
fun testKotlinInJavaRoot() {
|
||||
Project("kotlinInJavaRoot", "1.6").build("build") {
|
||||
assertSuccessful()
|
||||
assertReportExists()
|
||||
@@ -98,7 +104,8 @@ class KotlinGradleIT: BaseGradleIT() {
|
||||
}
|
||||
}
|
||||
|
||||
Test fun testKaptSimple() {
|
||||
@Test
|
||||
fun testKaptSimple() {
|
||||
val project = Project("kaptSimple", "1.12")
|
||||
|
||||
project.build("build") {
|
||||
@@ -117,7 +124,8 @@ class KotlinGradleIT: BaseGradleIT() {
|
||||
}
|
||||
}
|
||||
|
||||
Test fun testKaptStubs() {
|
||||
@Test
|
||||
fun testKaptStubs() {
|
||||
val project = Project("kaptStubs", "1.12")
|
||||
|
||||
project.build("build") {
|
||||
@@ -136,7 +144,8 @@ class KotlinGradleIT: BaseGradleIT() {
|
||||
}
|
||||
}
|
||||
|
||||
Test fun testKaptArguments() {
|
||||
@Test
|
||||
fun testKaptArguments() {
|
||||
Project("kaptArguments", "1.12").build("build") {
|
||||
assertSuccessful()
|
||||
assertContains("kapt: Using class file stubs")
|
||||
@@ -149,7 +158,8 @@ class KotlinGradleIT: BaseGradleIT() {
|
||||
}
|
||||
}
|
||||
|
||||
Test fun testKaptInheritedAnnotations() {
|
||||
@Test
|
||||
fun testKaptInheritedAnnotations() {
|
||||
Project("kaptInheritedAnnotations", "1.12").build("build") {
|
||||
assertSuccessful()
|
||||
assertFileExists("build/generated/source/kapt/main/TestClassGenerated.java")
|
||||
@@ -159,7 +169,8 @@ class KotlinGradleIT: BaseGradleIT() {
|
||||
}
|
||||
}
|
||||
|
||||
Test fun testKaptOutputKotlinCode() {
|
||||
@Test
|
||||
fun testKaptOutputKotlinCode() {
|
||||
Project("kaptOutputKotlinCode", "1.12").build("build") {
|
||||
assertSuccessful()
|
||||
assertContains("kapt: Using class file stubs")
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ import org.testng.Assert.*
|
||||
import org.testng.annotations.Test as test
|
||||
|
||||
class TestSource() {
|
||||
test fun f() {
|
||||
@test fun f() {
|
||||
assertEquals(box(), "OK")
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ import org.testng.annotations.BeforeMethod
|
||||
import org.testng.annotations.Test as test
|
||||
|
||||
class TestSource() {
|
||||
test fun f() {
|
||||
@test fun f() {
|
||||
val example : KotlinGreetingJoiner = KotlinGreetingJoiner(Greeter("Hi"))
|
||||
example.addName("Harry")
|
||||
example.addName("Ron")
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ import org.testng.annotations.BeforeMethod
|
||||
import org.testng.annotations.Test as test
|
||||
|
||||
class TestSource() {
|
||||
test fun f() {
|
||||
@test fun f() {
|
||||
val example : KotlinGreetingJoiner = KotlinGreetingJoiner(Greeter("Hi"))
|
||||
example.addName("Harry")
|
||||
example.addName("Ron")
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ import org.testng.Assert.assertTrue
|
||||
import org.testng.annotations.Test as test
|
||||
|
||||
class TestSource() {
|
||||
test fun f() {
|
||||
@test fun f() {
|
||||
assertTrue(isModuleFileExists(), "Kotlin module file should exists")
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ import org.testng.Assert.assertTrue
|
||||
import org.testng.annotations.Test as test
|
||||
|
||||
class TestSource() {
|
||||
test fun f() {
|
||||
@test fun f() {
|
||||
assertTrue(isModuleFileExists(), "Kotlin module file should exists")
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ import org.testng.Assert.*
|
||||
import org.testng.annotations.Test as test
|
||||
|
||||
class TestSource() {
|
||||
test fun f() {
|
||||
@test fun f() {
|
||||
assertEquals(box(), "OK")
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ import org.testng.annotations.BeforeMethod
|
||||
import org.testng.annotations.Test as test
|
||||
|
||||
class TestSource() {
|
||||
test fun f() {
|
||||
@test fun f() {
|
||||
val example : KotlinGreetingJoiner = KotlinGreetingJoiner(Greeter("Hi"))
|
||||
example.addName("Harry")
|
||||
example.addName("Ron")
|
||||
|
||||
@@ -54,7 +54,7 @@ fun specialJVM(): List<GenericFunction> {
|
||||
only(ArraysOfObjects, InvariantArraysOfObjects, ArraysOfPrimitives)
|
||||
doc { "Returns new array which is a copy of range of original array." }
|
||||
returns("SELF")
|
||||
annotations(InvariantArraysOfObjects) { """platformName("mutableCopyOfRange")"""}
|
||||
annotations(InvariantArraysOfObjects) { """@JvmName("mutableCopyOfRange")"""}
|
||||
body {
|
||||
"return Arrays.copyOfRange(this, fromIndex, toIndex)"
|
||||
}
|
||||
@@ -64,7 +64,7 @@ fun specialJVM(): List<GenericFunction> {
|
||||
only(ArraysOfObjects, InvariantArraysOfObjects, ArraysOfPrimitives)
|
||||
doc { "Returns new array which is a copy of the original array." }
|
||||
returns("SELF")
|
||||
annotations(InvariantArraysOfObjects) { """platformName("mutableCopyOf")"""}
|
||||
annotations(InvariantArraysOfObjects) { """@JvmName("mutableCopyOf")"""}
|
||||
body {
|
||||
"return Arrays.copyOf(this, size())"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user