summaryrefslogtreecommitdiff
path: root/java/typeMigration/test/com/intellij/refactoring/TypeMigrationByThreadLocalRuleTest.java
diff options
context:
space:
mode:
authorTor Norbye <tnorbye@google.com>2014-07-25 20:12:40 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-07-24 20:55:36 +0000
commit6044be7330c93bc8dacb0f63e62da8029f39a16f (patch)
tree0ba72f5de1949e0527874a799baa224cbe1537e0 /java/typeMigration/test/com/intellij/refactoring/TypeMigrationByThreadLocalRuleTest.java
parentb03a5855292feb8c331815f883fe64372aacd872 (diff)
parente5266e2343c8d275d79fa0be725180d0fe3a993c (diff)
downloadidea-6044be7330c93bc8dacb0f63e62da8029f39a16f.tar.gz
Merge "Merge remote-tracking branch 'aosp/upstream-master' into merge"
Diffstat (limited to 'java/typeMigration/test/com/intellij/refactoring/TypeMigrationByThreadLocalRuleTest.java')
-rw-r--r--java/typeMigration/test/com/intellij/refactoring/TypeMigrationByThreadLocalRuleTest.java44
1 files changed, 44 insertions, 0 deletions
diff --git a/java/typeMigration/test/com/intellij/refactoring/TypeMigrationByThreadLocalRuleTest.java b/java/typeMigration/test/com/intellij/refactoring/TypeMigrationByThreadLocalRuleTest.java
new file mode 100644
index 000000000000..5d002d3fcced
--- /dev/null
+++ b/java/typeMigration/test/com/intellij/refactoring/TypeMigrationByThreadLocalRuleTest.java
@@ -0,0 +1,44 @@
+/*
+ * User: anna
+ * Date: 19-Aug-2009
+ */
+package com.intellij.refactoring;
+
+import com.intellij.psi.PsiType;
+import com.intellij.psi.search.GlobalSearchScope;
+import com.intellij.openapi.roots.LanguageLevelProjectExtension;
+import com.intellij.pom.java.LanguageLevel;
+import org.jetbrains.annotations.NotNull;
+
+public class TypeMigrationByThreadLocalRuleTest extends TypeMigrationTestBase{
+ @NotNull
+ @Override
+ protected String getTestRoot() {
+ return "/refactoring/typeMigrationByThreadLocal/";
+ }
+
+
+ public void testDirectInt() throws Exception {
+ doTestFieldType("i", PsiType.INT, myJavaFacade.getElementFactory().createTypeFromText("java.lang.ThreadLocal<java.lang.Integer>", null));
+ }
+
+ public void testDirectByte() throws Exception {
+ doTestFieldType("i", PsiType.BYTE, myJavaFacade.getElementFactory().createTypeFromText("java.lang.ThreadLocal<java.lang.Byte>", null));
+ }
+
+ public void testDirectString() throws Exception {
+ doTestFieldType("myS", PsiType.getJavaLangString(myPsiManager, GlobalSearchScope.allScope(myProject)), myJavaFacade.getElementFactory().createTypeFromText("java.lang.ThreadLocal<java.lang.String>", null));
+ }
+
+ public void testLanguageLevel() throws Exception {
+ final LanguageLevelProjectExtension extension = LanguageLevelProjectExtension.getInstance(getProject());
+ final LanguageLevel languageLevel = extension.getLanguageLevel();
+ try {
+ extension.setLanguageLevel(LanguageLevel.JDK_1_3);
+ doTestFieldType("i", PsiType.INT, myJavaFacade.getElementFactory().createTypeFromText("java.lang.ThreadLocal", null));
+ }
+ finally {
+ extension.setLanguageLevel(languageLevel);
+ }
+ }
+} \ No newline at end of file