IDEA-93289 (test)

This commit is contained in:
Roman Shevchenko
2012-11-02 21:50:43 +01:00
parent a24681a5cc
commit 8cc5dae048
3 changed files with 27 additions and 2 deletions
@@ -0,0 +1,10 @@
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
class C {
void m(File file) throws IOException {
<caret>FileInputStream fileInputStream = new FileInputStream(file);
int read = fileInputStream.read();
}
}
@@ -0,0 +1,11 @@
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
class C {
void m(File file) throws IOException {
try (FileInputStream fileInputStream = new FileInputStream(file)) {
int read = fileInputStream.read();
}
}
}
@@ -36,8 +36,12 @@ public class SurroundAutoCloseableActionTest extends JavaCodeInsightFixtureTestC
moduleBuilder.setLanguageLevel(LanguageLevel.JDK_1_7);
}
public void testSimple() throws Exception {
CodeInsightTestUtil.doIntentionTest(myFixture, myIntention, "Simple.java", "Simple_after.java");
public void testSimple() { doTest(); }
//public void testUsage() { doTest(); }
private void doTest() {
String name = getTestName(false);
CodeInsightTestUtil.doIntentionTest(myFixture, myIntention, name + ".java", name + "_after.java");
}
@Override