remove junk 'throws Exception'

This commit is contained in:
Dmitry Jemerov
2010-09-22 16:20:30 +04:00
parent 5f236bc360
commit b5bec6a8b5
2 changed files with 20 additions and 17 deletions
@@ -28,7 +28,7 @@ public abstract class LightMarkedTestCase extends PyLightFixtureTestCase {
/**
* Marker "as expected", any alphanumeric sting in angle brackets.
*/
public final @NonNls String MARKER = "<[a-zA-Z0-9_]+>";
public static final @NonNls String MARKER = "<[a-zA-Z0-9_]+>";
/**
* Uses MARKER as regexp.
@@ -37,7 +37,7 @@ public abstract class LightMarkedTestCase extends PyLightFixtureTestCase {
* @return a mapping of markers to PSI elements
* @throws Exception
*/
protected Map<String, PsiElement> configureByFile(@TestDataFile @NonNls String filePath) throws Exception {
protected Map<String, PsiElement> configureByFile(@TestDataFile @NonNls String filePath) {
return configureByFile(filePath, MARKER);
}
@@ -48,14 +48,19 @@ public abstract class LightMarkedTestCase extends PyLightFixtureTestCase {
* @return a mapping of markers to PSI elements
* @throws Exception
*/
protected Map<String, PsiElement> configureByFile(@TestDataFile @NonNls String filePath, @NonNls String markerRegexp)
throws Exception
{
protected Map<String, PsiElement> configureByFile(@TestDataFile @NonNls String filePath, @NonNls String markerRegexp) {
final String fullPath = getTestDataPath() + filePath;
final VirtualFile vFile = LocalFileSystem.getInstance().findFileByPath(fullPath.replace(File.separatorChar, '/'));
assertNotNull("file " + fullPath + " not found", vFile);
String fileText = StringUtil.convertLineSeparators(VfsUtil.loadText(vFile), "\n");
final String text;
try {
text = VfsUtil.loadText(vFile);
}
catch (IOException e) {
throw new RuntimeException(e);
}
String fileText = StringUtil.convertLineSeparators(text, "\n");
final String fileName = vFile.getName();
@@ -71,9 +76,7 @@ public abstract class LightMarkedTestCase extends PyLightFixtureTestCase {
* @return mapping of markers to the PSI elements
* @throws Exception
*/
protected Map<String, PsiElement> configureByFileText(String fileText, final String fileName, @NonNls String markerRegexp)
throws Exception
{
protected Map<String, PsiElement> configureByFileText(String fileText, final String fileName, @NonNls String markerRegexp) {
// build a map of marks to positions, and the text with marks stripped
Pattern pat = Pattern.compile(markerRegexp);
Matcher mat = pat.matcher(fileText);
@@ -13,11 +13,11 @@ import java.util.Map;
* @author Dennis.Ushakov
*/
public class PyInlineLocalTest extends LightMarkedTestCase {
private void doTest() throws Exception {
private void doTest() {
doTest(null);
}
private void doTest(String expectedError) throws Exception {
private void doTest(String expectedError) {
final String name = getTestName(true);
final Map<String,PsiElement> map = configureByFile("/refactoring/inlinelocal/" + name + ".before.py");
try {
@@ -44,27 +44,27 @@ public class PyInlineLocalTest extends LightMarkedTestCase {
myFixture.checkResultByFile("/refactoring/inlinelocal/" + name + ".after.py");
}
public void testSimple() throws Exception {
public void testSimple() {
doTest();
}
public void testPriority() throws Exception {
public void testPriority() {
doTest();
}
public void testNoDominator() throws Exception {
public void testNoDominator() {
doTest("Cannot perform refactoring.\nCannot find a single definition to inline.");
}
public void testDoubleDefinition() throws Exception {
public void testDoubleDefinition() {
doTest("Cannot perform refactoring.\nAnother variable 'foo' definition is used together with inlined one.");
}
public void testMultiple() throws Exception {
public void testMultiple() {
doTest();
}
public void testPy994() throws Exception {
public void testPy994() {
doTest();
}
}