Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
硅谷海盗
kotlin
提交
f4527b81
K
kotlin
项目概览
硅谷海盗
/
kotlin
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
kotlin
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f4527b81
编写于
5月 03, 2012
作者:
S
Stepan Koltsov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
better method name
上级
fcee8a41
变更
42
显示空白变更内容
内联
并排
Showing
42 changed file
with
181 addition
and
191 deletion
+181
-191
compiler/tests/org/jetbrains/jet/JetLiteFixture.java
compiler/tests/org/jetbrains/jet/JetLiteFixture.java
+4
-4
compiler/tests/org/jetbrains/jet/JetTestUtils.java
compiler/tests/org/jetbrains/jet/JetTestUtils.java
+3
-3
compiler/tests/org/jetbrains/jet/cfg/JetControlFlowTest.java
compiler/tests/org/jetbrains/jet/cfg/JetControlFlowTest.java
+1
-1
compiler/tests/org/jetbrains/jet/checkers/CheckerTestUtilTest.java
...tests/org/jetbrains/jet/checkers/CheckerTestUtilTest.java
+1
-1
compiler/tests/org/jetbrains/jet/checkers/JetDiagnosticsTest.java
.../tests/org/jetbrains/jet/checkers/JetDiagnosticsTest.java
+1
-2
compiler/tests/org/jetbrains/jet/cli/jvm/compiler/CompileJavaAgainstKotlinTest.java
...ns/jet/cli/jvm/compiler/CompileJavaAgainstKotlinTest.java
+1
-1
compiler/tests/org/jetbrains/jet/cli/jvm/compiler/CompileKotlinAgainstKotlinTest.java
.../jet/cli/jvm/compiler/CompileKotlinAgainstKotlinTest.java
+2
-2
compiler/tests/org/jetbrains/jet/cli/jvm/compiler/JavaDescriptorResolverTest.java
...ains/jet/cli/jvm/compiler/JavaDescriptorResolverTest.java
+1
-2
compiler/tests/org/jetbrains/jet/cli/jvm/compiler/ReadJavaBinaryClassTest.java
...tbrains/jet/cli/jvm/compiler/ReadJavaBinaryClassTest.java
+2
-3
compiler/tests/org/jetbrains/jet/cli/jvm/compiler/ReadKotlinBinaryClassTest.java
...rains/jet/cli/jvm/compiler/ReadKotlinBinaryClassTest.java
+2
-3
compiler/tests/org/jetbrains/jet/cli/jvm/compiler/WriteSignatureTest.java
...rg/jetbrains/jet/cli/jvm/compiler/WriteSignatureTest.java
+1
-1
compiler/tests/org/jetbrains/jet/cli/jvm/compiler/longTest/ResolveDescriptorsFromExternalLibraries.java
...ler/longTest/ResolveDescriptorsFromExternalLibraries.java
+1
-1
compiler/tests/org/jetbrains/jet/codegen/AnnotationGenTest.java
...er/tests/org/jetbrains/jet/codegen/AnnotationGenTest.java
+2
-2
compiler/tests/org/jetbrains/jet/codegen/ArrayGenTest.java
compiler/tests/org/jetbrains/jet/codegen/ArrayGenTest.java
+1
-1
compiler/tests/org/jetbrains/jet/codegen/BridgeMethodGenTest.java
.../tests/org/jetbrains/jet/codegen/BridgeMethodGenTest.java
+1
-1
compiler/tests/org/jetbrains/jet/codegen/ClassGenTest.java
compiler/tests/org/jetbrains/jet/codegen/ClassGenTest.java
+59
-59
compiler/tests/org/jetbrains/jet/codegen/ClosuresGenTest.java
...iler/tests/org/jetbrains/jet/codegen/ClosuresGenTest.java
+1
-1
compiler/tests/org/jetbrains/jet/codegen/CompileTextTest.java
...iler/tests/org/jetbrains/jet/codegen/CompileTextTest.java
+1
-1
compiler/tests/org/jetbrains/jet/codegen/ControlStructuresTest.java
...ests/org/jetbrains/jet/codegen/ControlStructuresTest.java
+35
-35
compiler/tests/org/jetbrains/jet/codegen/ExtensionFunctionsTest.java
...sts/org/jetbrains/jet/codegen/ExtensionFunctionsTest.java
+7
-7
compiler/tests/org/jetbrains/jet/codegen/FunctionGenTest.java
...iler/tests/org/jetbrains/jet/codegen/FunctionGenTest.java
+1
-1
compiler/tests/org/jetbrains/jet/codegen/JdkHeadersTest.java
compiler/tests/org/jetbrains/jet/codegen/JdkHeadersTest.java
+1
-1
compiler/tests/org/jetbrains/jet/codegen/NamespaceGenTest.java
...ler/tests/org/jetbrains/jet/codegen/NamespaceGenTest.java
+1
-1
compiler/tests/org/jetbrains/jet/codegen/ObjectGenTest.java
compiler/tests/org/jetbrains/jet/codegen/ObjectGenTest.java
+1
-1
compiler/tests/org/jetbrains/jet/codegen/PatternMatchingTest.java
.../tests/org/jetbrains/jet/codegen/PatternMatchingTest.java
+1
-1
compiler/tests/org/jetbrains/jet/codegen/PrimitiveTypesTest.java
...r/tests/org/jetbrains/jet/codegen/PrimitiveTypesTest.java
+1
-1
compiler/tests/org/jetbrains/jet/codegen/PropertyGenTest.java
...iler/tests/org/jetbrains/jet/codegen/PropertyGenTest.java
+22
-22
compiler/tests/org/jetbrains/jet/codegen/SafeRefTest.java
compiler/tests/org/jetbrains/jet/codegen/SafeRefTest.java
+1
-1
compiler/tests/org/jetbrains/jet/codegen/StringsTest.java
compiler/tests/org/jetbrains/jet/codegen/StringsTest.java
+1
-1
compiler/tests/org/jetbrains/jet/codegen/SuperGenTest.java
compiler/tests/org/jetbrains/jet/codegen/SuperGenTest.java
+1
-1
compiler/tests/org/jetbrains/jet/codegen/TraitsTest.java
compiler/tests/org/jetbrains/jet/codegen/TraitsTest.java
+1
-1
compiler/tests/org/jetbrains/jet/codegen/TupleGenTest.java
compiler/tests/org/jetbrains/jet/codegen/TupleGenTest.java
+1
-1
compiler/tests/org/jetbrains/jet/codegen/TypeInfoTest.java
compiler/tests/org/jetbrains/jet/codegen/TypeInfoTest.java
+1
-2
compiler/tests/org/jetbrains/jet/codegen/VarArgTest.java
compiler/tests/org/jetbrains/jet/codegen/VarArgTest.java
+10
-10
compiler/tests/org/jetbrains/jet/resolve/DescriptorRendererTest.java
...sts/org/jetbrains/jet/resolve/DescriptorRendererTest.java
+1
-3
compiler/tests/org/jetbrains/jet/resolve/ExtensibleResolveTestCase.java
.../org/jetbrains/jet/resolve/ExtensibleResolveTestCase.java
+1
-1
compiler/tests/org/jetbrains/jet/runtime/JetNpeTest.java
compiler/tests/org/jetbrains/jet/runtime/JetNpeTest.java
+1
-1
compiler/tests/org/jetbrains/jet/types/JetDefaultModalityModifiersTest.java
.../jetbrains/jet/types/JetDefaultModalityModifiersTest.java
+1
-3
compiler/tests/org/jetbrains/jet/types/JetOverloadTest.java
compiler/tests/org/jetbrains/jet/types/JetOverloadTest.java
+1
-1
compiler/tests/org/jetbrains/jet/types/JetOverridingTest.java
...iler/tests/org/jetbrains/jet/types/JetOverridingTest.java
+1
-1
compiler/tests/org/jetbrains/jet/types/JetTypeCheckerTest.java
...ler/tests/org/jetbrains/jet/types/JetTypeCheckerTest.java
+1
-2
js/js.tests/test/org/jetbrains/k2js/test/TestWithEnvironment.java
...sts/test/org/jetbrains/k2js/test/TestWithEnvironment.java
+3
-3
未找到文件。
compiler/tests/org/jetbrains/jet/JetLiteFixture.java
浏览文件 @
f4527b81
...
...
@@ -69,18 +69,18 @@ public abstract class JetLiteFixture extends UsefulTestCase {
super
.
setUp
();
}
protected
void
createEnvironmentWithMockJdk
()
{
protected
void
createEnvironmentWithMockJdk
AndIdeaAnnotations
()
{
if
(
myEnvironment
!=
null
)
{
throw
new
IllegalStateException
(
"must not set up myEnvironemnt twice"
);
}
myEnvironment
=
JetTestUtils
.
createEnvironmentWithMockJdk
(
getTestRootDisposable
());
myEnvironment
=
JetTestUtils
.
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
getTestRootDisposable
());
}
protected
void
createEnvironmentWithMockJdk
(
@NotNull
CompilerSpecialMode
compilerSpecialMode
)
{
protected
void
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
@NotNull
CompilerSpecialMode
compilerSpecialMode
)
{
if
(
myEnvironment
!=
null
)
{
throw
new
IllegalStateException
(
"must not set up myEnvironemnt twice"
);
}
myEnvironment
=
JetTestUtils
.
createEnvironmentWithMockJdk
(
getTestRootDisposable
(),
compilerSpecialMode
);
myEnvironment
=
JetTestUtils
.
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
getTestRootDisposable
(),
compilerSpecialMode
);
}
protected
void
createEnvironmentWithFullJdk
()
{
...
...
compiler/tests/org/jetbrains/jet/JetTestUtils.java
浏览文件 @
f4527b81
...
...
@@ -166,11 +166,11 @@ public class JetTestUtils {
CompileCompilerDependenciesTest
.
compilerDependenciesForTests
(
CompilerSpecialMode
.
REGULAR
,
true
));
}
public
static
JetCoreEnvironment
createEnvironmentWithMockJdk
(
Disposable
disposable
)
{
return
createEnvironmentWithMockJdk
(
disposable
,
CompilerSpecialMode
.
REGULAR
);
public
static
JetCoreEnvironment
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
Disposable
disposable
)
{
return
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
disposable
,
CompilerSpecialMode
.
REGULAR
);
}
public
static
JetCoreEnvironment
createEnvironmentWithMockJdk
(
Disposable
disposable
,
@NotNull
CompilerSpecialMode
compilerSpecialMode
)
{
public
static
JetCoreEnvironment
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
Disposable
disposable
,
@NotNull
CompilerSpecialMode
compilerSpecialMode
)
{
JetCoreEnvironment
environment
=
new
JetCoreEnvironment
(
disposable
,
CompileCompilerDependenciesTest
.
compilerDependenciesForTests
(
compilerSpecialMode
,
true
));
environment
.
addToClasspath
(
getAnnotationsJar
());
...
...
compiler/tests/org/jetbrains/jet/cfg/JetControlFlowTest.java
浏览文件 @
f4527b81
...
...
@@ -55,7 +55,7 @@ public class JetControlFlowTest extends JetLiteFixture {
@Override
protected
void
setUp
()
throws
Exception
{
super
.
setUp
();
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
STDLIB
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
STDLIB
);
}
@Override
...
...
compiler/tests/org/jetbrains/jet/checkers/CheckerTestUtilTest.java
浏览文件 @
f4527b81
...
...
@@ -43,7 +43,7 @@ public class CheckerTestUtilTest extends JetLiteFixture {
@Override
protected
void
setUp
()
throws
Exception
{
super
.
setUp
();
createEnvironmentWithMockJdk
();
createEnvironmentWithMockJdk
AndIdeaAnnotations
();
}
...
...
compiler/tests/org/jetbrains/jet/checkers/JetDiagnosticsTest.java
浏览文件 @
f4527b81
...
...
@@ -27,7 +27,6 @@ import com.intellij.psi.PsiFileFactory;
import
junit.framework.Test
;
import
org.jetbrains.annotations.NonNls
;
import
org.jetbrains.annotations.NotNull
;
import
org.jetbrains.jet.CompileCompilerDependenciesTest
;
import
org.jetbrains.jet.JetLiteFixture
;
import
org.jetbrains.jet.JetTestCaseBuilder
;
import
org.jetbrains.jet.JetTestUtils
;
...
...
@@ -57,7 +56,7 @@ public class JetDiagnosticsTest extends JetLiteFixture {
@Override
protected
void
setUp
()
throws
Exception
{
super
.
setUp
();
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
STDLIB
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
STDLIB
);
}
@Override
...
...
compiler/tests/org/jetbrains/jet/cli/jvm/compiler/CompileJavaAgainstKotlinTest.java
浏览文件 @
f4527b81
...
...
@@ -67,7 +67,7 @@ public class CompileJavaAgainstKotlinTest extends TestCaseWithTmpdir {
@Override
protected
void
runTest
()
throws
Throwable
{
jetCoreEnvironment
=
JetTestUtils
.
createEnvironmentWithMockJdk
(
myTestRootDisposable
);
jetCoreEnvironment
=
JetTestUtils
.
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
myTestRootDisposable
);
String
text
=
FileUtil
.
loadFile
(
ktFile
);
...
...
compiler/tests/org/jetbrains/jet/cli/jvm/compiler/CompileKotlinAgainstKotlinTest.java
浏览文件 @
f4527b81
...
...
@@ -82,7 +82,7 @@ public class CompileKotlinAgainstKotlinTest extends TestCaseWithTmpdir {
}
private
void
compileA
()
throws
IOException
{
JetCoreEnvironment
jetCoreEnvironment
=
JetTestUtils
.
createEnvironmentWithMockJdk
(
myTestRootDisposable
);
JetCoreEnvironment
jetCoreEnvironment
=
JetTestUtils
.
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
myTestRootDisposable
);
String
text
=
FileUtil
.
loadFile
(
ktAFile
);
...
...
@@ -98,7 +98,7 @@ public class CompileKotlinAgainstKotlinTest extends TestCaseWithTmpdir {
}
private
void
compileB
()
throws
IOException
{
JetCoreEnvironment
jetCoreEnvironment
=
JetTestUtils
.
createEnvironmentWithMockJdk
(
myTestRootDisposable
);
JetCoreEnvironment
jetCoreEnvironment
=
JetTestUtils
.
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
myTestRootDisposable
);
jetCoreEnvironment
.
addToClasspath
(
aDir
);
...
...
compiler/tests/org/jetbrains/jet/cli/jvm/compiler/JavaDescriptorResolverTest.java
浏览文件 @
f4527b81
...
...
@@ -17,7 +17,6 @@
package
org.jetbrains.jet.cli.jvm.compiler
;
import
org.jetbrains.annotations.NotNull
;
import
org.jetbrains.jet.CompileCompilerDependenciesTest
;
import
org.jetbrains.jet.JetTestUtils
;
import
org.jetbrains.jet.di.InjectorForJavaSemanticServices
;
import
org.jetbrains.jet.lang.descriptors.ClassDescriptor
;
...
...
@@ -50,7 +49,7 @@ public class JavaDescriptorResolverTest extends TestCaseWithTmpdir {
private
void
compileFileResolveDescriptor
(
@NotNull
String
fileRelativePath
,
@NotNull
FqName
fqName
)
throws
IOException
{
compileJavaFile
(
new
File
(
"compiler/testData/javaDescriptorResolver/"
+
fileRelativePath
),
tmpdir
);
JetCoreEnvironment
jetCoreEnvironment
=
JetTestUtils
.
createEnvironmentWithMockJdk
(
myTestRootDisposable
,
CompilerSpecialMode
.
JDK_HEADERS
);
JetCoreEnvironment
jetCoreEnvironment
=
JetTestUtils
.
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
myTestRootDisposable
,
CompilerSpecialMode
.
JDK_HEADERS
);
jetCoreEnvironment
.
addToClasspath
(
tmpdir
);
InjectorForJavaSemanticServices
injector
=
new
InjectorForJavaSemanticServices
(
...
...
compiler/tests/org/jetbrains/jet/cli/jvm/compiler/ReadJavaBinaryClassTest.java
浏览文件 @
f4527b81
...
...
@@ -23,7 +23,6 @@ import com.intellij.psi.impl.PsiFileFactoryImpl;
import
com.intellij.testFramework.LightVirtualFile
;
import
junit.framework.Test
;
import
org.jetbrains.annotations.NotNull
;
import
org.jetbrains.jet.CompileCompilerDependenciesTest
;
import
org.jetbrains.jet.JetTestCaseBuilder
;
import
org.jetbrains.jet.JetTestUtils
;
import
org.jetbrains.jet.di.InjectorForJavaSemanticServices
;
...
...
@@ -78,7 +77,7 @@ public class ReadJavaBinaryClassTest extends TestCaseWithTmpdir {
@NotNull
private
NamespaceDescriptor
compileKotlin
()
throws
Exception
{
JetCoreEnvironment
jetCoreEnvironment
=
JetTestUtils
.
createEnvironmentWithMockJdk
(
myTestRootDisposable
,
CompilerSpecialMode
.
JDK_HEADERS
);
JetCoreEnvironment
jetCoreEnvironment
=
JetTestUtils
.
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
myTestRootDisposable
,
CompilerSpecialMode
.
JDK_HEADERS
);
String
text
=
FileUtil
.
loadFile
(
ktFile
);
...
...
@@ -110,7 +109,7 @@ public class ReadJavaBinaryClassTest extends TestCaseWithTmpdir {
fileManager
.
close
();
}
JetCoreEnvironment
jetCoreEnvironment
=
JetTestUtils
.
createEnvironmentWithMockJdk
(
myTestRootDisposable
,
CompilerSpecialMode
.
JDK_HEADERS
);
JetCoreEnvironment
jetCoreEnvironment
=
JetTestUtils
.
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
myTestRootDisposable
,
CompilerSpecialMode
.
JDK_HEADERS
);
jetCoreEnvironment
.
addToClasspath
(
tmpdir
);
jetCoreEnvironment
.
addToClasspath
(
new
File
(
"out/production/runtime"
));
...
...
compiler/tests/org/jetbrains/jet/cli/jvm/compiler/ReadKotlinBinaryClassTest.java
浏览文件 @
f4527b81
...
...
@@ -25,7 +25,6 @@ import com.intellij.testFramework.LightVirtualFile;
import
junit.framework.Assert
;
import
junit.framework.Test
;
import
org.jetbrains.annotations.NotNull
;
import
org.jetbrains.jet.CompileCompilerDependenciesTest
;
import
org.jetbrains.jet.JetTestCaseBuilder
;
import
org.jetbrains.jet.JetTestUtils
;
import
org.jetbrains.jet.codegen.ClassFileFactory
;
...
...
@@ -63,7 +62,7 @@ public class ReadKotlinBinaryClassTest extends TestCaseWithTmpdir {
@Override
public
void
runTest
()
throws
Exception
{
jetCoreEnvironment
=
JetTestUtils
.
createEnvironmentWithMockJdk
(
myTestRootDisposable
,
CompilerSpecialMode
.
JDK_HEADERS
);
jetCoreEnvironment
=
JetTestUtils
.
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
myTestRootDisposable
,
CompilerSpecialMode
.
JDK_HEADERS
);
String
text
=
FileUtil
.
loadFile
(
testFile
);
...
...
@@ -84,7 +83,7 @@ public class ReadKotlinBinaryClassTest extends TestCaseWithTmpdir {
Disposer
.
dispose
(
myTestRootDisposable
);
jetCoreEnvironment
=
JetTestUtils
.
createEnvironmentWithMockJdk
(
myTestRootDisposable
,
CompilerSpecialMode
.
JDK_HEADERS
);
jetCoreEnvironment
=
JetTestUtils
.
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
myTestRootDisposable
,
CompilerSpecialMode
.
JDK_HEADERS
);
jetCoreEnvironment
.
addToClasspath
(
tmpdir
);
jetCoreEnvironment
.
addToClasspath
(
new
File
(
"out/production/runtime"
));
...
...
compiler/tests/org/jetbrains/jet/cli/jvm/compiler/WriteSignatureTest.java
浏览文件 @
f4527b81
...
...
@@ -72,7 +72,7 @@ public class WriteSignatureTest extends TestCaseWithTmpdir {
@Override
protected
void
runTest
()
throws
Throwable
{
jetCoreEnvironment
=
JetTestUtils
.
createEnvironmentWithMockJdk
(
myTestRootDisposable
);
jetCoreEnvironment
=
JetTestUtils
.
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
myTestRootDisposable
);
String
text
=
FileUtil
.
loadFile
(
ktFile
);
...
...
compiler/tests/org/jetbrains/jet/cli/jvm/compiler/longTest/ResolveDescriptorsFromExternalLibraries.java
浏览文件 @
f4527b81
...
...
@@ -119,7 +119,7 @@ public class ResolveDescriptorsFromExternalLibraries {
JetCoreEnvironment
jetCoreEnvironment
;
if
(
jar
!=
null
)
{
jetCoreEnvironment
=
JetTestUtils
.
createEnvironmentWithMockJdk
(
junk
,
CompilerSpecialMode
.
STDLIB
);
jetCoreEnvironment
=
JetTestUtils
.
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
junk
,
CompilerSpecialMode
.
STDLIB
);
jetCoreEnvironment
.
addToClasspath
(
jar
);
}
else
{
...
...
compiler/tests/org/jetbrains/jet/codegen/AnnotationGenTest.java
浏览文件 @
f4527b81
...
...
@@ -29,7 +29,7 @@ public class AnnotationGenTest extends CodegenTestCase {
@Override
protected
void
setUp
()
throws
Exception
{
super
.
setUp
();
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
}
public
void
testPropField
()
throws
NoSuchFieldException
,
NoSuchMethodException
{
...
...
compiler/tests/org/jetbrains/jet/codegen/ArrayGenTest.java
浏览文件 @
f4527b81
...
...
@@ -25,7 +25,7 @@ public class ArrayGenTest extends CodegenTestCase {
@Override
protected
void
setUp
()
throws
Exception
{
super
.
setUp
();
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
}
public
void
testKt238
()
throws
Exception
{
...
...
compiler/tests/org/jetbrains/jet/codegen/BridgeMethodGenTest.java
浏览文件 @
f4527b81
...
...
@@ -20,7 +20,7 @@ import org.jetbrains.jet.lang.resolve.java.CompilerSpecialMode;
public
class
BridgeMethodGenTest
extends
CodegenTestCase
{
public
void
testBridgeMethod
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
blackBoxFile
(
"bridge.jet"
);
}
}
compiler/tests/org/jetbrains/jet/codegen/ClassGenTest.java
浏览文件 @
f4527b81
...
...
@@ -35,7 +35,7 @@ public class ClassGenTest extends CodegenTestCase {
}
public
void
testPSVMClass
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
loadFile
(
"classes/simpleClass.jet"
);
final
Class
aClass
=
loadClass
(
"SimpleClass"
,
generateClassesInFile
());
...
...
@@ -46,7 +46,7 @@ public class ClassGenTest extends CodegenTestCase {
}
public
void
testArrayListInheritance
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
loadFile
(
"classes/inheritingFromArrayList.jet"
);
// System.out.println(generateToText());
final
Class
aClass
=
loadClass
(
"Foo"
,
generateClassesInFile
());
...
...
@@ -54,37 +54,37 @@ public class ClassGenTest extends CodegenTestCase {
}
public
void
testInheritanceAndDelegation_DelegatingDefaultConstructorProperties
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
blackBoxFile
(
"classes/inheritance.jet"
);
}
public
void
testInheritanceAndDelegation2
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
blackBoxFile
(
"classes/delegation2.kt"
);
}
public
void
testFunDelegation
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
blackBoxFile
(
"classes/funDelegation.jet"
);
}
public
void
testPropertyDelegation
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
blackBoxFile
(
"classes/propertyDelegation.jet"
);
}
public
void
testDiamondInheritance
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
blackBoxFile
(
"classes/diamondInheritance.jet"
);
}
public
void
testRightHandOverride
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
blackBoxFile
(
"classes/rightHandOverride.jet"
);
}
public
void
testNewInstanceExplicitConstructor
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
loadFile
(
"classes/newInstanceDefaultConstructor.jet"
);
// System.out.println(generateToText());
final
Method
method
=
generateFunction
(
"test"
);
...
...
@@ -93,22 +93,22 @@ public class ClassGenTest extends CodegenTestCase {
}
public
void
testInnerClass
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
blackBoxFile
(
"classes/innerClass.jet"
);
}
public
void
testInheritedInnerClass
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
blackBoxFile
(
"classes/inheritedInnerClass.jet"
);
}
public
void
testInitializerBlock
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
blackBoxFile
(
"classes/initializerBlock.jet"
);
}
public
void
testAbstractMethod
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
loadText
(
"abstract class Foo { abstract fun x(): String; fun y(): Int = 0 }"
);
final
ClassFileFactory
codegens
=
generateClassesInFile
();
...
...
@@ -118,42 +118,42 @@ public class ClassGenTest extends CodegenTestCase {
}
public
void
testInheritedMethod
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
blackBoxFile
(
"classes/inheritedMethod.jet"
);
}
public
void
testInitializerBlockDImpl
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
blackBoxFile
(
"classes/initializerBlockDImpl.jet"
);
}
public
void
testPropertyInInitializer
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
blackBoxFile
(
"classes/propertyInInitializer.jet"
);
}
public
void
testOuterThis
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
blackBoxFile
(
"classes/outerThis.jet"
);
}
public
void
testSecondaryConstructors
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
blackBoxFile
(
"classes/secondaryConstructors.jet"
);
}
public
void
testExceptionConstructor
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
blackBoxFile
(
"classes/exceptionConstructor.jet"
);
}
public
void
testSimpleBox
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
blackBoxFile
(
"classes/simpleBox.jet"
);
}
public
void
testAbstractClass
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
loadText
(
"abstract class SimpleClass() { }"
);
final
Class
aClass
=
createClassLoader
(
generateClassesInFile
()).
loadClass
(
"SimpleClass"
);
...
...
@@ -161,18 +161,18 @@ public class ClassGenTest extends CodegenTestCase {
}
public
void
testClassObject
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
blackBoxFile
(
"classes/classObject.jet"
);
}
public
void
testClassObjectMethod
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
// todo to be implemented after removal of type info
// blackBoxFile("classes/classObjectMethod.jet");
}
public
void
testClassObjectInterface
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
loadFile
(
"classes/classObjectInterface.jet"
);
final
Method
method
=
generateFunction
();
Object
result
=
method
.
invoke
(
null
);
...
...
@@ -180,32 +180,32 @@ public class ClassGenTest extends CodegenTestCase {
}
public
void
testOverloadBinaryOperator
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
blackBoxFile
(
"classes/overloadBinaryOperator.jet"
);
}
public
void
testOverloadUnaryOperator
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
blackBoxFile
(
"classes/overloadUnaryOperator.jet"
);
}
public
void
testOverloadPlusAssign
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
blackBoxFile
(
"classes/overloadPlusAssign.jet"
);
}
public
void
testOverloadPlusAssignReturn
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
blackBoxFile
(
"classes/overloadPlusAssignReturn.jet"
);
}
public
void
testOverloadPlusToPlusAssign
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
blackBoxFile
(
"classes/overloadPlusToPlusAssign.jet"
);
}
public
void
testEnumClass
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
loadText
(
"enum class Direction { NORTH; SOUTH; EAST; WEST }"
);
final
Class
direction
=
createClassLoader
(
generateClassesInFile
()).
loadClass
(
"Direction"
);
// System.out.println(generateToText());
...
...
@@ -215,7 +215,7 @@ public class ClassGenTest extends CodegenTestCase {
}
public
void
testEnumConstantConstructors
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
loadText
(
"enum class Color(val rgb: Int) { RED: Color(0xFF0000); GREEN: Color(0x00FF00); }"
);
final
Class
colorClass
=
createClassLoader
(
generateClassesInFile
()).
loadClass
(
"Color"
);
final
Field
redField
=
colorClass
.
getField
(
"RED"
);
...
...
@@ -225,25 +225,25 @@ public class ClassGenTest extends CodegenTestCase {
}
public
void
testClassObjFields
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
loadText
(
"class A() { class object { val value = 10 } }\n"
+
"fun box() = if(A.value == 10) \"OK\" else \"fail\""
);
blackBox
();
}
public
void
testKt249
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
blackBoxFile
(
"regressions/kt249.jet"
);
}
public
void
testKt48
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
blackBoxFile
(
"regressions/kt48.jet"
);
// System.out.println(generateToText());
}
public
void
testKt309
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
loadText
(
"fun box() = null"
);
final
Method
method
=
generateFunction
(
"box"
);
assertEquals
(
method
.
getReturnType
().
getName
(),
"java.lang.Object"
);
...
...
@@ -251,73 +251,73 @@ public class ClassGenTest extends CodegenTestCase {
}
public
void
testKt343
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
blackBoxFile
(
"regressions/kt343.jet"
);
// System.out.println(generateToText());
}
public
void
testKt508
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
loadFile
(
"regressions/kt508.jet"
);
// System.out.println(generateToText());
blackBox
();
}
public
void
testKt504
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
loadFile
(
"regressions/kt504.jet"
);
// System.out.println(generateToText());
blackBox
();
}
public
void
testKt501
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
blackBoxFile
(
"regressions/kt501.jet"
);
}
public
void
testKt496
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
blackBoxFile
(
"regressions/kt496.jet"
);
// System.out.println(generateToText());
}
public
void
testKt500
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
blackBoxFile
(
"regressions/kt500.jet"
);
}
public
void
testKt694
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
// blackBoxFile("regressions/kt694.jet");
}
public
void
testKt285
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
// blackBoxFile("regressions/kt285.jet");
}
public
void
testKt707
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
blackBoxFile
(
"regressions/kt707.jet"
);
}
public
void
testKt857
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
// blackBoxFile("regressions/kt857.jet");
}
public
void
testKt903
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
blackBoxFile
(
"regressions/kt903.jet"
);
}
public
void
testKt940
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
blackBoxFile
(
"regressions/kt940.kt"
);
}
public
void
testKt1018
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
blackBoxFile
(
"regressions/kt1018.kt"
);
}
...
...
@@ -332,58 +332,58 @@ public class ClassGenTest extends CodegenTestCase {
}
public
void
testKt1134
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
blackBoxFile
(
"regressions/kt1134.kt"
);
}
public
void
testKt1157
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
blackBoxFile
(
"regressions/kt1157.kt"
);
}
public
void
testKt471
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
blackBoxFile
(
"regressions/kt471.kt"
);
}
public
void
testKt1213
()
throws
Exception
{
createEnvironmentWithMockJdk
();
createEnvironmentWithMockJdk
AndIdeaAnnotations
();
// blackBoxFile("regressions/kt1213.kt");
}
public
void
testKt723
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
blackBoxFile
(
"regressions/kt723.kt"
);
}
public
void
testKt725
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
blackBoxFile
(
"regressions/kt725.kt"
);
}
public
void
testKt633
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
blackBoxFile
(
"regressions/kt633.kt"
);
}
public
void
testKt1345
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
blackBoxFile
(
"regressions/kt1345.kt"
);
}
public
void
testKt1538
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
blackBoxFile
(
"regressions/kt1538.kt"
);
}
public
void
testKt1759
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
blackBoxFile
(
"regressions/kt1759.kt"
);
}
public
void
testResolveOrder
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
blackBoxFile
(
"classes/resolveOrder.jet"
);
}
}
compiler/tests/org/jetbrains/jet/codegen/ClosuresGenTest.java
浏览文件 @
f4527b81
...
...
@@ -26,7 +26,7 @@ public class ClosuresGenTest extends CodegenTestCase {
@Override
protected
void
setUp
()
throws
Exception
{
super
.
setUp
();
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
}
public
void
testSimplestClosure
()
throws
Exception
{
...
...
compiler/tests/org/jetbrains/jet/codegen/CompileTextTest.java
浏览文件 @
f4527b81
...
...
@@ -25,7 +25,7 @@ import java.lang.reflect.Method;
public
class
CompileTextTest
extends
CodegenTestCase
{
public
void
testMe
()
throws
ClassNotFoundException
,
NoSuchMethodException
,
InvocationTargetException
,
IllegalAccessException
{
createEnvironmentWithMockJdk
();
createEnvironmentWithMockJdk
AndIdeaAnnotations
();
String
text
=
"import org.jetbrains.jet.codegen.CompileTextTest; fun x() = CompileTextTest()"
;
K2JVMCompileEnvironmentConfiguration
configuration
=
new
K2JVMCompileEnvironmentConfiguration
(
myEnvironment
,
MessageCollector
.
PLAIN_TEXT_TO_SYSTEM_ERR
);
...
...
compiler/tests/org/jetbrains/jet/codegen/ControlStructuresTest.java
浏览文件 @
f4527b81
...
...
@@ -33,7 +33,7 @@ public class ControlStructuresTest extends CodegenTestCase {
}
public
void
testIf
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
loadFile
();
// System.out.println(generateToText());
...
...
@@ -43,7 +43,7 @@ public class ControlStructuresTest extends CodegenTestCase {
}
public
void
testSingleBranchIf
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
loadFile
();
// System.out.println(generateToText());
...
...
@@ -65,7 +65,7 @@ public class ControlStructuresTest extends CodegenTestCase {
}
private
void
factorialTest
(
final
String
name
)
throws
IllegalAccessException
,
InvocationTargetException
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
loadFile
(
name
);
// System.out.println(generateToText());
...
...
@@ -75,7 +75,7 @@ public class ControlStructuresTest extends CodegenTestCase {
}
public
void
testContinue
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
loadFile
();
// System.out.println(generateToText());
final
Method
main
=
generateFunction
();
...
...
@@ -84,7 +84,7 @@ public class ControlStructuresTest extends CodegenTestCase {
}
public
void
testIfNoElse
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
loadFile
();
// System.out.println(generateToText());
final
Method
main
=
generateFunction
();
...
...
@@ -93,7 +93,7 @@ public class ControlStructuresTest extends CodegenTestCase {
}
public
void
testCondJumpOnStack
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
loadText
(
"import java.lang.Boolean as jlBoolean; fun foo(a: String): Int = if (jlBoolean.parseBoolean(a)) 5 else 10"
);
final
Method
main
=
generateFunction
();
assertEquals
(
5
,
main
.
invoke
(
null
,
"true"
));
...
...
@@ -101,7 +101,7 @@ public class ControlStructuresTest extends CodegenTestCase {
}
public
void
testFor
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
loadFile
();
// System.out.println(generateToText());
final
Method
main
=
generateFunction
();
...
...
@@ -110,7 +110,7 @@ public class ControlStructuresTest extends CodegenTestCase {
}
public
void
testIfBlock
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
loadFile
();
// System.out.println(generateToText());
final
Method
main
=
generateFunction
();
...
...
@@ -121,7 +121,7 @@ public class ControlStructuresTest extends CodegenTestCase {
}
public
void
testForInArray
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
loadFile
();
// System.out.println(generateToText());
final
Method
main
=
generateFunction
();
...
...
@@ -130,7 +130,7 @@ public class ControlStructuresTest extends CodegenTestCase {
}
public
void
testForInRange
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
loadText
(
"fun foo(sb: StringBuilder) { for(x in 1..4) sb.append(x) }"
);
final
Method
main
=
generateFunction
();
StringBuilder
stringBuilder
=
new
StringBuilder
();
...
...
@@ -139,7 +139,7 @@ public class ControlStructuresTest extends CodegenTestCase {
}
public
void
testThrowCheckedException
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
loadText
(
"fun foo() { throw Exception(); }"
);
final
Method
main
=
generateFunction
();
boolean
caught
=
false
;
...
...
@@ -154,7 +154,7 @@ public class ControlStructuresTest extends CodegenTestCase {
}
public
void
testTryCatch
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
loadFile
();
// System.out.println(generateToText());
final
Method
main
=
generateFunction
();
...
...
@@ -163,7 +163,7 @@ public class ControlStructuresTest extends CodegenTestCase {
}
public
void
testTryFinally
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
loadFile
();
// System.out.println(generateToText());
final
Method
main
=
generateFunction
();
...
...
@@ -183,37 +183,37 @@ public class ControlStructuresTest extends CodegenTestCase {
}
public
void
testForUserType
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
blackBoxFile
(
"controlStructures/forUserType.jet"
);
}
public
void
testForIntArray
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
blackBoxFile
(
"controlStructures/forIntArray.jet"
);
}
public
void
testForPrimitiveIntArray
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
blackBoxFile
(
"controlStructures/forPrimitiveIntArray.jet"
);
}
public
void
testForNullableIntArray
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
blackBoxFile
(
"controlStructures/forNullableIntArray.jet"
);
}
public
void
testForIntRange
()
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
blackBoxFile
(
"controlStructures/forIntRange.jet"
);
}
public
void
testKt237
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
blackBoxFile
(
"regressions/kt237.jet"
);
}
public
void
testCompareToNull
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
loadText
(
"fun foo(a: String?, b: String?): Boolean = a == null && b !== null && null == a && null !== b"
);
String
text
=
generateToText
();
assertTrue
(!
text
.
contains
(
"java/lang/Object.equals"
));
...
...
@@ -224,7 +224,7 @@ public class ControlStructuresTest extends CodegenTestCase {
}
public
void
testCompareToNonnullableEq
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
loadText
(
"fun foo(a: String?, b: String): Boolean = a == b || b == a"
);
// System.out.println(generateToText());
final
Method
main
=
generateFunction
();
...
...
@@ -233,7 +233,7 @@ public class ControlStructuresTest extends CodegenTestCase {
}
public
void
testCompareToNonnullableNotEq
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
loadText
(
"fun foo(a: String?, b: String): Boolean = a != b"
);
String
text
=
generateToText
();
// System.out.println(text);
...
...
@@ -244,18 +244,18 @@ public class ControlStructuresTest extends CodegenTestCase {
}
public
void
testKt299
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
blackBoxFile
(
"regressions/kt299.jet"
);
}
public
void
testKt416
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
blackBoxFile
(
"regressions/kt416.jet"
);
// System.out.println(generateToText());
}
public
void
testKt513
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
blackBoxFile
(
"regressions/kt513.jet"
);
}
...
...
@@ -265,37 +265,37 @@ public class ControlStructuresTest extends CodegenTestCase {
}
public
void
testKt769
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
blackBoxFile
(
"regressions/kt769.jet"
);
// System.out.println(generateToText());
}
public
void
testKt773
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
blackBoxFile
(
"regressions/kt773.jet"
);
// System.out.println(generateToText());
}
public
void
testKt772
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
blackBoxFile
(
"regressions/kt772.jet"
);
// System.out.println(generateToText());
}
public
void
testKt870
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
blackBoxFile
(
"regressions/kt870.jet"
);
// System.out.println(generateToText());
}
public
void
testKt958
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
blackBoxFile
(
"regressions/kt958.jet"
);
// System.out.println(generateToText());
}
public
void
testQuicksort
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
blackBoxFile
(
"controlStructures/quicksort.jet"
);
// System.out.println(generateToText());
}
...
...
@@ -313,22 +313,22 @@ public class ControlStructuresTest extends CodegenTestCase {
}
public
void
testKt1076
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
blackBoxFile
(
"regressions/kt1076.kt"
);
}
public
void
testKt998
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
blackBoxFile
(
"regressions/kt998.kt"
);
}
public
void
testKt628
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
blackBoxFile
(
"regressions/kt628.kt"
);
}
public
void
testKt1441
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
blackBoxFile
(
"regressions/kt1441.kt"
);
}
}
compiler/tests/org/jetbrains/jet/codegen/ExtensionFunctionsTest.java
浏览文件 @
f4527b81
...
...
@@ -31,7 +31,7 @@ public class ExtensionFunctionsTest extends CodegenTestCase {
}
public
void
testSimple
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
loadFile
();
final
Method
foo
=
generateFunction
(
"foo"
);
final
Character
c
=
(
Character
)
foo
.
invoke
(
null
);
...
...
@@ -39,7 +39,7 @@ public class ExtensionFunctionsTest extends CodegenTestCase {
}
public
void
testWhenFail
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
loadFile
();
// System.out.println(generateToText());
Method
foo
=
generateFunction
(
"foo"
);
...
...
@@ -47,18 +47,18 @@ public class ExtensionFunctionsTest extends CodegenTestCase {
}
public
void
testVirtual
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
blackBoxFile
(
"extensionFunctions/virtual.jet"
);
}
public
void
testShared
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
blackBoxFile
(
"extensionFunctions/shared.kt"
);
// System.out.println(generateToText());
}
public
void
testKt475
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
blackBoxFile
(
"regressions/kt475.jet"
);
}
...
...
@@ -73,11 +73,11 @@ public class ExtensionFunctionsTest extends CodegenTestCase {
}
public
void
testKtNested2
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
BUILTINS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
BUILTINS
);
blackBoxFile
(
"extensionFunctions/nested2.kt"
);
}
public
void
testKt606
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
BUILTINS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
BUILTINS
);
blackBoxFile
(
"regressions/kt606.kt"
);
}
}
compiler/tests/org/jetbrains/jet/codegen/FunctionGenTest.java
浏览文件 @
f4527b81
...
...
@@ -28,7 +28,7 @@ public class FunctionGenTest extends CodegenTestCase {
@Override
protected
void
setUp
()
throws
Exception
{
super
.
setUp
();
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
}
public
void
testDefaultArgs
()
throws
Exception
{
...
...
compiler/tests/org/jetbrains/jet/codegen/JdkHeadersTest.java
浏览文件 @
f4527b81
...
...
@@ -28,7 +28,7 @@ public class JdkHeadersTest extends CodegenTestCase {
@Override
protected
void
setUp
()
throws
Exception
{
super
.
setUp
();
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
STDLIB
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
STDLIB
);
}
public
void
testArrayList
()
{
...
...
compiler/tests/org/jetbrains/jet/codegen/NamespaceGenTest.java
浏览文件 @
f4527b81
...
...
@@ -35,7 +35,7 @@ public class NamespaceGenTest extends CodegenTestCase {
@Override
protected
void
setUp
()
throws
Exception
{
super
.
setUp
();
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
}
public
void
testPSVM
()
throws
Exception
{
...
...
compiler/tests/org/jetbrains/jet/codegen/ObjectGenTest.java
浏览文件 @
f4527b81
...
...
@@ -26,7 +26,7 @@ public class ObjectGenTest extends CodegenTestCase {
@Override
protected
void
setUp
()
throws
Exception
{
super
.
setUp
();
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
}
public
void
testSimpleObject
()
throws
Exception
{
...
...
compiler/tests/org/jetbrains/jet/codegen/PatternMatchingTest.java
浏览文件 @
f4527b81
...
...
@@ -29,7 +29,7 @@ public class PatternMatchingTest extends CodegenTestCase {
@Override
protected
void
setUp
()
throws
Exception
{
super
.
setUp
();
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
}
@Override
...
...
compiler/tests/org/jetbrains/jet/codegen/PrimitiveTypesTest.java
浏览文件 @
f4527b81
...
...
@@ -29,7 +29,7 @@ public class PrimitiveTypesTest extends CodegenTestCase {
@Override
protected
void
setUp
()
throws
Exception
{
super
.
setUp
();
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
}
public
void
testPlus
()
throws
Exception
{
...
...
compiler/tests/org/jetbrains/jet/codegen/PropertyGenTest.java
浏览文件 @
f4527b81
...
...
@@ -33,7 +33,7 @@ public class PropertyGenTest extends CodegenTestCase {
}
public
void
testPrivateVal
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
loadFile
();
final
Class
aClass
=
loadImplementationClass
(
generateClassesInFile
(),
"PrivateVal"
);
final
Field
[]
fields
=
aClass
.
getDeclaredFields
();
...
...
@@ -43,7 +43,7 @@ public class PropertyGenTest extends CodegenTestCase {
}
public
void
testPrivateVar
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
loadFile
();
final
Class
aClass
=
loadImplementationClass
(
generateClassesInFile
(),
"PrivateVar"
);
final
Object
instance
=
aClass
.
newInstance
();
...
...
@@ -54,7 +54,7 @@ public class PropertyGenTest extends CodegenTestCase {
}
public
void
testPublicVar
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
loadText
(
"class PublicVar() { public var foo : Int = 0; }"
);
final
Class
aClass
=
loadImplementationClass
(
generateClassesInFile
(),
"PublicVar"
);
final
Object
instance
=
aClass
.
newInstance
();
...
...
@@ -65,7 +65,7 @@ public class PropertyGenTest extends CodegenTestCase {
}
public
void
testAccessorsInInterface
()
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
loadText
(
"class AccessorsInInterface() { public var foo : Int = 0; }"
);
final
Class
aClass
=
loadClass
(
"AccessorsInInterface"
,
generateClassesInFile
());
assertNotNull
(
findMethodByName
(
aClass
,
"getFoo"
));
...
...
@@ -73,7 +73,7 @@ public class PropertyGenTest extends CodegenTestCase {
}
public
void
testPrivatePropertyInNamespace
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
loadText
(
"private val x = 239"
);
final
Class
nsClass
=
generateNamespaceClass
();
final
Field
[]
fields
=
nsClass
.
getDeclaredFields
();
...
...
@@ -86,7 +86,7 @@ public class PropertyGenTest extends CodegenTestCase {
}
public
void
testFieldPropertyAccess
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
loadFile
(
"properties/fieldPropertyAccess.jet"
);
// System.out.println(generateToText());
final
Method
method
=
generateFunction
();
...
...
@@ -95,14 +95,14 @@ public class PropertyGenTest extends CodegenTestCase {
}
public
void
testFieldGetter
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
loadText
(
"val now: Long get() = System.currentTimeMillis(); fun foo() = now"
);
final
Method
method
=
generateFunction
(
"foo"
);
assertIsCurrentTime
((
Long
)
method
.
invoke
(
null
));
}
public
void
testFieldSetter
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
loadFile
();
final
Method
method
=
generateFunction
(
"append"
);
method
.
invoke
(
null
,
"IntelliJ "
);
...
...
@@ -114,7 +114,7 @@ public class PropertyGenTest extends CodegenTestCase {
}
public
void
testFieldSetterPlusEq
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
loadFile
();
final
Method
method
=
generateFunction
(
"append"
);
method
.
invoke
(
null
,
"IntelliJ "
);
...
...
@@ -123,7 +123,7 @@ public class PropertyGenTest extends CodegenTestCase {
}
public
void
testAccessorsWithoutBody
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
loadText
(
"class AccessorsWithoutBody() { protected var foo: Int = 349\n get\n private set\n fun setter() { foo = 610; } } "
);
// System.out.println(generateToText());
final
Class
aClass
=
loadImplementationClass
(
generateClassesInFile
(),
"AccessorsWithoutBody"
);
...
...
@@ -141,7 +141,7 @@ public class PropertyGenTest extends CodegenTestCase {
}
public
void
testInitializersForNamespaceProperties
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
loadText
(
"val x = System.currentTimeMillis()"
);
final
Method
method
=
generateFunction
(
"getX"
);
method
.
setAccessible
(
true
);
...
...
@@ -149,7 +149,7 @@ public class PropertyGenTest extends CodegenTestCase {
}
public
void
testPropertyReceiverOnStack
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
loadFile
();
final
Class
aClass
=
loadImplementationClass
(
generateClassesInFile
(),
"Evaluator"
);
final
Constructor
constructor
=
aClass
.
getConstructor
(
StringBuilder
.
class
);
...
...
@@ -161,7 +161,7 @@ public class PropertyGenTest extends CodegenTestCase {
}
public
void
testAbstractVal
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
loadText
(
"abstract class Foo { public abstract val x: String }"
);
final
ClassFileFactory
codegens
=
generateClassesInFile
();
final
Class
aClass
=
loadClass
(
"Foo"
,
codegens
);
...
...
@@ -169,7 +169,7 @@ public class PropertyGenTest extends CodegenTestCase {
}
public
void
testVolatileProperty
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
loadText
(
"abstract class Foo { public volatile var x: String = \"\"; }"
);
// System.out.println(generateToText());
final
ClassFileFactory
codegens
=
generateClassesInFile
();
...
...
@@ -179,18 +179,18 @@ public class PropertyGenTest extends CodegenTestCase {
}
public
void
testKt257
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
blackBoxFile
(
"regressions/kt257.jet"
);
// System.out.println(generateToText());
}
public
void
testKt613
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
blackBoxFile
(
"regressions/kt613.jet"
);
}
public
void
testKt160
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
loadText
(
"internal val s = java.lang.Double.toString(1.0)"
);
final
Method
method
=
generateFunction
(
"getS"
);
method
.
setAccessible
(
true
);
...
...
@@ -198,12 +198,12 @@ public class PropertyGenTest extends CodegenTestCase {
}
public
void
testKt1165
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
blackBoxFile
(
"regressions/kt1165.kt"
);
}
public
void
testKt1168
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
blackBoxFile
(
"regressions/kt1168.kt"
);
}
...
...
@@ -213,17 +213,17 @@ public class PropertyGenTest extends CodegenTestCase {
}
public
void
testKt1159
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
blackBoxFile
(
"regressions/kt1159.kt"
);
}
public
void
testKt1417
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
blackBoxFile
(
"regressions/kt1417.kt"
);
}
public
void
testKt1398
()
throws
Exception
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
blackBoxFile
(
"regressions/kt1398.kt"
);
}
...
...
compiler/tests/org/jetbrains/jet/codegen/SafeRefTest.java
浏览文件 @
f4527b81
...
...
@@ -22,7 +22,7 @@ public class SafeRefTest extends CodegenTestCase {
@Override
protected
void
setUp
()
throws
Exception
{
super
.
setUp
();
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
}
public
void
test247
()
throws
Exception
{
...
...
compiler/tests/org/jetbrains/jet/codegen/StringsTest.java
浏览文件 @
f4527b81
...
...
@@ -30,7 +30,7 @@ public class StringsTest extends CodegenTestCase {
@Override
protected
void
setUp
()
throws
Exception
{
super
.
setUp
();
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
}
public
void
testAnyToString
()
throws
InvocationTargetException
,
IllegalAccessException
{
...
...
compiler/tests/org/jetbrains/jet/codegen/SuperGenTest.java
浏览文件 @
f4527b81
...
...
@@ -23,7 +23,7 @@ public class SuperGenTest extends CodegenTestCase {
@Override
protected
void
setUp
()
throws
Exception
{
super
.
setUp
();
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
}
public
void
testBasicProperty
()
{
...
...
compiler/tests/org/jetbrains/jet/codegen/TraitsTest.java
浏览文件 @
f4527b81
...
...
@@ -23,7 +23,7 @@ public class TraitsTest extends CodegenTestCase {
@Override
protected
void
setUp
()
throws
Exception
{
super
.
setUp
();
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
}
@Override
...
...
compiler/tests/org/jetbrains/jet/codegen/TupleGenTest.java
浏览文件 @
f4527b81
...
...
@@ -20,7 +20,7 @@ import org.jetbrains.jet.lang.resolve.java.CompilerSpecialMode;
public
class
TupleGenTest
extends
CodegenTestCase
{
public
void
testBasic
()
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
blackBoxFile
(
"/tuples/basic.jet"
);
// System.out.println(generateToText());
}
...
...
compiler/tests/org/jetbrains/jet/codegen/TypeInfoTest.java
浏览文件 @
f4527b81
...
...
@@ -16,7 +16,6 @@
package
org.jetbrains.jet.codegen
;
import
jet.TypeCastException
;
import
org.jetbrains.jet.lang.resolve.java.CompilerSpecialMode
;
import
java.lang.reflect.Method
;
...
...
@@ -30,7 +29,7 @@ public class TypeInfoTest extends CodegenTestCase {
@Override
protected
void
setUp
()
throws
Exception
{
super
.
setUp
();
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
}
@Override
...
...
compiler/tests/org/jetbrains/jet/codegen/VarArgTest.java
浏览文件 @
f4527b81
...
...
@@ -27,7 +27,7 @@ import java.lang.reflect.Method;
*/
public
class
VarArgTest
extends
CodegenTestCase
{
public
void
testStringArray
()
throws
InvocationTargetException
,
IllegalAccessException
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
loadText
(
"fun test(vararg ts: String) = ts"
);
// System.out.println(generateToText());
final
Method
main
=
generateFunction
();
...
...
@@ -36,7 +36,7 @@ public class VarArgTest extends CodegenTestCase {
}
public
void
testIntArray
()
throws
InvocationTargetException
,
IllegalAccessException
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
loadText
(
"fun test(vararg ts: Int) = ts"
);
// System.out.println(generateToText());
final
Method
main
=
generateFunction
();
...
...
@@ -45,7 +45,7 @@ public class VarArgTest extends CodegenTestCase {
}
public
void
testIntArrayKotlinNoArgs
()
throws
InvocationTargetException
,
IllegalAccessException
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
loadText
(
"fun test() = testf(); fun testf(vararg ts: Int) = ts"
);
// System.out.println(generateToText());
final
Method
main
=
generateFunction
(
"test"
);
...
...
@@ -54,7 +54,7 @@ public class VarArgTest extends CodegenTestCase {
}
public
void
testIntArrayKotlin
()
throws
InvocationTargetException
,
IllegalAccessException
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
loadText
(
"fun test() = testf(239, 7); fun testf(vararg ts: Int) = ts"
);
// System.out.println(generateToText());
final
Method
main
=
generateFunction
(
"test"
);
...
...
@@ -65,7 +65,7 @@ public class VarArgTest extends CodegenTestCase {
}
public
void
testNullableIntArrayKotlin
()
throws
InvocationTargetException
,
IllegalAccessException
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
loadText
(
"fun test() = testf(239.toByte(), 7.toByte()); fun testf(vararg ts: Byte?) = ts"
);
// System.out.println(generateToText());
final
Method
main
=
generateFunction
(
"test"
);
...
...
@@ -76,7 +76,7 @@ public class VarArgTest extends CodegenTestCase {
}
public
void
testIntArrayKotlinObj
()
throws
InvocationTargetException
,
IllegalAccessException
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
loadText
(
"fun test() = testf(\"239\"); fun testf(vararg ts: String) = ts"
);
// System.out.println(generateToText());
final
Method
main
=
generateFunction
(
"test"
);
...
...
@@ -86,7 +86,7 @@ public class VarArgTest extends CodegenTestCase {
}
public
void
testArrayT
()
throws
InvocationTargetException
,
IllegalAccessException
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
loadText
(
"fun test() = _array(2, 4); fun <T> _array(vararg elements : T) = elements"
);
// System.out.println(generateToText());
final
Method
main
=
generateFunction
(
"test"
);
...
...
@@ -102,12 +102,12 @@ public class VarArgTest extends CodegenTestCase {
}
public
void
testKt797
()
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
blackBoxFile
(
"regressions/kt796_797.jet"
);
}
public
void
testArrayAsVararg
()
throws
InvocationTargetException
,
IllegalAccessException
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
loadText
(
"private fun asList(vararg elems: String) = elems; fun test(ts: Array<String>) = asList(*ts); "
);
//System.out.println(generateToText());
final
Method
main
=
generateFunction
(
"test"
);
...
...
@@ -116,7 +116,7 @@ public class VarArgTest extends CodegenTestCase {
}
public
void
testArrayAsVararg2
()
throws
InvocationTargetException
,
IllegalAccessException
{
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
JDK_HEADERS
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
JDK_HEADERS
);
loadText
(
"private fun asList(vararg elems: String) = elems; fun test(ts1: Array<String>, ts2: String) = asList(*ts1, ts2); "
);
System
.
out
.
println
(
generateToText
());
final
Method
main
=
generateFunction
(
"test"
);
...
...
compiler/tests/org/jetbrains/jet/resolve/DescriptorRendererTest.java
浏览文件 @
f4527b81
...
...
@@ -18,7 +18,6 @@ package org.jetbrains.jet.resolve;
import
com.intellij.openapi.editor.Document
;
import
com.intellij.openapi.editor.impl.DocumentImpl
;
import
org.jetbrains.jet.CompileCompilerDependenciesTest
;
import
org.jetbrains.jet.JetLiteFixture
;
import
org.jetbrains.jet.JetTestCaseBuilder
;
import
org.jetbrains.jet.JetTestUtils
;
...
...
@@ -30,7 +29,6 @@ import org.jetbrains.jet.lang.psi.JetFile;
import
org.jetbrains.jet.lang.psi.JetVisitorVoid
;
import
org.jetbrains.jet.lang.resolve.BindingContext
;
import
org.jetbrains.jet.lang.resolve.java.AnalyzerFacadeForJVM
;
import
org.jetbrains.jet.lang.resolve.java.CompilerSpecialMode
;
import
java.io.IOException
;
import
java.util.ArrayList
;
...
...
@@ -45,7 +43,7 @@ public class DescriptorRendererTest extends JetLiteFixture {
@Override
protected
void
setUp
()
throws
Exception
{
super
.
setUp
();
createEnvironmentWithMockJdk
();
createEnvironmentWithMockJdk
AndIdeaAnnotations
();
}
...
...
compiler/tests/org/jetbrains/jet/resolve/ExtensibleResolveTestCase.java
浏览文件 @
f4527b81
...
...
@@ -34,7 +34,7 @@ public abstract class ExtensibleResolveTestCase extends JetLiteFixture {
protected
void
setUp
()
throws
Exception
{
super
.
setUp
();
createEnvironmentWithMockJdk
(
CompilerSpecialMode
.
STDLIB
);
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
CompilerSpecialMode
.
STDLIB
);
expectedResolveData
=
getExpectedResolveData
();
}
...
...
compiler/tests/org/jetbrains/jet/runtime/JetNpeTest.java
浏览文件 @
f4527b81
...
...
@@ -25,7 +25,7 @@ public class JetNpeTest extends CodegenTestCase {
@Override
protected
void
setUp
()
throws
Exception
{
super
.
setUp
();
createEnvironmentWithMockJdk
();
createEnvironmentWithMockJdk
AndIdeaAnnotations
();
}
...
...
compiler/tests/org/jetbrains/jet/types/JetDefaultModalityModifiersTest.java
浏览文件 @
f4527b81
...
...
@@ -16,7 +16,6 @@
package
org.jetbrains.jet.types
;
import
org.jetbrains.jet.CompileCompilerDependenciesTest
;
import
org.jetbrains.jet.JetLiteFixture
;
import
org.jetbrains.jet.JetTestUtils
;
import
org.jetbrains.jet.analyzer.AnalyzeExhaust
;
...
...
@@ -27,7 +26,6 @@ import org.jetbrains.jet.lang.psi.*;
import
org.jetbrains.jet.lang.resolve.BindingContext
;
import
org.jetbrains.jet.lang.resolve.DescriptorResolver
;
import
org.jetbrains.jet.lang.resolve.java.AnalyzerFacadeForJVM
;
import
org.jetbrains.jet.lang.resolve.java.CompilerSpecialMode
;
import
org.jetbrains.jet.lang.resolve.scopes.JetScope
;
import
org.jetbrains.jet.lang.resolve.scopes.RedeclarationHandler
;
import
org.jetbrains.jet.lang.resolve.scopes.WritableScope
;
...
...
@@ -45,7 +43,7 @@ public class JetDefaultModalityModifiersTest extends JetLiteFixture {
@Override
public
void
setUp
()
throws
Exception
{
super
.
setUp
();
super
.
createEnvironmentWithMockJdk
();
super
.
createEnvironmentWithMockJdk
AndIdeaAnnotations
();
tc
.
setUp
();
}
...
...
compiler/tests/org/jetbrains/jet/types/JetOverloadTest.java
浏览文件 @
f4527b81
...
...
@@ -40,7 +40,7 @@ public class JetOverloadTest extends JetLiteFixture {
@Override
public
void
setUp
()
throws
Exception
{
super
.
setUp
();
createEnvironmentWithMockJdk
();
createEnvironmentWithMockJdk
AndIdeaAnnotations
();
InjectorForTests
injector
=
new
InjectorForTests
(
getProject
());
library
=
injector
.
getJetStandardLibrary
();
descriptorResolver
=
injector
.
getDescriptorResolver
();
...
...
compiler/tests/org/jetbrains/jet/types/JetOverridingTest.java
浏览文件 @
f4527b81
...
...
@@ -40,7 +40,7 @@ public class JetOverridingTest extends JetLiteFixture {
@Override
public
void
setUp
()
throws
Exception
{
super
.
setUp
();
createEnvironmentWithMockJdk
();
createEnvironmentWithMockJdk
AndIdeaAnnotations
();
InjectorForTests
injector
=
new
InjectorForTests
(
getProject
());
library
=
injector
.
getJetStandardLibrary
();
descriptorResolver
=
injector
.
getDescriptorResolver
();
...
...
compiler/tests/org/jetbrains/jet/types/JetTypeCheckerTest.java
浏览文件 @
f4527b81
...
...
@@ -20,7 +20,6 @@ import com.google.common.collect.Sets;
import
com.intellij.openapi.project.Project
;
import
org.jetbrains.annotations.NotNull
;
import
org.jetbrains.annotations.Nullable
;
import
org.jetbrains.jet.CompileCompilerDependenciesTest
;
import
org.jetbrains.jet.JetLiteFixture
;
import
org.jetbrains.jet.JetTestCaseBuilder
;
import
org.jetbrains.jet.JetTestUtils
;
...
...
@@ -67,7 +66,7 @@ public class JetTypeCheckerTest extends JetLiteFixture {
public
void
setUp
()
throws
Exception
{
super
.
setUp
();
super
.
createEnvironmentWithMockJdk
();
super
.
createEnvironmentWithMockJdk
AndIdeaAnnotations
();
library
=
JetStandardLibrary
.
getInstance
();
classDefinitions
=
new
ClassDefinitions
();
...
...
js/js.tests/test/org/jetbrains/k2js/test/TestWithEnvironment.java
浏览文件 @
f4527b81
...
...
@@ -40,7 +40,7 @@ public abstract class TestWithEnvironment extends UsefulTestCase {
@Override
protected
void
setUp
()
throws
Exception
{
super
.
setUp
();
createEnvironmentWithMockJdk
();
createEnvironmentWithMockJdk
AndIdeaAnnotations
();
}
@Override
...
...
@@ -49,7 +49,7 @@ public abstract class TestWithEnvironment extends UsefulTestCase {
super
.
tearDown
();
}
protected
void
createEnvironmentWithMockJdk
()
{
myEnvironment
=
JetTestUtils
.
createEnvironmentWithMockJdk
(
getTestRootDisposable
());
protected
void
createEnvironmentWithMockJdk
AndIdeaAnnotations
()
{
myEnvironment
=
JetTestUtils
.
createEnvironmentWithMockJdk
AndIdeaAnnotations
(
getTestRootDisposable
());
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录