summaryrefslogtreecommitdiff
path: root/java/java-tests/testSrc/com/intellij/codeInsight/generation/surroundWith/JavaSurroundWithTest.java
diff options
context:
space:
mode:
authorTor Norbye <tnorbye@google.com>2014-09-18 20:40:22 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-09-18 20:40:22 +0000
commit07d35c37ce79a64bdd905b394d40fc9bbb18fa60 (patch)
treee8787c45e494dfcc558faf0f75956f8785c39b94 /java/java-tests/testSrc/com/intellij/codeInsight/generation/surroundWith/JavaSurroundWithTest.java
parente222a9e1e66670a56e926a6b0f3e10231eeeb1fb (diff)
parentb5fb31ef6a38f19404859755dbd2e345215b97bf (diff)
downloadidea-07d35c37ce79a64bdd905b394d40fc9bbb18fa60.tar.gz
Merge "Merge remote-tracking branch 'aosp/upstream-master' into merge"
Diffstat (limited to 'java/java-tests/testSrc/com/intellij/codeInsight/generation/surroundWith/JavaSurroundWithTest.java')
-rw-r--r--java/java-tests/testSrc/com/intellij/codeInsight/generation/surroundWith/JavaSurroundWithTest.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/generation/surroundWith/JavaSurroundWithTest.java b/java/java-tests/testSrc/com/intellij/codeInsight/generation/surroundWith/JavaSurroundWithTest.java
index 60be917bde7c..8bd53fdabfbf 100644
--- a/java/java-tests/testSrc/com/intellij/codeInsight/generation/surroundWith/JavaSurroundWithTest.java
+++ b/java/java-tests/testSrc/com/intellij/codeInsight/generation/surroundWith/JavaSurroundWithTest.java
@@ -17,6 +17,7 @@ package com.intellij.codeInsight.generation.surroundWith;
import com.intellij.codeInsight.template.impl.TemplateManagerImpl;
import com.intellij.codeInsight.template.impl.TemplateState;
+import com.intellij.ide.highlighter.JavaFileType;
import com.intellij.lang.LanguageSurrounders;
import com.intellij.lang.java.JavaLanguage;
import com.intellij.lang.surroundWith.SurroundDescriptor;
@@ -24,6 +25,7 @@ import com.intellij.lang.surroundWith.Surrounder;
import com.intellij.openapi.editor.SelectionModel;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.psi.PsiElement;
+import com.intellij.psi.codeStyle.CommonCodeStyleSettings;
import com.intellij.testFramework.LightCodeInsightTestCase;
import com.intellij.util.containers.ContainerUtil;
import org.jetbrains.annotations.NotNull;
@@ -156,6 +158,18 @@ public class JavaSurroundWithTest extends LightCodeInsightTestCase {
doTest(getTestName(false), new JavaWithIfElseExpressionSurrounder());
}
+ public void testSurroundWithTryFinallyUsingIndents() {
+ CommonCodeStyleSettings.IndentOptions indentOptions = getCurrentCodeStyleSettings().getIndentOptions(JavaFileType.INSTANCE);
+ boolean oldUseTabs = indentOptions.USE_TAB_CHARACTER;
+ try {
+ indentOptions.USE_TAB_CHARACTER = true;
+ doTest(getTestName(false), new JavaWithTryFinallySurrounder());
+ }
+ finally {
+ indentOptions.USE_TAB_CHARACTER = oldUseTabs;
+ }
+ }
+
private void doTest(@NotNull String fileName, final Surrounder surrounder) {
configureByFile(BASE_PATH + fileName + ".java");