Kapt: Simplify wrapper tests
(cherry picked from commit 1677984)
This commit is contained in:
committed by
Yan Zhulanow
parent
e04f834a0e
commit
238340a143
@@ -24,8 +24,7 @@ import org.jetbrains.kotlin.android.*
|
||||
import org.jetbrains.kotlin.android.configure.AbstractConfigureProjectTest
|
||||
import org.jetbrains.kotlin.annotation.AbstractAnnotationProcessorBoxTest
|
||||
import org.jetbrains.kotlin.annotation.processing.test.sourceRetention.AbstractBytecodeListingTestForSourceRetention
|
||||
import org.jetbrains.kotlin.annotation.processing.test.wrappers.AbstractJavaModelWrappersTest
|
||||
import org.jetbrains.kotlin.annotation.processing.test.wrappers.AbstractKotlinModelWrappersTest
|
||||
import org.jetbrains.kotlin.annotation.processing.test.wrappers.AbstractAnnotationProcessingTest
|
||||
import org.jetbrains.kotlin.asJava.AbstractCompilerLightClassTest
|
||||
import org.jetbrains.kotlin.cfg.AbstractControlFlowTest
|
||||
import org.jetbrains.kotlin.cfg.AbstractDataFlowTest
|
||||
@@ -1092,12 +1091,8 @@ fun main(args: Array<String>) {
|
||||
}
|
||||
|
||||
testGroup("plugins/plugins-tests/tests", "plugins/annotation-processing/testData") {
|
||||
testClass<AbstractJavaModelWrappersTest>() {
|
||||
model("javaWrappers", extension = null)
|
||||
}
|
||||
|
||||
testClass<AbstractKotlinModelWrappersTest>() {
|
||||
model("kotlinWrappers", extension = "kt")
|
||||
testClass<AbstractAnnotationProcessingTest>() {
|
||||
model("wrappers", recursive = true, extension = "kt")
|
||||
}
|
||||
|
||||
testClass<AbstractBytecodeListingTestForSourceRetention>() {
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
annotation class KotlinAnnotation(val a: String, val b: Int)
|
||||
+8
-4
@@ -1,13 +1,17 @@
|
||||
// EnumClass
|
||||
// FQNAME: EnumClass
|
||||
|
||||
// FILE: EnumClass.java
|
||||
enum EnumClass {
|
||||
RED, GREEN, BLUE;
|
||||
|
||||
|
||||
void someMethod() {
|
||||
System.out.println("Hello, world!")
|
||||
}
|
||||
|
||||
|
||||
String getStringRepresentation() {
|
||||
return this.toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: Anno.kt
|
||||
annotation class Anno
|
||||
+6
-2
@@ -1,5 +1,6 @@
|
||||
// MetaAnnotation
|
||||
// FQNAME: MetaAnnotation
|
||||
|
||||
// FILE: MetaAnnotation.java
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
@@ -10,4 +11,7 @@ import java.lang.annotation.Target;
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface MetaAnnotation {
|
||||
String strValue();
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: Anno.kt
|
||||
annotation class Anno
|
||||
+6
-2
@@ -1,5 +1,6 @@
|
||||
// Simple
|
||||
// FQNAME: Simple
|
||||
|
||||
// FILE: Simple.java
|
||||
@interface Anno {
|
||||
String[] numbers();
|
||||
}
|
||||
@@ -29,4 +30,7 @@ public abstract class Simple {
|
||||
protected String strMethod(int param) {
|
||||
return "A";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: KotlinAnnotation.kt
|
||||
annotation class KotlinAnnotation(val a: String, val b: Int)
|
||||
+6
-2
@@ -1,5 +1,6 @@
|
||||
// WithNested
|
||||
// FQNAME: WithNested
|
||||
|
||||
// FILE: WithNested.java
|
||||
class WithNested {
|
||||
void myClassFun() {}
|
||||
|
||||
@@ -18,4 +19,7 @@ class WithNested {
|
||||
interface NestedInterface {
|
||||
void nestedInterfaceFun() {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: Anno.kt
|
||||
annotation class Anno
|
||||
+9
-7
@@ -1,21 +1,23 @@
|
||||
// test.Main
|
||||
// FQNAME: test.Main
|
||||
|
||||
package test
|
||||
|
||||
import kotlin.reflect.KClass
|
||||
|
||||
@MainAnno("A", 5)
|
||||
class Main {
|
||||
@field:XAnno(color = Color.GREEN)
|
||||
val x: String
|
||||
val x: String = ""
|
||||
|
||||
@get:YAnno(arrayOf<String>("Mary", "Tom"), intArrayOf(1, 3, 5), arrayOf<Color>(Color.GREEN, Color.RED))
|
||||
val y: String
|
||||
val y: String = ""
|
||||
|
||||
@set:ZAnno(String::class, arrayOf(String::class, Long::class, Main::class))
|
||||
var z: String
|
||||
var z: String = ""
|
||||
|
||||
// Property annotations are lost here (we don't create Elements (javac API) for the synthetic propertyName$annotations() methods)
|
||||
@MainAnno("B", 6)
|
||||
val zz: String
|
||||
val zz: String = ""
|
||||
}
|
||||
|
||||
enum class Color {
|
||||
@@ -26,6 +28,6 @@ annotation class MainAnno(val a: String, val b: Int)
|
||||
|
||||
annotation class XAnno(val color: Color)
|
||||
|
||||
annotation class YAnno(val names: Array<String>, val ints: Array<Int>, val colors: Array<Color>)
|
||||
annotation class YAnno(val names: Array<String>, val ints: IntArray, val colors: Array<Color>)
|
||||
|
||||
annotation class ZAnno(val clazz: Class<*>, val classes = Array<Class<*>>)
|
||||
annotation class ZAnno(val clazz: KClass<*>, val classes: Array<KClass<*>>)
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// EnumClass
|
||||
// FQNAME: EnumClass
|
||||
|
||||
enum class EnumClass {
|
||||
RED, GREEN, BLUE;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// Test
|
||||
// FQNAME: Test
|
||||
|
||||
class Test {
|
||||
@kotlin.jvm.Transient
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
// Anno
|
||||
// FQNAME: Anno
|
||||
|
||||
@Repeatable
|
||||
@Deprecated
|
||||
@Deprecated("")
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
@Target(AnnotationTarget.CLASS, AnnotationTarget.CONSTRUCTOR, AnnotationTarget.EXPRESSION)
|
||||
annotation class Anno
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
@kotlin.annotation.Repeatable
|
||||
@kotlin.Deprecated
|
||||
@kotlin.Deprecated(message = "")
|
||||
@kotlin.annotation.Retention(value = RUNTIME)
|
||||
@kotlin.annotation.Target(allowedTargets = { CLASS, CONSTRUCTOR, EXPRESSION })
|
||||
@java.lang.annotation.Retention(value = RUNTIME)
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// MyClass
|
||||
// FQNAME: MyClass
|
||||
|
||||
class MyClass {
|
||||
companion object {
|
||||
+2
-1
@@ -1,5 +1,6 @@
|
||||
// MyClass
|
||||
// FQNAME: MyClass
|
||||
|
||||
@Retention(AnnotationRetention.SOURCE)
|
||||
@Repeatable
|
||||
annotation class Anno(val name: String)
|
||||
|
||||
+2
-2
@@ -1,10 +1,10 @@
|
||||
// test.Simple
|
||||
// FQNAME: test.Simple
|
||||
|
||||
package test
|
||||
|
||||
abstract class Simple(private val prop: String) {
|
||||
protected val anotherProp: Int = 5
|
||||
|
||||
abstract fun strFun(val x: Long): String
|
||||
abstract fun strFun(x: Long): String
|
||||
fun voidFun() {}
|
||||
}
|
||||
+56
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
* Copyright 2010-2016 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.annotation.processing.test.wrappers
|
||||
|
||||
import com.intellij.openapi.util.io.FileUtil
|
||||
import com.intellij.psi.JavaPsiFacade
|
||||
import com.intellij.psi.search.GlobalSearchScope
|
||||
import org.jetbrains.kotlin.codegen.AbstractBytecodeTextTest
|
||||
import org.jetbrains.kotlin.codegen.CodegenTestCase
|
||||
import org.jetbrains.kotlin.codegen.CodegenTestUtil
|
||||
import org.jetbrains.kotlin.java.model.elements.DefaultJeElementRenderer
|
||||
import org.jetbrains.kotlin.java.model.toJeElement
|
||||
import org.jetbrains.kotlin.test.ConfigurationKind
|
||||
import org.jetbrains.kotlin.test.KotlinTestUtils
|
||||
|
||||
import java.io.File
|
||||
import java.util.regex.Pattern
|
||||
|
||||
abstract class AbstractAnnotationProcessingTest : AbstractBytecodeTextTest() {
|
||||
companion object {
|
||||
private val SUBJECT_FQ_NAME_PATTERN = Pattern.compile("^// FQNAME: \\s*(.*)$", Pattern.MULTILINE)
|
||||
private val RENDERER = DefaultJeElementRenderer()
|
||||
}
|
||||
|
||||
override fun doMultiFileTest(wholeFile: File, files: List<CodegenTestCase.TestFile>, javaFilesDir: File?) {
|
||||
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.ALL, files, javaFilesDir)
|
||||
loadMultiFiles(files)
|
||||
|
||||
val text = FileUtil.loadFile(wholeFile, true)
|
||||
val matcher = SUBJECT_FQ_NAME_PATTERN.matcher(text)
|
||||
assertTrue("No FqName specified. First line of the form '// f.q.Name' expected", matcher.find())
|
||||
val fqName = matcher.group(1)
|
||||
|
||||
CodegenTestUtil.generateFiles(myEnvironment, myFiles)
|
||||
val project = myEnvironment.project
|
||||
val psiClass = JavaPsiFacade.getInstance(project).findClass(fqName, GlobalSearchScope.projectScope(project))!!
|
||||
|
||||
val modelFile = File(wholeFile.parent, wholeFile.nameWithoutExtension + ".txt")
|
||||
val jeElement = psiClass.toJeElement() ?: error("JeElement is null")
|
||||
KotlinTestUtils.assertEqualsToFile(modelFile, RENDERER.render(jeElement))
|
||||
}
|
||||
}
|
||||
-89
@@ -1,89 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-2016 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.annotation.processing.test.wrappers;
|
||||
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.psi.JavaPsiFacade;
|
||||
import com.intellij.psi.PsiClass;
|
||||
import com.intellij.psi.search.GlobalSearchScope;
|
||||
import junit.framework.TestCase;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.kotlin.checkers.KotlinMultiFileTestWithJava;
|
||||
import org.jetbrains.kotlin.cli.jvm.config.JavaSourceRoot;
|
||||
import org.jetbrains.kotlin.test.ConfigurationKind;
|
||||
import org.jetbrains.kotlin.test.KotlinTestUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public abstract class AbstractJavaAnnotationProcessingTest extends KotlinMultiFileTestWithJava<Void, Void> {
|
||||
private final static Pattern SUBJECT_FQ_NAME_PATTERN = Pattern.compile("^//\\s*(.*)$", Pattern.MULTILINE);
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
protected ConfigurationKind getConfigurationKind() {
|
||||
return ConfigurationKind.ALL;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isKotlinSourceRootNeeded() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doTest(String testDirPath) throws Exception {
|
||||
File testDir = new File(testDirPath);
|
||||
File javaFile = new File(testDirPath, testDir.getName() + ".java");
|
||||
|
||||
String text = FileUtil.loadFile(javaFile, true);
|
||||
Matcher matcher = SUBJECT_FQ_NAME_PATTERN.matcher(text);
|
||||
TestCase.assertTrue("No FqName specified. First line of the form '// f.q.Name' expected", matcher.find());
|
||||
String fqName = matcher.group(1);
|
||||
|
||||
getEnvironment().tryUpdateClasspath(Collections.singletonList(testDir));
|
||||
|
||||
super.doTest(new File(testDir.getParentFile(), "common.kt").getCanonicalPath());
|
||||
|
||||
KotlinTestUtils.resolveAllKotlinFiles(getEnvironment());
|
||||
Project project = getEnvironment().getProject();
|
||||
|
||||
PsiClass javaClass = JavaPsiFacade.getInstance(project).findClass(fqName, GlobalSearchScope.allScope(project));
|
||||
TestCase.assertNotNull("Class $fqName was not found.", javaClass != null);
|
||||
doTest(javaFile, javaClass);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doMultiFileTest(File testDataFile, Map<String, ModuleAndDependencies> modules, List<Void> files) throws IOException {}
|
||||
|
||||
protected abstract void doTest(File testDataFile, PsiClass lightClass);
|
||||
|
||||
@Override
|
||||
protected Void createTestModule(@NotNull String name) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Void createTestFile(Void module, String fileName, String text, Map<String, String> directives) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
-90
@@ -1,90 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-2016 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.annotation.processing.test.wrappers;
|
||||
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.psi.PsiClass;
|
||||
import com.intellij.psi.search.GlobalSearchScope;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.kotlin.asJava.finder.JavaElementFinder;
|
||||
import org.jetbrains.kotlin.checkers.KotlinMultiFileTestWithJava;
|
||||
import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment;
|
||||
import org.jetbrains.kotlin.test.ConfigurationKind;
|
||||
import org.jetbrains.kotlin.test.KotlinTestUtils;
|
||||
import org.jetbrains.kotlin.utils.ExceptionUtilsKt;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public abstract class AbstractKotlinAnnotationProcessingTest extends KotlinMultiFileTestWithJava<Void, Void> {
|
||||
private final static Pattern SUBJECT_FQ_NAME_PATTERN = Pattern.compile("^//\\s*(.*)$", Pattern.MULTILINE);
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
protected ConfigurationKind getConfigurationKind() {
|
||||
return ConfigurationKind.ALL;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isKotlinSourceRootNeeded() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doMultiFileTest(File testDataFile, Map<String, ModuleAndDependencies> modules, List<Void> files) throws IOException {
|
||||
String text = FileUtil.loadFile(testDataFile, true);
|
||||
Matcher matcher = SUBJECT_FQ_NAME_PATTERN.matcher(text);
|
||||
assertTrue("No FqName specified. First line of the form '// f.q.Name' expected", matcher.find());
|
||||
String fqName = matcher.group(1);
|
||||
|
||||
PsiClass lightClass = findLightClass(fqName);
|
||||
doTest(testDataFile, lightClass);
|
||||
}
|
||||
|
||||
protected abstract void doTest(File testDataFile, PsiClass lightClass);
|
||||
|
||||
private PsiClass findLightClass(String fqName) {
|
||||
try {
|
||||
return createFinder(getEnvironment()).findClass(fqName, GlobalSearchScope.allScope(getEnvironment().getProject()));
|
||||
}
|
||||
catch (IOException e) {
|
||||
throw ExceptionUtilsKt.rethrow(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Void createTestModule(@NotNull String name) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Void createTestFile(Void module, String fileName, String text, Map<String, String> directives) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static JavaElementFinder createFinder(@NotNull KotlinCoreEnvironment environment) throws IOException {
|
||||
// We need to resolve all the files in order too fill in the trace that sits inside LightClassGenerationSupport
|
||||
KotlinTestUtils.resolveAllKotlinFiles(environment);
|
||||
|
||||
return JavaElementFinder.getInstance(environment.getProject());
|
||||
}
|
||||
}
|
||||
-39
@@ -1,39 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-2016 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.annotation.processing.test.wrappers
|
||||
|
||||
import com.intellij.psi.PsiClass
|
||||
import org.jetbrains.kotlin.java.model.elements.DefaultJeElementRenderer
|
||||
import org.jetbrains.kotlin.java.model.toJeElement
|
||||
import org.jetbrains.kotlin.test.KotlinTestUtils
|
||||
import java.io.File
|
||||
|
||||
private val RENDERER = DefaultJeElementRenderer()
|
||||
|
||||
private fun runTest(testDataFile: File, lightClass: PsiClass) {
|
||||
val modelFile = File(testDataFile.parent, testDataFile.nameWithoutExtension + ".txt")
|
||||
val jeElement = lightClass.toJeElement() ?: error("JeElement is null")
|
||||
KotlinTestUtils.assertEqualsToFile(modelFile, RENDERER.render(jeElement))
|
||||
}
|
||||
|
||||
abstract class AbstractKotlinModelWrappersTest : AbstractKotlinAnnotationProcessingTest() {
|
||||
override fun doTest(testDataFile: File, lightClass: PsiClass) = runTest(testDataFile, lightClass)
|
||||
}
|
||||
|
||||
abstract class AbstractJavaModelWrappersTest : AbstractJavaAnnotationProcessingTest() {
|
||||
override fun doTest(testDataFile: File, lightClass: PsiClass) = runTest(testDataFile, lightClass)
|
||||
}
|
||||
+121
@@ -0,0 +1,121 @@
|
||||
/*
|
||||
* Copyright 2010-2016 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.annotation.processing.test.wrappers;
|
||||
|
||||
import com.intellij.testFramework.TestDataPath;
|
||||
import org.jetbrains.kotlin.test.JUnit3RunnerWithInners;
|
||||
import org.jetbrains.kotlin.test.KotlinTestUtils;
|
||||
import org.jetbrains.kotlin.test.TestMetadata;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */
|
||||
@SuppressWarnings("all")
|
||||
@TestMetadata("plugins/annotation-processing/testData/wrappers")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public class AnnotationProcessingTestGenerated extends AbstractAnnotationProcessingTest {
|
||||
public void testAllFilesPresentInWrappers() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("plugins/annotation-processing/testData/wrappers"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("plugins/annotation-processing/testData/wrappers/javaWrappers")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class JavaWrappers extends AbstractAnnotationProcessingTest {
|
||||
public void testAllFilesPresentInJavaWrappers() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("plugins/annotation-processing/testData/wrappers/javaWrappers"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("EnumClass.kt")
|
||||
public void testEnumClass() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("plugins/annotation-processing/testData/wrappers/javaWrappers/EnumClass.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("MetaAnnotation.kt")
|
||||
public void testMetaAnnotation() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("plugins/annotation-processing/testData/wrappers/javaWrappers/MetaAnnotation.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("Simple.kt")
|
||||
public void testSimple() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("plugins/annotation-processing/testData/wrappers/javaWrappers/Simple.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("WithNested.kt")
|
||||
public void testWithNested() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("plugins/annotation-processing/testData/wrappers/javaWrappers/WithNested.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("plugins/annotation-processing/testData/wrappers/kotlinWrappers")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class KotlinWrappers extends AbstractAnnotationProcessingTest {
|
||||
public void testAllFilesPresentInKotlinWrappers() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("plugins/annotation-processing/testData/wrappers/kotlinWrappers"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("annotations.kt")
|
||||
public void testAnnotations() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("plugins/annotation-processing/testData/wrappers/kotlinWrappers/annotations.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("enum.kt")
|
||||
public void testEnum() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("plugins/annotation-processing/testData/wrappers/kotlinWrappers/enum.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("kotlinAnnotations.kt")
|
||||
public void testKotlinAnnotations() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("plugins/annotation-processing/testData/wrappers/kotlinWrappers/kotlinAnnotations.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("metaAnnotations.kt")
|
||||
public void testMetaAnnotations() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("plugins/annotation-processing/testData/wrappers/kotlinWrappers/metaAnnotations.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("nestedClasses.kt")
|
||||
public void testNestedClasses() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("plugins/annotation-processing/testData/wrappers/kotlinWrappers/nestedClasses.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("repeatableAnnotations.kt")
|
||||
public void testRepeatableAnnotations() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("plugins/annotation-processing/testData/wrappers/kotlinWrappers/repeatableAnnotations.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("simple.kt")
|
||||
public void testSimple() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("plugins/annotation-processing/testData/wrappers/kotlinWrappers/simple.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
}
|
||||
}
|
||||
-62
@@ -1,62 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-2016 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.annotation.processing.test.wrappers;
|
||||
|
||||
import com.intellij.testFramework.TestDataPath;
|
||||
import org.jetbrains.kotlin.test.JUnit3RunnerWithInners;
|
||||
import org.jetbrains.kotlin.test.KotlinTestUtils;
|
||||
import org.jetbrains.kotlin.test.TestMetadata;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */
|
||||
@SuppressWarnings("all")
|
||||
@TestMetadata("plugins/annotation-processing/testData/javaWrappers")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public class JavaModelWrappersTestGenerated extends AbstractJavaModelWrappersTest {
|
||||
public void testAllFilesPresentInJavaWrappers() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("plugins/annotation-processing/testData/javaWrappers"), Pattern.compile("^([^\\.]+)$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("EnumClass")
|
||||
public void testEnumClass() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("plugins/annotation-processing/testData/javaWrappers/EnumClass/");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("MetaAnnotation")
|
||||
public void testMetaAnnotation() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("plugins/annotation-processing/testData/javaWrappers/MetaAnnotation/");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("Simple")
|
||||
public void testSimple() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("plugins/annotation-processing/testData/javaWrappers/Simple/");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("WithNested")
|
||||
public void testWithNested() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("plugins/annotation-processing/testData/javaWrappers/WithNested/");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
}
|
||||
-79
@@ -1,79 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-2016 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.annotation.processing.test.wrappers;
|
||||
|
||||
import com.intellij.testFramework.TestDataPath;
|
||||
import org.jetbrains.kotlin.test.JUnit3RunnerWithInners;
|
||||
import org.jetbrains.kotlin.test.KotlinTestUtils;
|
||||
import org.jetbrains.kotlin.test.TestMetadata;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */
|
||||
@SuppressWarnings("all")
|
||||
@TestMetadata("plugins/annotation-processing/testData/kotlinWrappers")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public class KotlinModelWrappersTestGenerated extends AbstractKotlinModelWrappersTest {
|
||||
public void testAllFilesPresentInKotlinWrappers() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("plugins/annotation-processing/testData/kotlinWrappers"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("annotations.kt")
|
||||
public void testAnnotations() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("plugins/annotation-processing/testData/kotlinWrappers/annotations.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("enum.kt")
|
||||
public void testEnum() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("plugins/annotation-processing/testData/kotlinWrappers/enum.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("kotlinAnnotations.kt")
|
||||
public void testKotlinAnnotations() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("plugins/annotation-processing/testData/kotlinWrappers/kotlinAnnotations.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("metaAnnotations.kt")
|
||||
public void testMetaAnnotations() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("plugins/annotation-processing/testData/kotlinWrappers/metaAnnotations.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("nestedClasses.kt")
|
||||
public void testNestedClasses() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("plugins/annotation-processing/testData/kotlinWrappers/nestedClasses.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("repeatableAnnotations.kt")
|
||||
public void testRepeatableAnnotations() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("plugins/annotation-processing/testData/kotlinWrappers/repeatableAnnotations.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("simple.kt")
|
||||
public void testSimple() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("plugins/annotation-processing/testData/kotlinWrappers/simple.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user